[Swift-commit] r6423 - in SwiftTutorials/UofC_2013-04-09: . bin part01 part02 part03 part04 part05 part06 part07

wilde at ci.uchicago.edu wilde at ci.uchicago.edu
Tue Apr 9 10:30:37 CDT 2013


Author: wilde
Date: 2013-04-09 10:30:37 -0500 (Tue, 09 Apr 2013)
New Revision: 6423

Modified:
   SwiftTutorials/UofC_2013-04-09/README
   SwiftTutorials/UofC_2013-04-09/bin/setup.sh
   SwiftTutorials/UofC_2013-04-09/part01/README
   SwiftTutorials/UofC_2013-04-09/part02/README
   SwiftTutorials/UofC_2013-04-09/part03/README
   SwiftTutorials/UofC_2013-04-09/part04/README
   SwiftTutorials/UofC_2013-04-09/part05/README
   SwiftTutorials/UofC_2013-04-09/part06/README
   SwiftTutorials/UofC_2013-04-09/part07/README
Log:
Update READMEs and setup script.

Modified: SwiftTutorials/UofC_2013-04-09/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/README	2013-04-09 14:50:39 UTC (rev 6422)
+++ SwiftTutorials/UofC_2013-04-09/README	2013-04-09 15:30:37 UTC (rev 6423)
@@ -12,70 +12,43 @@
 bin:     script tools for the tutorial
 scripts: Swift scripts for the tutorial
 
-An output directory will be created by the Swift scripts
-
-
 Use bin/setup.sh to add tutorial programs to your PATH
 
 Run:
 
 source bin/setup.sh
 
-EXERCISE 1 - Run a simple command under Swift
+verify:
 
-This script simply runs the getinfo command found in bin/getinfo.sh
+$ random.sh # should be found in your PATH now
 
-You can run this on the login node by typing:
 
-bin/getinfo.sh
 
-Inspect getinfo.sh to see what it does.
+The tutorial is arranged in parts.  To begin:
 
-The Swift syntax in scripts/script01.swift directs the output of
-getinfo.sh to file output/info.txt
+$ cd part01
+$ cat README
 
-Run the Swift script by typing:
+When finished:
 
-runswift scripts/script01.swift
+$ cd ../part02  # etc
 
-Check that the output is created in the output directory
+In each part, you can type "cleanup" after running a few swift scripts
+to remove the old logs that build up, and (usually) the output files.
 
-EXERCISE 2 - Run parallel jobs
 
-The Swift syntax in scripts/script02.swift runs the getinfo
-script 25 times in parallel.  Each job produces an output
-file with a different name.
+The topics of the tutorial parts are:
 
-runswift scripts/script02.swift
+part01: First Swift script - run a "simulation" program, random.sh
 
-Check that the output is created successfully
+part02: Specifying the output filenames
 
-EXERCISE 3 - Run parallel jobs with pipelines
+part03: Run many instances of a "simulation" program in a foreach() loop
 
-The Swift syntax in scripts/script02.swift runs the getinfo
-script 25 times in parallel.  Each job produces an output
-file with a different name.  Each output file is then read by the
-filterinfo task, which produces output in _concurrent
+part04: run a program in a foreach() loop with explicitly named output files.
 
-Inspect bin/filterinfo.sh to see what it does to the output of getinfo.sh
+part05: Add a program that "analyzes" the output the parallel simulations
 
-runswift scripts/script03.swift
+part06: Add arguments to the "simulation" program
 
-EXERCISE 4 - Name files in pipelines
-
-In Exercise 3, the final outputs were named by Swift.
-Exercise 4 is similar to 3 but allows you to name the final
-outputs.  Edit script04.swift to name the files in an appropriate
-way.
-
-EXERCISE 5 - Reduction
-
-Exercise 5 allows you to collect all of the filtered outputs
-and summarize them into one file.  This Swift script allows
-suminfo.sh to read all the files and collect a statistic.
-
-Inspect bin/suminfo.sh to see what it will do to the files it reads.
-
-CLEAN UP
-
-Simply run: bin/cleanup and enter y to confirm
+part07: Run the "simulations" on the parallel cluster

Modified: SwiftTutorials/UofC_2013-04-09/bin/setup.sh
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/setup.sh	2013-04-09 14:50:39 UTC (rev 6422)
+++ SwiftTutorials/UofC_2013-04-09/bin/setup.sh	2013-04-09 15:30:37 UTC (rev 6423)
@@ -1,13 +1,9 @@
 module load swift
 
-echo 0=$0
-
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-demobin=$(cd $(dirname $0); pwd)
+echo Adding DIR=$DIR to PATH:
 
-echo demobin=$demobin DIR=$DIR
+PATH=$DIR:$PATH
 
-return
-
-PATH=$PWD/bin:$PATH
+echo $PATH

Modified: SwiftTutorials/UofC_2013-04-09/part01/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part01/README	2013-04-09 14:50:39 UTC (rev 6422)
+++ SwiftTutorials/UofC_2013-04-09/part01/README	2013-04-09 15:30:37 UTC (rev 6423)
@@ -1,6 +1,7 @@
 
-First Swift script - run a "simulation" program, random.sh
+TOPIC: First Swift script - run a "simulation" program, random.sh
 
+
 Verify that random.sh is in your path, and that it works:
 
 $ which random.sh

Modified: SwiftTutorials/UofC_2013-04-09/part02/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part02/README	2013-04-09 14:50:39 UTC (rev 6422)
+++ SwiftTutorials/UofC_2013-04-09/part02/README	2013-04-09 15:30:37 UTC (rev 6423)
@@ -1,5 +1,5 @@
 
-Swift script - run a "simulation" program, random.sh, specifying the output filename
+TOPIC: specifying the output filenames
 
 Study the Swift program:
 

Modified: SwiftTutorials/UofC_2013-04-09/part03/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part03/README	2013-04-09 14:50:39 UTC (rev 6422)
+++ SwiftTutorials/UofC_2013-04-09/part03/README	2013-04-09 15:30:37 UTC (rev 6423)
@@ -1,5 +1,5 @@
 
-Swift script - run many instances of a "simulation" program in a foreach() loop
+TOPIC: run many instances of a "simulation" program in a foreach() loop
 
 
 Run the program:

Modified: SwiftTutorials/UofC_2013-04-09/part04/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part04/README	2013-04-09 14:50:39 UTC (rev 6422)
+++ SwiftTutorials/UofC_2013-04-09/part04/README	2013-04-09 15:30:37 UTC (rev 6423)
@@ -1,7 +1,7 @@
 
-Swift script - run many instances of a "simulation" program in a foreach() loop,
-               with explicitly named output files.
+TOPIC: run a program in a foreach() loop with explicitly named output files.
 
+
 Study the program:
 
 - @strcat() is a Swift builtin function (the @name() form is used for many but not all builtins)

Modified: SwiftTutorials/UofC_2013-04-09/part05/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part05/README	2013-04-09 14:50:39 UTC (rev 6422)
+++ SwiftTutorials/UofC_2013-04-09/part05/README	2013-04-09 15:30:37 UTC (rev 6423)
@@ -1,15 +1,42 @@
 
-Swift script - run many instances of a "simulation" program in a foreach() loop,
-               with explicitly named output files.
 
+TOPIC: Add a program that "analyzes" the output the parallel simulations
+
+
 Study the program:
 
-- @strcat() is a Swift builtin function (the @name() form is used for many bu not all builtins)
+We added a new app to "analyze" all the simulation outputs:
 
-- @strcat() coerces numeric args to strings
+app (file o) analyze (file s[])
+{
+  average @filenames(s) stdout=@filename(o);
+}
 
-- <"filename"> was a shorthand for <single_file_mapper;...> but the latter is more flexible.
+Nots that it expects an array of files as its input, and that
+it uses @filenames() to place the names of all the files on 
+the command line to the "average" program.
 
+Average does:  
+--------------------
+#! /bin/sh
+
+awk '
+
+{ sum += $1}
+
+END { print sum/NR }
+' $*
+-------------------
+
+
+At the end of the script we insert:
+
+file stats<"output/average.out">;
+stats = analyze(sims);
+
+...which runs the analysis *after* all the simulations complete.
+
+
 Run the program:
 
 $ swift -tc.file tc p5.swift
@@ -18,10 +45,7 @@
 
 $ cd output
 $ ls -l
-$ cat *
+$ cat sim*.out
+$ cat average.out
 
 
-Try:
-
-- changing the output names
-

Modified: SwiftTutorials/UofC_2013-04-09/part06/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part06/README	2013-04-09 14:50:39 UTC (rev 6422)
+++ SwiftTutorials/UofC_2013-04-09/part06/README	2013-04-09 15:30:37 UTC (rev 6423)
@@ -1,6 +1,6 @@
 
-Swift script - add arguments to the "simulation" program to control number of steps,
-               range of output, and number of output lines, 
+TOPIC: add arguments to the "simulation" program
+(to control number of steps, range of output, and number of output lines)
 
 
 Test new versions of the "simulation" program:

Modified: SwiftTutorials/UofC_2013-04-09/part07/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part07/README	2013-04-09 14:50:39 UTC (rev 6422)
+++ SwiftTutorials/UofC_2013-04-09/part07/README	2013-04-09 15:30:37 UTC (rev 6423)
@@ -1,5 +1,5 @@
 
-Swift script - execution on the parallel cluster
+TOPIC: Run the "simulations" on the parallel cluster
 
 
 Til now we've been running our "simulations" on the local login host.




More information about the Swift-commit mailing list