[Swift-commit] r5092 - usertools/persistent-coasters

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Thu Sep 8 09:56:10 CDT 2011


Author: wozniak
Date: 2011-09-08 09:56:09 -0500 (Thu, 08 Sep 2011)
New Revision: 5092

Modified:
   usertools/persistent-coasters/workers-cobalt.zsh
Log:
Now qsub multiple single-node jobs


Modified: usertools/persistent-coasters/workers-cobalt.zsh
===================================================================
--- usertools/persistent-coasters/workers-cobalt.zsh	2011-09-08 14:55:14 UTC (rev 5091)
+++ usertools/persistent-coasters/workers-cobalt.zsh	2011-09-08 14:56:09 UTC (rev 5092)
@@ -26,26 +26,31 @@
   m4 < ${PC}/worker-cobalt.m4.zsh > ${WORKER_WRAPPER}
   chmod u+x ${WORKER_WRAPPER}
 
-  # Launch it
-  cqsub -q ${QUEUE}                          \
-        -p ${PROJECT}                        \
-        -t ${MAXTIME}                        \
-        -n ${NODES}                          \
-        -C ${WORKER_LOGDIR}                  \
-        -E ${WORKER_LOGDIR}/worker.${ID}.err \
-        -o ${WORKER_LOGDIR}/worker.${ID}.out \
-        -e "WORKER_LOGGING_LEVEL=DEBUG"      \
-        ${WORKER_WRAPPER} > cobalt-job-id.txt 2> cobalt.err
-
-  ERR_CHARS=$( wc -c cobalt.err)
+  CQSUB_OUT=${WORKER_LOGDIR}/cqsub-job-id.txt
+  CQSUB_ERR=${WORKER_LOGDIR}/cqsub.err
+  for (( i=0 ; i<NODES ; i++ ))
+  do
+    # Launch it
+    cqsub -q ${QUEUE}                      \
+      -p ${PROJECT}                        \
+      -t ${MAXTIME}                        \
+      -n 1                                 \
+      -C ${WORKER_LOGDIR}                  \
+      -E ${WORKER_LOGDIR}/worker.${ID}.err \
+      -o ${WORKER_LOGDIR}/worker.${ID}.out \
+      -e "WORKER_LOGGING_LEVEL=DEBUG"      \
+      ${WORKER_WRAPPER} > ${CQSUB_OUT} 2> ${CQSUB_ERR}
+      # -n ${NODES}
+    (( ${?} )) && break
+    log "Cobalt JobID[${i}]: $( < ${CQSUB_OUT} )"
+  done
+  ERR_CHARS=$( wc -c < ${CQSUB_ERR} )
   if (( ERR_CHARS ))
     then
     print "Cobalt errors:"
-    cat cobalt.err
+    cat ${CQSUB_ERR}
     return 1
   fi
 
-  log "Cobalt JobID: $( < cobalt-job-id.txt )"
-
   return 0
 }




More information about the Swift-commit mailing list