[Swift-commit] r8417 - SwiftApps/subjobs

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Tue Mar 31 15:19:04 CDT 2015


Author: ketan
Date: 2015-03-31 15:19:04 -0500 (Tue, 31 Mar 2015)
New Revision: 8417

Modified:
   SwiftApps/subjobs/bg.sh
Log:
treat larger subblocks

Modified: SwiftApps/subjobs/bg.sh
===================================================================
--- SwiftApps/subjobs/bg.sh	2015-03-27 01:17:37 UTC (rev 8416)
+++ SwiftApps/subjobs/bg.sh	2015-03-31 20:19:04 UTC (rev 8417)
@@ -40,30 +40,54 @@
 # If subblock size is provided, do subblock business
 if [ "$SUBBLOCK_SIZE"_ != "_" ]
 then
-    export SWIFT_SUBBLOCKS=$(get-corners.py "$COBALT_PARTNAME" $SHAPE)
-    export SWIFT_SUBBLOCK_ARRAY=($SWIFT_SUBBLOCKS)
-    
-    #echo "$0": SWIFT_SUBBLOCKS="$SWIFT_SUBBLOCKS"
-    
-    if [ "_$SWIFT_SUBBLOCKS" = _ ]; then
-      echo ERROR: "$0": SWIFT_SUBBLOCKS is null.
-      exit 1
+    #untested
+    if [ "$SUBBLOCK_SIZE" -gt 512 ]
+    then
+        BLOCKS=$(get-bootable-blocks --size $SUBBLOCK_SIZE $COBALT_PARTNAME)
+        
+        for BLOCK in $BLOCKS
+        do
+         boot-block --block $BLOCK &
+        done
+        wait
+        
+        for BLOCK in $BLOCKS
+        do
+          runjob --block $BLOCK : "$@"
+        done
+        wait
+        
+        for BLOCK in $BLOCKS
+        do
+           boot-block --block $BLOCK --free &
+        done
+        wait
+    else
+        export SWIFT_SUBBLOCKS=$(get-corners.py "$COBALT_PARTNAME" $SHAPE)
+        export SWIFT_SUBBLOCK_ARRAY=($SWIFT_SUBBLOCKS)
+        
+        #echo "$0": SWIFT_SUBBLOCKS="$SWIFT_SUBBLOCKS"
+        
+        if [ "_$SWIFT_SUBBLOCKS" = _ ]; then
+          echo ERROR: "$0": SWIFT_SUBBLOCKS is null.
+          exit 1
+        fi
+        
+        nsb=${#SWIFT_SUBBLOCK_ARRAY[@]}
+        
+        CORNER=${SWIFT_SUBBLOCK_ARRAY[$SWIFT_JOB_SLOT]}
+        
+        #Some logging
+        echo "$0": running BLOCK="$COBALT_PARTNAME" SLOT="$SWIFT_JOB_SLOT"
+        echo "$0": running cmd: "$0" args: "$@"
+        echo "$0": running runjob --strace none --block "$COBALT_PARTNAME" --corner "$CORNER" --shape "$SHAPE" -p 16 --np "$((16*$SUBBLOCK_SIZE))" : "$@"
+        
+        #without timeout
+        #runjob --strace none --block "$COBALT_PARTNAME" --corner "$CORNER" --shape "$SHAPE" -p 16 --np "$((16*$SUBBLOCK_SIZE))" : "$@"
+        runjob --block "$COBALT_PARTNAME" --corner "$CORNER" --shape "$SHAPE" -p 16 --np "$((16*$SUBBLOCK_SIZE))" : "$@"
+        
+        echo "Runjob finished."
     fi
-    
-    nsb=${#SWIFT_SUBBLOCK_ARRAY[@]}
-    
-    CORNER=${SWIFT_SUBBLOCK_ARRAY[$SWIFT_JOB_SLOT]}
-    
-    #Some logging
-    echo "$0": running BLOCK="$COBALT_PARTNAME" SLOT="$SWIFT_JOB_SLOT"
-    echo "$0": running cmd: "$0" args: "$@"
-    echo "$0": running runjob --strace none --block "$COBALT_PARTNAME" --corner "$CORNER" --shape "$SHAPE" -p 16 --np "$((16*$SUBBLOCK_SIZE))" : "$@"
-    
-    #without timeout
-    #runjob --strace none --block "$COBALT_PARTNAME" --corner "$CORNER" --shape "$SHAPE" -p 16 --np "$((16*$SUBBLOCK_SIZE))" : "$@"
-    runjob --block "$COBALT_PARTNAME" --corner "$CORNER" --shape "$SHAPE" -p 16 --np "$((16*$SUBBLOCK_SIZE))" : "$@"
-    
-    echo "Runjob finished."
 else
     # run w/o subblocks if no subblock size provided
     echo "Running in nonsubblock mode."




More information about the Swift-commit mailing list