[Swift-commit] r6578 - in SwiftTutorials/CMTS_2013-06-17/basic_swift: . part09
yadunandb at ci.uchicago.edu
yadunandb at ci.uchicago.edu
Mon Jun 17 14:37:12 CDT 2013
Author: yadunandb
Date: 2013-06-17 14:37:11 -0500 (Mon, 17 Jun 2013)
New Revision: 6578
Added:
SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/
SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/README
SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/apps
SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/p9.swift
SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/sites.xml
Log:
Committing Part09 example
Added: SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/README
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/README (rev 0)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/README 2013-06-17 19:37:11 UTC (rev 6578)
@@ -0,0 +1,12 @@
+
+TOPIC: Example pipeline with readData
+
+This example shows combining two app calls in a pipeline. The mysim4 app from the
+previous example part08 is called twice here.
+
+mysim4 takes an integer to determine the number of random numbers to generate.
+The random number generated by mysim4 is read from its output file and redirected
+as an argument to itself to generate a random number of random numbers.
+
+To run
+$ swift p8.swift -steps=10 -range=100 -count=6 -nsim=1
Added: SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/apps
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/apps (rev 0)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/apps 2013-06-17 19:37:11 UTC (rev 6578)
@@ -0,0 +1,2 @@
+cmtsworkshop random4 random4.sh
+localhost average avg.sh
Added: SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/p9.swift
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/p9.swift (rev 0)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/p9.swift 2013-06-17 19:37:11 UTC (rev 6578)
@@ -0,0 +1,32 @@
+type file;
+
+app (file o) mysim4 (int timesteps, int range_value, int count_value)
+{
+ random4 timesteps range_value count_value stdout=@filename(o);
+}
+
+app (file o) analyze (file s[])
+{
+ average @filenames(s) stdout=@filename(o);
+}
+
+file sims[];
+int nsim = @toInt(@arg("nsim", "10"));
+int steps = @toInt(@arg("steps", "1"));
+int range = @toInt(@arg("range", "100"));
+int count = @toInt(@arg("count", "10"));
+
+foreach i in [0:nsim-1] {
+
+ file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
+ simout = mysim4(steps, range, 1);
+ int rand = readData(simout);
+
+ file simout2 <single_file_mapper; file=@strcat("output/sim_", i, ".tmp.out")>;
+ simout2 = mysim4(steps, range, rand);
+
+ sims[i] = simout2;
+}
+
+file stats<"output/average.out">;
+stats = analyze(sims);
Added: SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/sites.xml
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/sites.xml (rev 0)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/part09/sites.xml 2013-06-17 19:37:11 UTC (rev 6578)
@@ -0,0 +1,39 @@
+<config>
+
+ <pool handle="localhost">
+ <execution provider="local"/>
+ <filesystem provider="local"/>
+ <workdirectory>/scratch/midway/{env.USER}/swiftwork</workdirectory>
+ </pool>
+
+ <pool handle="cmtsworkshop">
+ <execution provider="coaster" jobmanager="local:slurm"/>
+
+ <!-- Set partition and account here: -->
+ <profile namespace="globus" key="queue">cmtsworkshop</profile>
+ <profile namespace="globus" key="ppn">8</profile>
+ <profile namespace="globus" key="project">cmtsworkshop</profile>
+
+ <!-- Set number of jobs and nodes per job here: -->
+ <profile namespace="globus" key="slots">4</profile>
+ <profile namespace="globus" key="maxnodes">1</profile>
+ <profile namespace="globus" key="nodegranularity">1</profile>
+ <profile namespace="globus" key="jobsPerNode">8</profile> <!-- apps per node! -->
+ <profile namespace="karajan" key="jobThrottle">.31</profile> <!-- eg .31 -> 32 -->
+
+ <!-- Set estimated app time (maxwalltime) and requested job time (maxtime) here: -->
+ <profile namespace="globus" key="maxWalltime">00:15:00</profile>
+ <profile namespace="globus" key="maxtime">1800</profile> <!-- in seconds! -->
+
+ <!-- Set data staging model and work dir here: -->
+ <filesystem provider="local"/>
+ <workdirectory>/scratch/midway/{env.USER}/swiftwork</workdirectory>
+
+ <!-- Typically leave these constant: -->
+ <profile namespace="globus" key="slurm.exclusive">false</profile>
+ <profile namespace="globus" key="highOverAllocation">100</profile>
+ <profile namespace="globus" key="lowOverAllocation">100</profile>
+ <profile namespace="karajan" key="initialScore">10000</profile>
+ </pool>
+
+</config>
More information about the Swift-commit
mailing list