Commit e11fbdac authored by Andrew McNab's avatar Andrew McNab
Browse files

Use /tmp instead of $HOME

parent 88281b55
VERSION=00.07
VERSION=00.08
......@@ -32,8 +32,8 @@
# POSSIBILITY OF SUCH DAMAGE.
# Remove $JOBFEATURES directory for this job where the directory
# is at $PBS_O_HOME/jobfeatures-$PBS_JOBID ($1 is $PBS_JOBID)
# is at /tmp/jobfeatures-$PBS_JOBID ($1 is $PBS_JOBID)
if [ "$1" != "" -a -d ~/jobfeatures-$1 ] ; then
rm -Rf ~/jobfeatures-$1
if [ "$1" != "" -a -d "/tmp/jobfeatures-$1" -a -O "/tmp/jobfeatures-$1" ] ; then
rm -Rf "/tmp/jobfeatures-$1"
fi
if ( -d /etc/machinefeatures ) then
setenv MACHINEFEATURES /etc/machinefeatures
endif
if ( "$PBS_JOBID" != "" ) then
setenv JOBFEATURES $PBS_O_HOME/jobfeatures-$PBS_JOBID
test
if ( "$PBS_JOBID" != "" && -d "/tmp/jobfeatures-$PBS_JOBID" ) then
setenv JOBFEATURES "/tmp/jobfeatures-$PBS_JOBID"
endif
if [ -d /etc/machinefeatures ] ; then
export MACHINEFEATURES=/etc/machinefeatures
fi
if [ "$PBS_JOBID" != "" ] ; then
export JOBFEATURES=$PBS_O_HOME/jobfeatures-$PBS_JOBID
if [ "$PBS_JOBID" != "" -a -d "/tmp/jobfeatures-$PBS_JOBID" ] ; then
export JOBFEATURES=/tmp/jobfeatures-$PBS_JOBID
fi
......@@ -35,7 +35,7 @@
# specification in HSF-TN-2016-02
#
# This script creates the $JOBFEATURES directory at
# $PBS_O_HOME/jobfeatures-$PBS_JOBID and attempts to populate it
# /tmp/jobfeatures-$PBS_JOBID and attempts to populate it
# from Torque/PBS information and from
# $MACHINEFEATURES=/etc/machinefeatures
#
......@@ -54,14 +54,25 @@
import os
import re
import sys
import stat
import time
homeDir = os.environ['PBS_O_HOME']
try:
job_id = sys.argv[1]
except:
print 'JOB ID not given on command line'
sys.exit(1)
jobfeaturesDir = '/tmp/jobfeatures-' + job_id
job_id = sys.argv[1]
try:
os.mkdir(jobfeaturesDir)
except:
print jobfeaturesDir + ' already exists? - not overwriting'
sys.exit(0)
else:
os.chmod(jobfeaturesDir, stat.S_IRWXU + stat.S_IRGRP + stat.S_IXGRP + stat.S_IROTH + stat.S_IXOTH)
jobfeaturesDir = homeDir + '/jobfeatures-' + job_id
os.mkdir(jobfeaturesDir)
open(jobfeaturesDir + '/job_id', 'w').write(job_id)
jobfeatures = {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment