[torquedev] tmpdir environment variable

chris chris at clusterresources.com
Tue Dec 4 08:54:24 MST 2007


Steve,

Thanks for the prompt reply, how do I go about accessing the TMPDIR env 
variable? When I ran env from a script I didn't see anything that said 
"TMPDIR=", should I assume that it's /tmp/$PBS_JOBID?

SHELL=/bin/bash
PBS_JOBNAME=script.sh
PBS_ENVIRONMENT=PBS_BATCH
PBS_O_WORKDIR=/home/chris/test
USER=chris
PBS_TASKNUM=1
PBS_O_HOME=/home/chris
PBS_MOMPORT=15003
PBS_O_QUEUE=batch
PATH=/bin:/usr/bin
PBS_O_LOGNAME=chris
PBS_O_LANG=en_GB.UTF-8
PBS_JOBCOOKIE=890388277ED3D4587EE8C6F56108933A
PWD=/home/chris
LANG=en_GB.UTF-8
PBS_NODENUM=0
PBS_O_SHELL=/bin/bash
PBS_SERVER=wopr
PBS_JOBID=7.wopr
ENVIRONMENT=BATCH
HOME=/home/chris
SHLVL=2
PBS_O_HOST=wopr
PBS_VNODENUM=0
LOGNAME=chris
PBS_QUEUE=batch
PBS_NODEFILE=/var/spool/torque/aux//7.wopr
PBS_O_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
_=/usr/bin/env



Excerpt regarding this from the pbs_mom man page.

tmpdir
Sets the directory basename for a per-job temporary directory. Before 
job launch, MOM will append the jobid to the tmpdir basename and create 
the directory. After the job exit, MOM will recursively delete it. The 
env variable TMPDIR will be set for all pro/epi‐log scripts, the job 
script, and TM tasks. Directory creation and removal is done as the job 
owner and group, so the owner must have write permission to create the 
directory. If the directory already exists and is owned by the job 
owner, it will not be deleted after the job. If the directory already 
exists and is NOT owned by the job owner, the job start will be rejected.

Regards,

Steve Traylen wrote:
>
> On Dec 4, 2007, at 3:49 PM, chris wrote:
>
>> Hello All,
>>
>> I've had a site requesting a feature similar to SGE's tmpdir where a 
>> tmpdir environment variable is set with each job. Is this something 
>> that can be added to torque or is there an equivalent that is already 
>> in torque?
>>
>
> Yes , look at the tmpdir option in the man page of the pbs_mom.
>
> Steve
>
>> This is from the SGE manpage.
>>
>> tmpdir
>> The tmpdir parameter specifies the absolute path to the base
>> of the temporary directory filesystem. When *sge_execd(8) 
>> <https://www.cs.kent.ac.uk/people/staff/pao/gridengine/htmlman8/sge_execd.html>* 
>>
>> launches a job, it creates a uniquely-named directory in
>> this filesystem for the purpose of holding scratch files
>> during job execution. At job completion, this directory and
>> its contents are removed automatically. The environment
>> variables TMPDIR and TMP are set to the path of each jobs
>> scratch directory (type string; default: /tmp).
>>
>> Regards,
>>
>> -- 
>> Chris Vaughan
>> EMEA Systems Engineer
>> Cluster Resources, Ltd.
>> Direct - UK Office: +44 (0)1223 437 132
>> Mobile - +44 (0)7800 973 062
>> US Headquarters: +1 801 717 3700
>> Skype: supercomputer1
>> www.clusterresources.co.uk
>>
>>
>> _______________________________________________
>> torquedev mailing list
>> torquedev at supercluster.org
>> http://www.supercluster.org/mailman/listinfo/torquedev
>


-- 
Chris Vaughan
EMEA Systems Engineer
Cluster Resources, Ltd.
Direct - UK Office:  +44 (0)1223 437 132
Mobile - +44 (0)7800 973 062
US Headquarters:  +1 801 717 3700
Skype: supercomputer1
www.clusterresources.co.uk




More information about the torquedev mailing list