Local Scratch Space

Each of the compute nodes has a scratch.local directory at the root level of the file system. Since working with local files is much faster than working with files that are accessed over the network (e.g., files in a home directory or in /labs, for instance), local scratch space is provided on each node in order to allow for faster file access.

For example, if your program writes out files of  intermediate and/or final results, writing these files to /scratch.local on the compute node will allow for faster read/write access than writing them to a network share. When you submit a job, a directory is automatically created in /scratch.local for your scratch files. The name of the directory includes the PBS job ID of your job followed by “.compute.cla”, e.g, 6822.compute.cla.

Please note that for any files in /scratch.local that you want to save, your script MUST include commands to copy them from the local scratch directory to a destination on a network share (e.g., your home dir, /labs/$labname/foldername, etc.) as once your job terminates, your files in /scratch.local will be deleted and cannot be recovered.

To copy the files, you can use something like the following in your pbs script:

cp /scratch.local/${PBS_JOBID}/$filename ~/pbs_jobs/$project_name/

Where:
    $filename is the name of the file that you want to copy
    $project_name is the name of the directory where you want to store the file

If you have more than one file in the /scratch.local directory that you want to copy, you can use the "*" wildcard in the copy command. The following example will copy all files in the /scratch.local directory for your job to the pbs_jobs/$project_name directory in your home directory.

cp /scratch.local/${PBS_JOBID}/* ~/pbs_jobs/$project_name/

If you want to copy the files to a location other than a directory (e.g., /labs/$labname/$project_name), just make the appropriate substitutions for the destination directory in the above commands.