title: Change $TMPDIR in a parallel processing
body: <p>I run a batch job on a high-performance computing system to sort aligned reads and used GNU parallel to speed up my work, but my job failed with the following reason:</p>
  
  <blockquote>
    <p>parallel: Error: Output is incomplete. Cannot append to buffer file in
    $TMPDIR. Is the disk full? parallel: Error: Change $TMPDIR with
    --tmpdir or use --compress.</p>
  </blockquote>
  
  <p>My job script looks like this:</p>
  
  <pre><code>module load samtools/1.2
  
  export TMPDIR=/scratch/$SLURM_JOBID
  
  cd /data
  ls *sam* | parallel "samtools sort –T /scratch/$SLURM_JOBID/{.} -O bam -o {}.bam {}"
  </code></pre>
  
  <p>Does anyone know how to solve this problem?</p>