Setting TMPDIR: Difference between revisions

From HPCwiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
Many programs require writing intermediary or temporary information. A process may even require writing to a temporary location without a user knowing it. For instance, the command <code>sort</code>, part of the <code>bash</code> toolkit, requires a lot of temporary file space when sorting large volumes of data. Often programs take the system default, which is usually <code>/tmp</code> on Linux systems. The <code>/tmp</code> partition is however often too limited in size and can get filled up. When this happens all users that require write access to <code>/tmp</code> will experience problems in running jobs, which can range from unexpected quitting of processes, to erroneous output.
Many programs require writing intermediary or temporary information. A process may even require writing to a temporary location without a user knowing it. For instance, the command <code>sort</code>, part of the <code>bash</code> toolkit, requires a lot of temporary file space when sorting large volumes of data. Often programs take the system default, which is usually <code>/tmp</code> on Linux systems. The <code>/tmp</code> partition is however often too limited in size and can get filled up. When this happens all users that require write access to <code>/tmp</code> will experience problems in running jobs, which can range from unexpected quitting of processes, to erroneous output.


Users can set a custom temporary folder location. Such a folder location is best placed in the 'scratch' space on the /lustre filesystem, because this will ensure periodic tidying up of the custom temporary directory thereby reducing the opportunity for very large temporary files that have gone unnoticed to remain on the filesystem. In addition, this is in line with protocols for the default system temporary directory <code>/tmp</code> as this directory is also periodically purged of older files.


First, create a temporary directory on user designated space on on the 'scratch' partition:
<source lang='bash'>
<source lang='bash'>
mkdir /lustre/scratch/WUR/ABGC/[user]/tmp
mkdir /lustre/scratch/WUR/ABGC/[user]/tmp
</source>
</source>


Set
<source lang='bash'>
<source lang='bash'>
export TMPDIR=/lustre/scratch/WUR/ABGC/[user]/tmp
export TMPDIR=/lustre/scratch/WUR/ABGC/[user]/tmp
</source>
</source>

Revision as of 15:47, 8 December 2013

Many programs require writing intermediary or temporary information. A process may even require writing to a temporary location without a user knowing it. For instance, the command sort, part of the bash toolkit, requires a lot of temporary file space when sorting large volumes of data. Often programs take the system default, which is usually /tmp on Linux systems. The /tmp partition is however often too limited in size and can get filled up. When this happens all users that require write access to /tmp will experience problems in running jobs, which can range from unexpected quitting of processes, to erroneous output.

Users can set a custom temporary folder location. Such a folder location is best placed in the 'scratch' space on the /lustre filesystem, because this will ensure periodic tidying up of the custom temporary directory thereby reducing the opportunity for very large temporary files that have gone unnoticed to remain on the filesystem. In addition, this is in line with protocols for the default system temporary directory /tmp as this directory is also periodically purged of older files.

First, create a temporary directory on user designated space on on the 'scratch' partition: <source lang='bash'> mkdir /lustre/scratch/WUR/ABGC/[user]/tmp </source>

Set <source lang='bash'> export TMPDIR=/lustre/scratch/WUR/ABGC/[user]/tmp </source>