[Swift-commit] r6575 - SwiftTutorials/CMTS_2013-06-17/basic_swift/part08
davidk at ci.uchicago.edu
davidk at ci.uchicago.edu
Mon Jun 17 14:19:36 CDT 2013
Author: davidk
Date: 2013-06-17 14:19:36 -0500 (Mon, 17 Jun 2013)
New Revision: 6575
Modified:
SwiftTutorials/CMTS_2013-06-17/basic_swift/part08/README
SwiftTutorials/CMTS_2013-06-17/basic_swift/part08/p8.swift
Log:
Use random number to determine how many random numbers to generate. Updated README.
Modified: SwiftTutorials/CMTS_2013-06-17/basic_swift/part08/README
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/part08/README 2013-06-17 19:18:14 UTC (rev 6574)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/part08/README 2013-06-17 19:19:36 UTC (rev 6575)
@@ -1,80 +1,14 @@
-TOPIC: Example pipelines
+TOPIC: Example pipeline
+This example shows combining two app calls in a pipeline. There are two apps
+defined in this script: mysim4, and mysim4_filename.
-So far we've been running our "simulations" on the local login host.
-Now we'll run them on the parallel cluster.
+mysim4 takes integer to determine the number of random numbers to generate.
+mysim4_filename reads a file to determine the number of random numbers to generate
-The script will be the same as previous, but we change the tool catalog to
-indicate that our "simulation app" (random4.sh) should be run on the
-"westmere" partition of the Midway cluster using the "slurm" scheduler:
+In this example, we use mysim4 to generate a random number. The output of mysim4
+get passed as input to mysim4_filename.
-We changed file "apps" from:
-
- localhost random4 random4.sh
- localhost average avg.sh
-
-to:
-
- cmtsworkshop random4 random4.sh
- localhost average avg.sh
-
-And we added a pool entry to "sites.xml" file which specifies two "pools" of resources,
-the "local host" pool (which we've been using till now) and the "cmtsworkshop" pool.
-
-To run:
-
- $ swift p7.swift -steps=10 -range=1000 -count=6 -nsim=100
-
-Note that we're now asking for 100 simulations to be run, each of which
-is to run for 10 steps (ie 10 seconds).
-
-The sites file looks like this:
-
-<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">1</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">.07</profile> <!-- eg .07 -> 8 -->
-
- <!-- 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>
-
-Try:
-
- o running more app() calls at once: change jobsPerNode and jobThrottle
-
- o requesting more than 1 slurm job at once: change slots
-
- o requesting nodes in units greater than 1: change maxnodes and nodeGranularity
+To run
+$ swift p8.swift -steps=10 -range=100 -count=6 -nsim=1
Modified: SwiftTutorials/CMTS_2013-06-17/basic_swift/part08/p8.swift
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/part08/p8.swift 2013-06-17 19:18:14 UTC (rev 6574)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/part08/p8.swift 2013-06-17 19:19:36 UTC (rev 6575)
@@ -5,9 +5,9 @@
random4 timesteps range_value count_value stdout=@filename(o);
}
-app (file o) mysim4_filename (int timesteps, file range_value, int count_value)
+app (file o) mysim4_filename (int timesteps, int range_value, file count_value)
{
- random4 timesteps @filename(range_value) count_value stdout=@filename(o);
+ random4 timesteps range_value @filename(count_value) stdout=@filename(o);
}
app (file o) analyze (file s[])
@@ -23,13 +23,13 @@
foreach i in [0:nsim-1] {
- file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
- simout = mysim4(steps, range, 1);
+ file random <single_file_mapper; file=@strcat("output/sim_", i, ".random.out")>;
+ random = mysim4(steps, range, 1);
- file simout2 <single_file_mapper; file=@strcat("output/sim_", i, ".tmp.out")>;
- simout2 = mysim4_filename(steps, simout, nsim);
+ file simout <single_file_mapper; file=@strcat("output/sim_", i, ".out")>;
+ simout = mysim4_filename(steps, range, random);
- sims[i] = simout2;
+ sims[i] = simout;
}
file stats<"output/average.out">;
More information about the Swift-commit
mailing list