[Swift-commit] r6685 - in SwiftTutorials/UofC_2013-07-29-uc3: . part07 part08 part09

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Mon Jul 29 16:58:55 CDT 2013


Author: davidk
Date: 2013-07-29 16:58:55 -0500 (Mon, 29 Jul 2013)
New Revision: 6685

Added:
   SwiftTutorials/UofC_2013-07-29-uc3/part07/apps
   SwiftTutorials/UofC_2013-07-29-uc3/part07/clean.sh
   SwiftTutorials/UofC_2013-07-29-uc3/part07/p7.swift
   SwiftTutorials/UofC_2013-07-29-uc3/part07/simulate.sh
   SwiftTutorials/UofC_2013-07-29-uc3/part07/sites.xml
   SwiftTutorials/UofC_2013-07-29-uc3/part07/stats.sh
   SwiftTutorials/UofC_2013-07-29-uc3/part08/bias.dat
   SwiftTutorials/UofC_2013-07-29-uc3/part08/clean.sh
   SwiftTutorials/UofC_2013-07-29-uc3/part08/simulate.sh
   SwiftTutorials/UofC_2013-07-29-uc3/part08/stats.sh
   SwiftTutorials/UofC_2013-07-29-uc3/part09/dynamic_bias.dat
   SwiftTutorials/UofC_2013-07-29-uc3/part09/p9.swift
Removed:
   SwiftTutorials/UofC_2013-07-29-uc3/part10/
Modified:
   SwiftTutorials/UofC_2013-07-29-uc3/part08/apps
   SwiftTutorials/UofC_2013-07-29-uc3/part08/p8.swift
   SwiftTutorials/UofC_2013-07-29-uc3/part09/apps
Log:
Parts 07-09


Added: SwiftTutorials/UofC_2013-07-29-uc3/part07/apps
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part07/apps	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part07/apps	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1 @@
+uc3 sh /bin/bash

Added: SwiftTutorials/UofC_2013-07-29-uc3/part07/clean.sh
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part07/clean.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part07/clean.sh	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1 @@
+link ../clean.sh
\ No newline at end of file


Property changes on: SwiftTutorials/UofC_2013-07-29-uc3/part07/clean.sh
___________________________________________________________________
Added: svn:special
   + *

Added: SwiftTutorials/UofC_2013-07-29-uc3/part07/p7.swift
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part07/p7.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part07/p7.swift	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1,28 @@
+type file;
+
+# Application to be called by this script
+
+file simulation_script <"simulate.sh">;
+
+# app() functions for application programs to be called:
+
+app (file out) simulation (file script, int timesteps, int sim_range)
+{
+  bash @filename(script) timesteps sim_range stdout=@filename(out);
+}
+
+# Command line params to this script:
+
+int  nsim  = @toInt(@arg("nsim",  "10"));  # number of simulation programs to run
+int  range = @toInt(@arg("range", "100")); # range of the generated random numbers
+
+# Main script and data
+
+int steps=3;
+
+tracef("\n*** Script parameters: nsim=%i steps=%i range=%i \n\n", nsim, steps, range);
+
+foreach i in [0:nsim-1] {
+  file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
+  simout = simulation(simulation_script, steps, range);
+}

Added: SwiftTutorials/UofC_2013-07-29-uc3/part07/simulate.sh
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part07/simulate.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part07/simulate.sh	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1 @@
+link ../simulate.sh
\ No newline at end of file


Property changes on: SwiftTutorials/UofC_2013-07-29-uc3/part07/simulate.sh
___________________________________________________________________
Added: svn:special
   + *

Added: SwiftTutorials/UofC_2013-07-29-uc3/part07/sites.xml
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part07/sites.xml	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part07/sites.xml	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1,24 @@
+<config>
+  <pool handle="uc3">
+    <execution provider="coaster" jobmanager="local:condor"/>
+    <profile namespace="karajan" key="jobThrottle">10.00</profile>
+    <profile namespace="karajan" key="initialScore">10000</profile>
+    <profile namespace="globus"  key="jobsPerNode">1</profile>
+    <profile namespace="globus"  key="maxtime">300</profile>
+    <profile namespace="globus"  key="maxWalltime">00:01:00</profile>
+    <profile namespace="globus"  key="highOverAllocation">100</profile>
+    <profile namespace="globus"  key="lowOverAllocation">100</profile>
+    <profile namespace="globus"  key="slots">20</profile>
+    <profile namespace="globus"  key="maxNodes">1</profile>
+    <profile namespace="globus"  key="nodeGranularity">1</profile>
+    <profile namespace="globus"  key="condor.+AccountingGroup">"group_friends.{env.USER}"</profile>
+    <profile namespace="globus"  key="jobType">nonshared</profile>
+
+    <!-- Requirements = regexp("uc3-c*", Machine) -->
+         <profile namespace="globus" key="condor.Requirements">regexp("uc3-c*", Machine)</profile>
+    <!-- <profile namespace="globus" key="condor.Requirements">UidDomain == "osg-gk.mwt2.org"</profile> -->
+
+    <workdirectory>.</workdirectory>
+  </pool>
+</config>
+

Added: SwiftTutorials/UofC_2013-07-29-uc3/part07/stats.sh
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part07/stats.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part07/stats.sh	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1 @@
+link ../stats.sh
\ No newline at end of file


Property changes on: SwiftTutorials/UofC_2013-07-29-uc3/part07/stats.sh
___________________________________________________________________
Added: svn:special
   + *

Modified: SwiftTutorials/UofC_2013-07-29-uc3/part08/apps
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part08/apps	2013-07-29 21:52:38 UTC (rev 6684)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part08/apps	2013-07-29 21:58:55 UTC (rev 6685)
@@ -1 +1 @@
-uc3 sh /bin/sh
+uc3 sh /bin/bash

Added: SwiftTutorials/UofC_2013-07-29-uc3/part08/bias.dat
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part08/bias.dat	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part08/bias.dat	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1 @@
+123

Added: SwiftTutorials/UofC_2013-07-29-uc3/part08/clean.sh
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part08/clean.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part08/clean.sh	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1 @@
+link ../clean.sh
\ No newline at end of file


Property changes on: SwiftTutorials/UofC_2013-07-29-uc3/part08/clean.sh
___________________________________________________________________
Added: svn:special
   + *

Modified: SwiftTutorials/UofC_2013-07-29-uc3/part08/p8.swift
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part08/p8.swift	2013-07-29 21:52:38 UTC (rev 6684)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part08/p8.swift	2013-07-29 21:58:55 UTC (rev 6685)
@@ -1,28 +1,41 @@
 type file;
 
-# Application to be called by this script
+# Applications to be called by this script
 
 file simulation_script <"simulate.sh">;
+file analysis_script   <"stats.sh">;
 
 # app() functions for application programs to be called:
 
-app (file out) simulation (file script, int timesteps, int sim_range)
+app (file out) simulation (file script, int timesteps, int sim_range, file bias_file, int scale, int sim_count)
 {
-  sh @filename(script) timesteps sim_range stdout=@filename(out);
+  sh @filename(script) timesteps sim_range @filename(bias_file) scale sim_count stdout=@filename(out);
 }
 
+app (file out) analyze (file script, file s[])
+{
+  sh @script @filenames(s) stdout=@filename(out);
+}
+
 # Command line params to this script:
 
 int  nsim  = @toInt(@arg("nsim",  "10"));  # number of simulation programs to run
+int  steps = @toInt(@arg("steps", "1"));   # number of "steps" each simulation (==seconds of runtime)
 int  range = @toInt(@arg("range", "100")); # range of the generated random numbers
+int  count = @toInt(@arg("count", "10"));  # number of random numbers generated per simulation
 
 # Main script and data
 
-int steps=3;
+tracef("\n*** Script parameters: nsim=%i steps=%i range=%i count=%i\n\n", nsim, steps, range, count);
 
-tracef("\n*** Script parameters: nsim=%i steps=%i range=%i \n\n", nsim, steps, range);
-
+file sims[];                               # Array of files to hold each simulation output
+file bias<"bias.dat">;                     # Input data file to "bias" the numbers:
+                                           # 1 line: scale offset ( N = n*scale + offset)
 foreach i in [0:nsim-1] {
-  file simout <single_file_mapper; file=@strcat("data/out_p00/sim_",i,".out")>;
-  simout = simulation(simulation_script, steps, range);
+  file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
+  simout = simulation(simulation_script, steps, range, bias, 100000, count);
+  sims[i] = simout;
 }
+
+file stats<"data/p01_stats.out">;         # Final output file: average of all "simulations"
+stats = analyze(analysis_script,sims);

Added: SwiftTutorials/UofC_2013-07-29-uc3/part08/simulate.sh
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part08/simulate.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part08/simulate.sh	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1 @@
+link ../simulate.sh
\ No newline at end of file


Property changes on: SwiftTutorials/UofC_2013-07-29-uc3/part08/simulate.sh
___________________________________________________________________
Added: svn:special
   + *

Added: SwiftTutorials/UofC_2013-07-29-uc3/part08/stats.sh
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part08/stats.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part08/stats.sh	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1 @@
+link ../stats.sh
\ No newline at end of file


Property changes on: SwiftTutorials/UofC_2013-07-29-uc3/part08/stats.sh
___________________________________________________________________
Added: svn:special
   + *

Modified: SwiftTutorials/UofC_2013-07-29-uc3/part09/apps
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part09/apps	2013-07-29 21:52:38 UTC (rev 6684)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part09/apps	2013-07-29 21:58:55 UTC (rev 6685)
@@ -1 +1 @@
-uc3 sh /bin/sh
+uc3 sh /bin/bash

Added: SwiftTutorials/UofC_2013-07-29-uc3/part09/dynamic_bias.dat
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part09/dynamic_bias.dat	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part09/dynamic_bias.dat	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1 @@
+342

Added: SwiftTutorials/UofC_2013-07-29-uc3/part09/p9.swift
===================================================================
--- SwiftTutorials/UofC_2013-07-29-uc3/part09/p9.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-07-29-uc3/part09/p9.swift	2013-07-29 21:58:55 UTC (rev 6685)
@@ -0,0 +1,52 @@
+type file;
+
+# Applications to be called by this script
+
+file simulation_script <"simulate.sh">;
+file analysis_script   <"stats.sh">;
+
+# app() functions for application programs to be called:
+
+app (file out) genrand (file script, int timesteps, int sim_range)
+{
+  sh @filename(script) timesteps sim_range stdout=@filename(out);
+}
+
+app (file out) simulation (file script, int timesteps, int sim_range, file bias_file, int scale, int sim_count)
+{
+  sh @filename(script) timesteps sim_range @filename(bias_file) scale sim_count stdout=@filename(out);
+}
+
+app (file out) analyze (file script, file s[])
+{
+  sh @script @filenames(s) stdout=@filename(out);
+}
+
+# Command line params to this script:
+
+int  nsim  = @toInt(@arg("nsim",  "10"));  # number of simulation programs to run
+int  range = @toInt(@arg("range", "100")); # range of the generated random numbers
+int  count = @toInt(@arg("count", "10"));  # number of random numbers generated per simulation
+
+# Main script and data
+
+tracef("\n*** Script parameters: nsim=%i range=%i count=%i\n\n", nsim, range, count);
+
+file bias<"dynamic_bias.dat">;        # Dynamically generated bias for simulation ensemble
+
+bias = genrand(simulation_script, 1, 1000);
+
+file sims[];                               # Array of files to hold each simulation output
+
+foreach i in [0:nsim-1] {
+
+  int steps = readData(genrand(simulation_script, 1, 5));
+  tracef("  for simulation[%i] steps=%i\n", i, steps+1);
+
+  file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
+  simout = simulation(simulation_script, steps+1, range, bias, 100000, count);
+  sims[i] = simout;
+}
+
+file stats<"data/p02_stats.out">;            # Final output file: average of all "simulations"
+stats = analyze(analysis_script,sims);




More information about the Swift-commit mailing list