[Swift-commit] r6991 - in SwiftTutorials/OSG-Swift: app doc

wilde at ci.uchicago.edu wilde at ci.uchicago.edu
Fri Aug 23 19:47:21 CDT 2013


Author: wilde
Date: 2013-08-23 19:47:20 -0500 (Fri, 23 Aug 2013)
New Revision: 6991

Modified:
   SwiftTutorials/OSG-Swift/app/simulate.sh
   SwiftTutorials/OSG-Swift/doc/README
Log:
Edits to doc. Added defaults to simulate.sh help.

Modified: SwiftTutorials/OSG-Swift/app/simulate.sh
===================================================================
--- SwiftTutorials/OSG-Swift/app/simulate.sh	2013-08-23 22:48:17 UTC (rev 6990)
+++ SwiftTutorials/OSG-Swift/app/simulate.sh	2013-08-24 00:47:20 UTC (rev 6991)
@@ -55,15 +55,15 @@
 {
   echo $0: usage:
   cat <<END
-    -b|--bias       offset bias: add this integer to all results
-    -B|--biasfile   file of integer biases to add to results
-    -l|--log        generate a log in stderr if not null
-    -n|--nvalues    print this many values per simulation            
-    -r|--range      range (limit) of generated results
-    -s|--seed       use this integer [0..32767] as a seed
-    -S|--seedfile   use this file (containing integer seeds [0..32767]) one per line
-    -t|--timesteps  number of simulated "timesteps" in seconds (determines runtime)
-    -x|--scale      scale the results by this integer
+    -b|--bias       offset bias: add this integer to all results [0]
+    -B|--biasfile   file of integer biases to add to results [none]
+    -l|--log        generate a log in stderr if not null [y]
+    -n|--nvalues    print this many values per simulation [1]         
+    -r|--range      range (limit) of generated results [100]
+    -s|--seed       use this integer [0..32767] as a seed [none]
+    -S|--seedfile   use this file (containing integer seeds [0..32767]) one per line [none]
+    -t|--timesteps  number of simulated "timesteps" in seconds (determines runtime) [1]
+    -x|--scale      scale the results by this integer [1]
     -h|-?|?|--help  print this help
 END
 }

Modified: SwiftTutorials/OSG-Swift/doc/README
===================================================================
--- SwiftTutorials/OSG-Swift/doc/README	2013-08-23 22:48:17 UTC (rev 6990)
+++ SwiftTutorials/OSG-Swift/doc/README	2013-08-24 00:47:20 UTC (rev 6991)
@@ -50,10 +50,11 @@
 in a portable fashion: The same script runs on grids like OSG, as well
 as on multicore computers, clusters, clouds, and supercomputers.
 
-In this tutorial, you'll be able to first try a few Swift examples on
-the OSG Connect login host, to get a sense of the language. Then
-you'll run similar workflows on distributed OSG resources, and see how
-more complex workflows can be expressed as scripts.
+In this tutorial, you'll be able to first try a few Swift examples
+(parts 1-3) on the OSG Connect login host, to get a sense of the
+language. Then in parts 4-6 you'll run similar workflows on
+distributed OSG Connect resources, and see how more complex workflows
+can be expressed with Swift scripts.
 
 Workflow tutorial setup
 -----------------------
@@ -87,20 +88,22 @@
 To check out the tutorial scripts from SVN
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-If later you want to checkout the most recent Swift tutorial scripts for OSG Connect from SVN, do:
+If you later want to get the most recent version of this tutorial from
+the Swift Subversion repository, do:
 
 -----
 $ svn co https://svn.ci.uchicago.edu/svn/vdl2/SwiftTutorials/OSG-Swift 
 -----
 
 This will create a directory called "OSG-Swift" which contains all of the
-file used in this tutorial.
+files used in this tutorial.
 
 Simple "science applications" for the workflow tutorial
 -------------------------------------------------------
 
-There are two shell scripts included that serve a very simple
-stand-ins for science application: simulation.sh and stats.sh
+This tutorial is based on two simple example programs (both
+implemented as bash shell scripts) that serve a very simple stand-ins
+for real science applications: `simulation.sh` and `stats.sh`.
 
 simulation.sh
 ~~~~~~~~~~~~
@@ -108,24 +111,26 @@
 The simulation.sh script serves as a trivial substitute for a complex
 scientific simulation application. It generates and prints a set of
 one or more random integers in the range [0-2^62) as controlled by its
-optional arguments, which are:
+command line arguments, which are:
 
 -----
 $ ./app/simulate.sh --help
 ./app/simulate.sh: usage:
-    -b|--bias       offset bias: add this integer to all results
-    -B|--biasfile   file of integer biases to add to results
-    -l|--log        generate a log in stderr if not null
-    -n|--nvalues    print this many values per simulation            
-    -r|--range      range (limit) of generated results
-    -s|--seed       use this integer [0..32767] as a seed
-    -S|--seedfile   use this file (containing integer seeds [0..32767]) one per line
-    -t|--timesteps  number of simulated "timesteps" in seconds (determines runtime)
-    -x|--scale      scale the results by this integer
+    -b|--bias       offset bias: add this integer to all results [0]
+    -B|--biasfile   file of integer biases to add to results [none]
+    -l|--log        generate a log in stderr if not null [y]
+    -n|--nvalues    print this many values per simulation [1]         
+    -r|--range      range (limit) of generated results [100]
+    -s|--seed       use this integer [0..32767] as a seed [none]
+    -S|--seedfile   use this file (containing integer seeds [0..32767]) one per line [none]
+    -t|--timesteps  number of simulated "timesteps" in seconds (determines runtime) [1]
+    -x|--scale      scale the results by this integer [1]
     -h|-?|?|--help  print this help
 $ 
 -----
 
+All of thess arguments are optional, with default values indicated above as `[n]`.
+
 ////
 .simulation.sh arguments
 [width="80%",cols="^2,10",options="header"]
@@ -148,7 +153,7 @@
 -----
 $ simulate.sh 2>log
        5
-$ head -5 log
+$ head -4 log
 
 Called as: /home/wilde/swift/tut/CIC_2013-08-09/app/simulate.sh: 
 Start time: Thu Aug 22 12:40:24 CDT 2013
@@ -197,18 +202,69 @@
 -----
 
 
-OSG Connect exercises
----------------------
+Basic of the Swift language with local execution
+------------------------------------------------
 
-Parts 1-3 (p1.swift - p3.swift) run on your login host and serve as
-examples of the Swift language.  Parts 4-6 (p4.swift - p6.swift)
-submit jobs to OSG Connect resources.
+Here's a brief summary of Swift in a nutshell:
 
+* Swift scripts are text files ending in `.swift`
+
+* The `swift` command runs on any host, and executes `.swift`
+scripts. Its a Java application, so you can install Swift almost
+anywhere by simply unpacking the distribution `tar` file and adding
+its `bin/` directory to your `PATH`.
+
+* Swift scripts run ordinary applications, just like shell scripts
+do. But Swift makes it easy to run the applications on parallel and
+remote computers (from laptops to supercomputers). If you can `ssh` to
+the system, Swift can likely run applications there.
+
+* The details of where to run applications and how to get files back
+and forth are described in configuration files separate from your
+program. Swift currently speaks ssh, PBS, Condor, SLURM, LSF, SGE,
+Cobalt, and Globus to run applications, and scp, http, ftp, and
+GridFTP to move data.
+
+* The Swift language has 5 main data types: `boolean`, `int`,
+`string`, `float`, and `file`.
+
+* Swift has a simple library of functions for string and file
+manipulation.
+
+* Swift file variables are "mapped" to external files. Swift sends
+files to and from remote systems for you automatically.
+
+* Swift variables are "single assignment": once you set them you can't
+change them (within a given instance of a block of code).  This makes
+it a natural, parallel "data flow" language. Once you get used to it,
+this programming model keeps your workflow scripts much simpler.
+
+* Swift lets you define functions to "wrap" application programs, and
+to nicely structure more complex scripts. Swift `app` functions take
+files and parameters as inputs and return files as outputs.
+
+* Swift conceptually executes all the statements, expressions and
+function calls in your program in parallel, based on data flow, and
+throttled based on available resources and settings.
+
+* Swift has dynamic, sparse arrays of arbitrary dimension, as well as
+structures defined by the `type` declaration.
+
+* Swift's equivalent of `printf()` is `tracef()`,with limited and
+slightly different format codes.
+
+* Swift's `foreach {}` statement is the main parallel workhorse of the
+language.
+
+* Swift has simple `if` and `switch` statements for conditional
+execution, seldom used in typical workflows.
+
+We'll see many of these points in action in the examples below. Lets
+get started!
+
 Part 1: Run a single application under Swift
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-
-
 The first swift script, p1.swift, runs simulate.sh to generate a
 single random number. It writes the number to a file.
 
@@ -296,6 +352,10 @@
 $ swift p3.swift
 ----
 
+
+Running applications on OSG Connect resources with Swift
+--------------------------------------------------------
+
 Part 4: Running a parallel ensemble on OSG Connect resources
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 




More information about the Swift-commit mailing list