Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
machinejobfeatures
mjf-scripts
Commits
e11fbdac
Commit
e11fbdac
authored
May 02, 2016
by
Andrew McNab
Browse files
Use /tmp instead of $HOME
parent
88281b55
Changes
5
Hide whitespace changes
Inline
Side-by-side
VERSION
View file @
e11fbdac
VERSION=00.0
7
VERSION=00.0
8
epilogue.user
View file @
e11fbdac
...
...
@@ -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
mjf-torque.csh
View file @
e11fbdac
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
mjf-torque.sh
View file @
e11fbdac
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
prologue.user
View file @
e11fbdac
...
...
@@ -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
=
{}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment