[torqueusers] TMPDIR

Garrick Staples garrick at usc.edu
Thu Dec 8 09:48:20 MST 2005


On Thu, Dec 08, 2005 at 11:30:53AM +0100, Simon Robbins alleged:
> 
> Hello,
> 
> thanks for all the responses.
> 
> On 7. Dec 2005, at 10:05 PM, Garrick Staples wrote:
> 
> >On Wed, Dec 07, 2005 at 03:53:59PM +0100, Simon Robbins alleged:
> >>
> >>Hi Garrick,
> >>
> >>I don't like the environment variable name "TMPDIR"
> >>used in torque 2.  I attach the patches that I think
> >>are needed to change the name of this to PBS_TMPDIR,
> >>this seems to work on AMD Opterons.
> >>
> >>Until torque2 I was using an old patch and changing
> >>the name of this variable to PBS_TMPDIR.
> >>Unfortunately I have just had a user who was until
> >>now been innocently using $TMPDIR; torque deleted
> >>the contents of this directory when the job finished :-(
> >>
> >>What do people think about re-naming this variable?
> >
> >So the user is supplying their own TMPDIR variable to the job, set  
> >to a
> >directory that doesn't exist, TORQUE created the directory, and the  
> >user
> >was surprised when TORQUE deleted it after the job?
> 
> The variable "$tmpdir" is defined in the mom config:
> $tmpdir /data
> where /data is a disk local to the node, this works great :-)
> 
> The user was using a set of scripts that used the environment  
> variable $TMPDIR and the qsub -v option:
> qsub ... -v "TMPDIR=/some/directory" ...
> 
> Torque then interpreted this as a cue to use "$TMPDIR" as the  
> transient tmpdir for the job and deleted the contents when the job  
> finished (in the scripts: $TMPDIR was the ROOT directory where the  
> temporary directory should be created (e.g. /tmp)).
> 
> Anyway, the point is the user was not aware of this new behaviour and  
> was surprised when their scripts suddenly stopped working :-)
 
If the user simply makes the directory first, then MOM won't delete it
after the job.


> My suggestion is to rename the variable responsible for this  
> behaviour to "PBS_TMPDIR".  I use the qsub wrapper script to define  
> $TMPDIR to be the same as PBS_TMPDIR inside all jobs.  Only if the  
> user defines "qsub -v "PBS_TMPDIR=/some/dir" will Torque use that as  
> the transient tmpdir and will ignore TMPDIR.  I don't want to change  
> the behaviour just the name.

Noone seems to be a fan of the user-supplied transient TMPDIR anyways
(though noone objected when I first posted it a few weeks ago.) I can
just rip that out easily enough.


> Simon.
> 
> P.S. I also see problems for removal of links e.g.:
> qsub -I
> > cd $TMPDIR
> > mkdir a_directory
> > ln -s a_directory link_to_dir
> exit

I'll take a look at that.


-- 
Garrick Staples, Linux/HPCC Administrator
University of Southern California
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torqueusers/attachments/20051208/bec39c54/attachment.bin


More information about the torqueusers mailing list