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

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Sun Jan 26 19:43:26 CST 2014


Author: ketan
Date: 2014-01-26 19:43:25 -0600 (Sun, 26 Jan 2014)
New Revision: 7518

Modified:
   SwiftApps/swift-galaxy/swift/swiftforeachrange.sh
   SwiftApps/swift-galaxy/swift/swiftforeachrange.xml
Log:
working swift foreach

Modified: SwiftApps/swift-galaxy/swift/swiftforeachrange.sh
===================================================================
--- SwiftApps/swift-galaxy/swift/swiftforeachrange.sh	2014-01-26 23:26:19 UTC (rev 7517)
+++ SwiftApps/swift-galaxy/swift/swiftforeachrange.sh	2014-01-27 01:43:25 UTC (rev 7518)
@@ -1,29 +1,31 @@
 #!/bin/bash
 
+echo $@ > /tmp/args.txt
 # numeric range
-site = $1
+site=$1
 shift
-executable = $1
+executable=$1
 shift
-rstart = $1
+rstart=$1
 shift
-rend = $1
+rend=$1
 shift
-stepsize = $1
+stepsize=$1
 shift
-logfile = $1
+logfile=$1
 
 cat << EOF > /tmp/script.swift
 type file;
 
-(file _out, file _err) app anapp(){
-    anapp stdout=@_out stderr=@_err;
+app (file _out, file _err) anapp(file _exec){
+    sh @_exec stdout=@_out stderr=@_err;
 }
 
 file out[];
 file err[];
+file exec<"$executable">;
 foreach i in [$rstart:$rend:$stepsize]{
-    (out[i],err[i]) = anapp();
+    (out[i],err[i]) = anapp(exec);
 }
 EOF
 
@@ -55,7 +57,7 @@
 
 cat << EOF > /tmp/tc
 midway echo  echo
-midway anapp $executable
+midway sh /bin/sh
 midway cat   cat
 EOF
 
@@ -87,7 +89,7 @@
 EOF
 
 cat << EOF > /tmp/tc
-uc3 anapp $executable
+uc3 sh /bin/sh
 uc3 echo  /bin/echo
 uc3 cat   /bin/cat
 EOF
@@ -121,7 +123,7 @@
 EOF
 
 cat << EOF > /tmp/tc
-stampede anapp $executable
+stampede sh /bin/sh
 stampede echo echo
 stampede cat cat
 EOF
@@ -142,7 +144,7 @@
 EOF
 
 cat << EOF > /tmp/tc
-localhost anapp $executable
+localhost sh /bin/sh
 localhost echo echo
 localhost cat cat
 EOF
@@ -163,7 +165,7 @@
 EOF
 
 cat << EOF > /tmp/tc
-localhost anapp $executable
+localhost sh /bin/sh
 localhost echo echo
 localhost cat cat
 EOF
@@ -180,10 +182,10 @@
 lazy.errors=false
 EOF
 
-$swift -sites.file /tmp/sites.xml -tc.file /tmp/tc -config /tmp/cf /tmp/script.swift 2> $logfile
+$swift -sites.file /tmp/sites.xml -tc.file /tmp/tc -config /tmp/cf /tmp/script.swift 2>$logfile
 EXITCODE=$?
 
 if [ "$EXITCODE" -ne "0" ]; then
-       cat std.err >&2
+       cat $logfile >&2
 fi
 exit $EXITCODE

Modified: SwiftApps/swift-galaxy/swift/swiftforeachrange.xml
===================================================================
--- SwiftApps/swift-galaxy/swift/swiftforeachrange.xml	2014-01-26 23:26:19 UTC (rev 7517)
+++ SwiftApps/swift-galaxy/swift/swiftforeachrange.xml	2014-01-27 01:43:25 UTC (rev 7518)
@@ -2,7 +2,6 @@
   <description>A generic tool to run executable via Swift foreach parallel construct</description>
   
   <command interpreter="bash">
-    #if $configuration.mode == "default"
         swiftforeachrange.sh
             $site 
             $executable
@@ -10,26 +9,6 @@
             $rend
             $stepsize
             $log_file
-    #else
-        swiftforeachrange.sh
-            $site 
-            $executable
-            $rstart
-            $rend
-            $stepsize
-            $log_file
-            $remoteurl
-            $throttle
-            $project
-            $slots
-            $queue
-            $nodes
-            $nodegranularity
-            $jobspernode
-            $ppn
-            $walltime
-            $maxtime
-    #end if
   </command>
 
   <inputs>
@@ -42,9 +21,9 @@
 
     <param format="data" name="executable" type="data" label="Executable"/>
 
-    <param name="rstart" size="2" type="integer"  value="0" label="Executable"/>
-    <param name="rend" size="2" type="integer"  value="9" label="Executable"/>
-    <param name="stepsize" size="2" type="integer"  value="1" label="Executable"/>
+    <param name="rstart" size="2" type="integer"  value="0" label="start"/>
+    <param name="rend" size="2" type="integer"  value="9" label="end"/>
+    <param name="stepsize" size="2" type="integer"  value="1" label="stepsize"/>
     
     <conditional name="configuration">
         <param name="mode" type="select" label="Swift configuration">




More information about the Swift-commit mailing list