[Swift-commit] r6689 - in SwiftTutorials/uc3: . part10
yadunandb at ci.uchicago.edu
yadunandb at ci.uchicago.edu
Tue Jul 30 13:31:15 CDT 2013
Author: yadunandb
Date: 2013-07-30 13:31:15 -0500 (Tue, 30 Jul 2013)
New Revision: 6689
Added:
SwiftTutorials/uc3/part10/
SwiftTutorials/uc3/part10/apps
SwiftTutorials/uc3/part10/clean.sh
SwiftTutorials/uc3/part10/dynamic_bias.dat
SwiftTutorials/uc3/part10/find_host.sh
SwiftTutorials/uc3/part10/p10.swift
SwiftTutorials/uc3/part10/simulate.sh
SwiftTutorials/uc3/part10/sites.xml
SwiftTutorials/uc3/part10/stats.sh
Log:
Adding P10 of tutorial - Configuring the sites.file to select
specific remote sites.
Added: SwiftTutorials/uc3/part10/apps
===================================================================
--- SwiftTutorials/uc3/part10/apps (rev 0)
+++ SwiftTutorials/uc3/part10/apps 2013-07-30 18:31:15 UTC (rev 6689)
@@ -0,0 +1 @@
+uc3 sh /bin/bash
Added: SwiftTutorials/uc3/part10/clean.sh
===================================================================
--- SwiftTutorials/uc3/part10/clean.sh (rev 0)
+++ SwiftTutorials/uc3/part10/clean.sh 2013-07-30 18:31:15 UTC (rev 6689)
@@ -0,0 +1 @@
+rm -rf *.log *.rlog *.d *.kml *.swiftx output _concurrent
Property changes on: SwiftTutorials/uc3/part10/clean.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftTutorials/uc3/part10/dynamic_bias.dat
===================================================================
--- SwiftTutorials/uc3/part10/dynamic_bias.dat (rev 0)
+++ SwiftTutorials/uc3/part10/dynamic_bias.dat 2013-07-30 18:31:15 UTC (rev 6689)
@@ -0,0 +1 @@
+781
Added: SwiftTutorials/uc3/part10/find_host.sh
===================================================================
--- SwiftTutorials/uc3/part10/find_host.sh (rev 0)
+++ SwiftTutorials/uc3/part10/find_host.sh 2013-07-30 18:31:15 UTC (rev 6689)
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+
+LAST_LOG=`ls -t | grep p10.*log | head -1`
+if [ ! -f "$LAST_LOG" ]
+then
+ echo "No recent logs found"
+ exit 0
+fi
+echo "debug2"
+hosts=`grep "host=" $LAST_LOG | grep "Cpu worker started" | grep -oh "host=.*\ " | sort | uniq`
+
+for host in $hosts
+do
+ echo $host | grep "uc3-c.*" >/dev/null && echo "Cycle seeder : $host"
+ echo $host | grep "uct2-c.*" >/dev/null && echo "Cycle seeder : $host"
+ echo $host | grep "iut2-c.*" >/dev/null && echo "Cycle seeder : $host"
+ echo $host | grep "uct3-c.*" >/dev/null && echo "Cycle seeder : $host"
+ echo $host | grep "appcloud.*" >/dev/null && echo "Cycle seeder : $host"
+done
\ No newline at end of file
Property changes on: SwiftTutorials/uc3/part10/find_host.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftTutorials/uc3/part10/p10.swift
===================================================================
--- SwiftTutorials/uc3/part10/p10.swift (rev 0)
+++ SwiftTutorials/uc3/part10/p10.swift 2013-07-30 18:31:15 UTC (rev 6689)
@@ -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<"output/stats.out">; # Final output file: average of all "simulations"
+stats = analyze(analysis_script,sims);
Added: SwiftTutorials/uc3/part10/simulate.sh
===================================================================
--- SwiftTutorials/uc3/part10/simulate.sh (rev 0)
+++ SwiftTutorials/uc3/part10/simulate.sh 2013-07-30 18:31:15 UTC (rev 6689)
@@ -0,0 +1 @@
+link ../simulate.sh
\ No newline at end of file
Property changes on: SwiftTutorials/uc3/part10/simulate.sh
___________________________________________________________________
Added: svn:special
+ *
Added: SwiftTutorials/uc3/part10/sites.xml
===================================================================
--- SwiftTutorials/uc3/part10/sites.xml (rev 0)
+++ SwiftTutorials/uc3/part10/sites.xml 2013-07-30 18:31:15 UTC (rev 6689)
@@ -0,0 +1,38 @@
+<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">100</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 for Cycle seeder cluster = regexp("uc3-c*", Machine) -->
+ <profile namespace="globus" key="condor.Requirements">regexp("uc3-c*", Machine)</profile>
+
+ <!-- Requirements for ITS virtualization lab machines = regexp("appcloud[0-1][0-9].*", Machine) -->
+ <!-- <profile namespace="globus" key="condor.Requirements">regexp("appcloud[0-1][0-9].*", Machine)</profile> -->
+
+ <!-- Requirements for OSG machines = isUndefined(GLIDECLIENT_Name) == FALSE -->
+ <!-- <profile namespace="globus" key="condor.Requirements">isUndefined(GLIDECLIENT_Name) == FALSE</profile>-->
+
+ <!-- Requirements for Atlas Midwest Tier 2 @ UC = regexp("uct2-c*", Machine) -->
+ <!-- <profile namespace="globus" key="condor.Requirements">regexp("uct2-c*", Machine)</profile> -->
+
+ <!-- Requirements for Atlas Midwest Tier 2 @ IU = regexp("iut2-c*", Machine) -->
+ <!-- <profile namespace="globus" key="condor.Requirements">regexp("iut2-c*", Machine)</profile> -->
+
+ <!-- Requirements for Atlas Midwest Tier 2 @ UIUC = regexp("taub*", Machine) -->
+ <!-- <profile namespace="globus" key="condor.Requirements">regexp("taub*", Machine)</profile> -->
+
+ <workdirectory>.</workdirectory>
+ </pool>
+</config>
+
Added: SwiftTutorials/uc3/part10/stats.sh
===================================================================
--- SwiftTutorials/uc3/part10/stats.sh (rev 0)
+++ SwiftTutorials/uc3/part10/stats.sh 2013-07-30 18:31:15 UTC (rev 6689)
@@ -0,0 +1 @@
+link ../stats.sh
\ No newline at end of file
Property changes on: SwiftTutorials/uc3/part10/stats.sh
___________________________________________________________________
Added: svn:special
+ *
More information about the Swift-commit
mailing list