[torqueusers] TMPDIR

Simon Robbins robbins at physik.uni-wuppertal.de
Wed Dec 7 07:53:59 MST 2005


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?

Simon.


On Fri, 2 Dec 2005, Garrick Staples wrote:

> On Fri, Dec 02, 2005 at 04:39:28PM +0000, Steve Traylen alleged:
> > On Fri, Dec 02, 2005 at 05:14:34PM +0100 or thereabouts, Simon Robbins wrote:
> > > 
> > > Hello,
> > > 
> > > I see that the TRANSIENT_TMPDIR patch has been 
> > > incorporated into v2.0.0p2.  How do I activate this 
> > > code?  Or does it only work on Crays?
> > 
> > --enable-tmpdir=/var/spool/pbs 
> > 
> > on the config, it certainly works on linux, no idea about
> > Crays.
> 
> There is no --enable-tmpdir configure option.
> 
> There is a --set-tmpdir option, for a Cray-specific feature, that
> overrides the default of "/tmp".
> 
> The newly-integrated TRANSIENT_TMPDIR patch is configured in MOM's
> config with $tmpdir, works for all arches, and is detailed in the
> pbs_mom manpage.
> 
> I don't know how the new $tmpdir interacts with the Cray-specific
> tmpdir.
> 
> -- 
> Garrick Staples, Linux/HPCC Administrator
> University of Southern California
-------------- next part --------------

--- torque-2.0.0p2-org/src/resmom/unicosmk2/mom_start.c 2005-11-09 18:30:10.000000000 +0100
+++ torque-2.0.0p2/src/resmom/unicosmk2/mom_start.c     2005-12-07 15:21:13.000000000 +0100
@@ -214,7 +214,7 @@
                if ((ret = makedir(tmpdir, uid, gid)) != 0)
                          return ret;
			          }
-       bld_env_variables(vtab, "TMPDIR", tmpdir);
+       bld_env_variables(vtab, "PBS_TMPDIR", tmpdir);
 #if    SRFS
        tmp_dir = strdup(tmpdir);

--- torque-2.0.0p2-org/src/resmom/unicos8/mom_start.c   2005-11-09 18:30:11.000000000 +0100
+++ torque-2.0.0p2/src/resmom/unicos8/mom_start.c       2005-12-07 15:21:23.000000000 +0100
@@ -212,7 +212,7 @@
                if ((ret = makedir(tmpdir, uid, gid)) != 0)
                        return ret;
        }
-       bld_env_variables(vtab, "TMPDIR", tmpdir);
+       bld_env_variables(vtab, "PBS_TMPDIR", tmpdir);
 #if    SRFS
        tmp_dir = strdup(tmpdir);

--- torque-2.0.0p2-org/src/resmom/start_exec.c  2005-11-11 10:27:08.000000000 +0100
+++ torque-2.0.0p2/src/resmom/start_exec.c      2005-12-07 15:21:40.000000000 +0100
@@ -184,7 +184,7 @@
   "PBS_TASKNUM",
   "PBS_MOMPORT",
   "PBS_NODEFILE",
-  "TMPDIR" };
+  "PBS_TMPDIR" };

 static int num_var_else = sizeof(variables_else) / sizeof(char *);

@@ -815,7 +815,7 @@

   char *envval;

-  if ((envval = __get_variable(pjob,"TMPDIR")) != NULL)
+  if ((envval = __get_variable(pjob,"PBS_TMPDIR")) != NULL)
     {
     if (*envval == '/')
       {

--- torque-2.0.0p2-org/src/resmom/prolog.c      2005-11-09 18:30:11.000000000 +0100
+++ torque-2.0.0p2/src/resmom/prolog.c  2005-12-07 15:21:44.000000000 +0100
@@ -581,7 +581,7 @@
     if (TTmpDirName(pjob,buf))
       {

-      const char *envname = "TMPDIR=";
+      const char *envname = "PBS_TMPDIR=";
       char *envstr;

       envstr = malloc(


More information about the torqueusers mailing list