[Swift-commit] r3176 - trunk/libexec
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Sun Oct 25 15:51:37 CDT 2009
Author: hategan
Date: 2009-10-25 15:51:37 -0500 (Sun, 25 Oct 2009)
New Revision: 3176
Modified:
trunk/libexec/_swiftwrap
trunk/libexec/_swiftwrap.vbs
trunk/libexec/vdl-int.k
Log:
scratch directory
Modified: trunk/libexec/_swiftwrap
===================================================================
--- trunk/libexec/_swiftwrap 2009-10-25 20:50:06 UTC (rev 3175)
+++ trunk/libexec/_swiftwrap 2009-10-25 20:51:37 UTC (rev 3176)
@@ -144,11 +144,20 @@
shift $SHIFTCOUNT
fi
+getarg "-scratch" "$@"
+SCRATCH=$VALUE
+shift $SHIFTCOUNT
+
+if [ "X$PROGRESSIVE_INFO" == "X" ]; then
+ INFODIR=$SCRATCH/info/$JOBDIR
+else
+ INFODIR=$WFDIR/info/$JOBDIR
+fi
checkEmpty "$JOBDIR" "Missing job directory prefix"
-mkdir -p $WFDIR/info/$JOBDIR
+mkdir -p $INFODIR
closeinfo
-rm -f "$WFDIR/info/$JOBDIR/${ID}-info"
-openinfo "$WFDIR/info/$JOBDIR/${ID}-info"
+rm -f "$INFODIR/${ID}-info"
+openinfo "$INFODIR/${ID}-info"
logstate "LOG_START"
infosection "Wrapper"
@@ -213,9 +222,9 @@
mkdir -p $WFDIR/status/$JOBDIR
fi
-if [ "X$SWIFT_JOBDIR_PATH" != "X" ]; then
+if [ "$WFDIR" != "$SCRATCH" ]; then
log "Job directory mode is: local copy"
- DIR=${SWIFT_JOBDIR_PATH}/$JOBDIR/$ID
+ DIR=$SCRATCH/$JOBDIR/$ID
COPYNOTLINK=1
else
log "Job directory mode is: link on shared filesystem"
@@ -293,8 +302,18 @@
fi
if [ "$KICKSTART" == "" ]; then
if [ "$STDIN" == "" ]; then
+ if [ "$SWIFT_GEN_SCRIPTS" != "" ]; then
+ echo "#!/bin/bash" > run.sh
+ echo "\"$EXEC\" \"${CMDARGS[@]}\" 1>\"$STDOUT\" 2>\"$STDERR\"" >> run.sh
+ chmod +x run.sh
+ fi
"$EXEC" "${CMDARGS[@]}" 1>"$STDOUT" 2>"$STDERR"
else
+ if [ "$SWIFT_GEN_SCRIPTS" != "" ]; then
+ echo "#!/bin/bash" > run.sh
+ echo "\"$EXEC\" \"${CMDARGS[@]}\" 1>\"$STDOUT\" 2>\"$STDERR\" <\"$STDIN\"" >> run.sh
+ chmod +x run.sh
+ fi
"$EXEC" "${CMDARGS[@]}" 1>"$STDOUT" 2>"$STDERR" <"$STDIN"
fi
checkError $? "Exit code $?"
@@ -361,6 +380,10 @@
closeinfo
-# ensure we exit with a 0 after a successful exection
+if [ "X$PROGRESSIVE_INFO" == "X" ]; then
+ mv "$INFODIR/${ID}-info" "$WFDIR/info/$JOBDIR/${ID}-info"
+fi
+
+# ensure we exit with a 0 after a successful execution
exit 0
Modified: trunk/libexec/_swiftwrap.vbs
===================================================================
--- trunk/libexec/_swiftwrap.vbs 2009-10-25 20:50:06 UTC (rev 3175)
+++ trunk/libexec/_swiftwrap.vbs 2009-10-25 20:51:37 UTC (rev 3176)
@@ -159,6 +159,10 @@
logstate "LOG_START"
+expectArg("scratch")
+SCRATCH = getArgVal(MandatoryArg, "job dir")
+'though we'll ignore SCRATCH here
+
expectArg("e")
EXEC = getArgVal(MandatoryArg, "executable")
Modified: trunk/libexec/vdl-int.k
===================================================================
--- trunk/libexec/vdl-int.k 2009-10-25 20:50:06 UTC (rev 3175)
+++ trunk/libexec/vdl-int.k 2009-10-25 20:51:37 UTC (rev 3176)
@@ -427,6 +427,10 @@
if(wrapperMode == "files"
sequential(
sys:file:write(wrapfile,
+ "-scratch", try(
+ vdl:siteprofile(rhost, "scratch")
+ vdl:siteprofile(rhost, "workdir")
+ )
"-e ",vdl:executable(tr, rhost), nl(),
"-out ",stdout,nl(),
"-err ",stderr,nl(),
@@ -486,6 +490,10 @@
dircat("shared", vdl:siteprofile(rhost, "swift:wrapperScript"), os=os),
jobid,
"-jobdir", jobdir,
+ "-scratch", try(
+ vdl:siteprofile(rhost, "scratch")
+ vdl:siteprofile(rhost, "workdir")
+ )
"-e", vdl:executable(tr, rhost),
"-out", stdout,
"-err", stderr,
More information about the Swift-commit
mailing list