[Swift-commit] r7861 - SwiftApps/swift-galaxy/swift

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Mon May 12 12:49:25 CDT 2014


Author: ketan
Date: 2014-05-12 12:49:25 -0500 (Mon, 12 May 2014)
New Revision: 7861

Modified:
   SwiftApps/swift-galaxy/swift/swiftforeach.py
Log:
vesta case

Modified: SwiftApps/swift-galaxy/swift/swiftforeach.py
===================================================================
--- SwiftApps/swift-galaxy/swift/swiftforeach.py	2014-05-12 16:20:28 UTC (rev 7860)
+++ SwiftApps/swift-galaxy/swift/swiftforeach.py	2014-05-12 17:49:25 UTC (rev 7861)
@@ -207,23 +207,31 @@
         
         #print "Invoking T"
         #EXITCODE=0
+        stc=distutils.spawn.find_executable("stc")
+        java=distutils.spawn.find_executable("java")
+        turbine= distutils.spawn.find_executable("turbine")
         
         if sites == "localhost":
             
             print "localhost"
-            stc=distutils.spawn.find_executable("stc")
-            turbine= distutils.spawn.find_executable("turbine")
             with open(logfile, "wb") as errfile:
-                exitcode=subprocess.check_call([stc, "-j", "/homes/ketan/jdk1.7.0_07/bin/java", wdir+"/script.swift"], stderr=errfile)
+                exitcode=subprocess.check_call([stc, "-j", java, wdir+"/script.swift"], stderr=errfile)
 
             if exitcode == 0:
                 with open(logfile, "wb") as errfile, open("/dev/null", "r") as infile:
-                    exitcode=subprocess.check_call([turbine, "-n", str(n), wdir+"/script.tcl"], stdin=infile, stderr=errfile)
+                    exitcode=subprocess.check_call([turbine, "-n", str(n), wdir+"/script.tcl", swiftargs], stdin=infile, stderr=errfile)
                     
-
         elif sites == "Vesta":
             
             print "vesta"
+            pwd=os.path.getcwd()
+            turbine_home="/home/wozniak/Public/sfw/turbine"
+            with open(logfile, "wb") as errfile:
+                exitcode=subprocess.check_call([stc, "-t", "checkpointing", "-r", pwd, "-j", java, wdir+"/script.swift"], stderr=errfile)
+            
+            if exitcode == 0:
+                with open(logfile, "wb") as errfile, open("/dev/null", "r") as infile:
+                    exitcode=subprocess.check_call([turbine_home+"/scripts/submit/cobalt/turbine-cobalt-run.zsh", "-n", str(n), wdir+"/script.tcl"], stdin=infile, stderr=errfile)
         
         elif sites == "Mira":
         
@@ -232,20 +240,7 @@
         else:
         
             print "site not recognized"
-        #STC=$(\which stc)
-        ##echo "got stc" >> /tmp/status.txt
-        #turbine=$(\which turbine)
-        ##echo "got turbine" >> /tmp/status.txt
-        #$STC -j $(\which java) $wdir/script.swift 2>$logfile
-        ##echo "done running stc" >> /tmp/status.txt
-        ##echo $turbine -n $n $wdir/script.tcl "${swiftargs}" >> /tmp/status.txt
-        #$turbine -n $n $wdir/script.tcl "${swiftargs}" </dev/null
-        ##echo "done running turbine, for $n" >> /tmp/status.txt
-        #EXITCODE=$?
-        ##echo "exit code obtained" >> /tmp/status.txt
-	#;;
         #"Vesta" )
-        #TURBINE_HOME=/home/wozniak/Public/sfw/turbine
         #STC=/home/wozniak/Public/sfw/stc/bin/stc
         #$STC -j $(\which java) -t checkpointing -r ${PWD} $wdir/script.swift 2>$logfile
         #$TURBINE_HOME/scripts/submit/cobalt/turbine-cobalt-run.zsh -n $n -s $HOME/cf $wdir/script.tcl
@@ -266,6 +261,5 @@
     f.write(outlist);
     f.close()
 
-
 if __name__=='__main__':
     main()




More information about the Swift-commit mailing list