[Swift-commit] r7544 - SwiftApps/swift-galaxy/swift
ketan at ci.uchicago.edu
ketan at ci.uchicago.edu
Sat Feb 1 20:51:27 CST 2014
Author: ketan
Date: 2014-02-01 20:51:27 -0600 (Sat, 01 Feb 2014)
New Revision: 7544
Modified:
SwiftApps/swift-galaxy/swift/swiftforeachrange.sh
SwiftApps/swift-galaxy/swift/swiftforeachrange.xml
Log:
dynamic number of commandline args
Modified: SwiftApps/swift-galaxy/swift/swiftforeachrange.sh
===================================================================
--- SwiftApps/swift-galaxy/swift/swiftforeachrange.sh 2014-02-02 02:51:24 UTC (rev 7543)
+++ SwiftApps/swift-galaxy/swift/swiftforeachrange.sh 2014-02-02 02:51:27 UTC (rev 7544)
@@ -2,9 +2,7 @@
#ToDo:
#
-#1. Add arguments, variable number such that user can add and remove them.
-#2. Add a way for users to specify expected outputs.
-#3. Add a type such that only binaries and executable scripts are populated in the executable list.
+#1. Add a variable number of arguments such that user can add and remove them.
#
# numeric range
@@ -24,6 +22,7 @@
shift
logfile=$1
+#Build Swift source code
cat << EOF > /tmp/script.swift
type file;
@@ -42,7 +41,6 @@
swift=$(which swift)
#build site
-echo $PWD > /tmp/pwd.txt
BASEDIR=$(dirname $0)
$BASEDIR/buildsite.sh $site
@@ -76,6 +74,7 @@
EXITCODE=$?
#`for i in \`find $HOME/swift-sandbox -type f\`; do echo "\`basename $i\` $i"; done`
+#Populate output file
cat << EOF > $outlistfile
`for i in \`find $outloc -type f\`; do echo "$i"; done`
EOF
@@ -87,7 +86,6 @@
cat $logfile >&2
fi
-
exit $EXITCODE
#dum ditty dum ditty dum dum dum
Modified: SwiftApps/swift-galaxy/swift/swiftforeachrange.xml
===================================================================
--- SwiftApps/swift-galaxy/swift/swiftforeachrange.xml 2014-02-02 02:51:24 UTC (rev 7543)
+++ SwiftApps/swift-galaxy/swift/swiftforeachrange.xml 2014-02-02 02:51:27 UTC (rev 7544)
@@ -1,93 +1,96 @@
<tool id="swiftforeachrange" name="numrangeforeach">
- <description>A generic tool to run executable via Swift foreach parallel construct</description>
-
- <command interpreter="bash">
+ <description>A generic tool to run executable via Swift foreach parallel construct</description>
+
+ <command interpreter="bash">
swiftforeachrange.sh
- $site
- $executable
- $rstart
- $rend
- $stepsize
- $outloc
- $logfile
- $outlist
- </command>
+ $site
+ $executable
+ $rstart
+ $rend
+ $stepsize
+ $outloc
+ $logfile
+ $outlist
+ </command>
- <inputs>
- <param name="site" type="select" label="Execution Location">
- <option value="localhost">Localhost</option>
- <option value="midway">Midway</option>
- <option value="uc3">UC3</option>
- <option value="stampede">Stampede</option>
- </param>
+ <inputs>
+ <param name="site" type="select" label="Execution Location">
+ <option value="localhost">Localhost</option>
+ <option value="midway">Midway</option>
+ <option value="uc3">UC3</option>
+ <option value="stampede">Stampede</option>
+ </param>
- <param format="sh,binexec" name="executable" type="data" label="Executable"/>
+ <param format="sh,binexec" name="executable" type="data" 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"/>
-
- <param name="outloc" size="50" type="text" value="$HOME/swift-sandbox" label="location for output files" help="Swift will write output files here on disc">
- <sanitizer sanitize="False" />
- </param>
+ <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"/>
+ <repeat name="arg" title="arg">
+ <param name="argname" type="text" label="arg" />
+ </repeat>
- <conditional name="configuration">
- <param name="mode" type="select" label="Swift configuration">
- <option value="default">default configuration</option>
- <option value="advanced">advanced configuration</option>
- </param>
+ <param name="outloc" size="50" type="text" value="$HOME/swift-sandbox" label="location for output files" help="Swift will write output files here on disc">
+ <sanitizer sanitize="False" />
+ </param>
- <when value="default">
- </when>
- <when value="advanced">
- <param name="remoteurl" size="50" type="text" value="midway.swift.rcc.uchicago.edu" label="remote url" help="remote resource to run jobs on"></param>
- <param name="throttle" size="5" type="float" value="0.07" label="job throttle" help="number of parallel jobs to run"></param>
- <param name="project" type="text" value="TG-STA110005S" label="Project allocation" help="name/code of project"></param>
- <param name="slots" size="5" type="integer" value="1" label="slots" help="number of scheduler jobs"></param>
- <param name="queue" size="5" type="text" value="normal" label="queue" help="queue to run jobs on"></param>
- <param name="nodes" size="5" type="integer" value="1" label="nodes" help="number of nodes requested"></param>
- <param name="nodegranularity" size="5" type="integer" value="1" label="node granularity" help="node granularity"></param>
- <param name="jobspernode" size="5" type="integer" value="8" label="jobs per node" help="number of jobs per node requested"></param>
- <param name="ppn" size="5" type="integer" value="8" label="ppn" help="processes per node requested"></param>
- <param name="walltime" size="5" type="text" value="00:10:00" label="Job walltime" help="time in hh:mm:ss to request to scheduler for this job"></param>
- <param name="maxtime" size="5" type="integer" value="700" label="application maxtime" help="Application maxtime in seconds for this job"></param>
- </when>
- </conditional>
- </inputs>
- <outputs>
- <data format="txt" name="logfile" type="data" label="Swift output" />
- <data format="txt" name="outlist" type="data" label="Output list" />
- </outputs>
+ <conditional name="configuration">
+ <param name="mode" type="select" label="Swift configuration">
+ <option value="default">default configuration</option>
+ <option value="advanced">advanced configuration</option>
+ </param>
- <!--
+ <when value="default">
+ </when>
+ <when value="advanced">
+ <param name="remoteurl" size="50" type="text" value="midway.swift.rcc.uchicago.edu" label="remote url" help="remote resource to run jobs on"></param>
+ <param name="throttle" size="5" type="float" value="0.07" label="job throttle" help="number of parallel jobs to run"></param>
+ <param name="project" type="text" value="TG-STA110005S" label="Project allocation" help="name/code of project"></param>
+ <param name="slots" size="5" type="integer" value="1" label="slots" help="number of scheduler jobs"></param>
+ <param name="queue" size="5" type="text" value="normal" label="queue" help="queue to run jobs on"></param>
+ <param name="nodes" size="5" type="integer" value="1" label="nodes" help="number of nodes requested"></param>
+ <param name="nodegranularity" size="5" type="integer" value="1" label="node granularity" help="node granularity"></param>
+ <param name="jobspernode" size="5" type="integer" value="8" label="jobs per node" help="number of jobs per node requested"></param>
+ <param name="ppn" size="5" type="integer" value="8" label="ppn" help="processes per node requested"></param>
+ <param name="walltime" size="5" type="text" value="00:10:00" label="Job walltime" help="time in hh:mm:ss to request to scheduler for this job"></param>
+ <param name="maxtime" size="5" type="integer" value="700" label="application maxtime" help="Application maxtime in seconds for this job"></param>
+ </when>
+ </conditional>
+ </inputs>
+ <outputs>
+ <data format="txt" name="logfile" type="data" label="Swift output" />
+ <data format="txt" name="outlist" type="data" label="Output list" />
+ </outputs>
+
+ <!--
<code file="postprocess.py">
<hook postprocess="writeoutlist" />
</code>
-->
<help>
-.. class:: warningmark
+ .. class:: warningmark
-**TIP**. A generic Swift foreach to run arbitrary executables in parallel over a range of numbers.
+ **TIP**. A generic Swift foreach to run arbitrary executables in parallel over a range of numbers.
------
+ -----
-**What it does**
+ **What it does**
-This is a generic Swift tool that runs an executable over a range of numbers with arbitrary stepsize.
+ This is a generic Swift tool that runs an executable over a range of numbers with arbitrary stepsize.
------
+ -----
-**Example**
+ **Example**
-Pick up an executable from the Executable list. Enter the start, end and the step size values.
+ Pick up an executable from the Executable list. Enter the start, end and the step size values.
-If an executable is echo.sh:
+ If an executable is echo.sh:
-echo $1
+ echo $1
-The start, end and step is 0, 9 and 2, the executable will be invoked in parallel 5 times for n where n is 0 2 4 6 8:
+ The start, end and step is 0, 9 and 2, the executable will be invoked in parallel 5 times for n where n is 0 2 4 6 8:
-echo n
+ echo n
</help>
</tool>
More information about the Swift-commit
mailing list