[Swift-commit] r6418 - in SwiftTutorials/UofC_2013-04-09: . bin data data/sat part01 part02 part03 part04 part05 scripts

wilde at ci.uchicago.edu wilde at ci.uchicago.edu
Tue Apr 9 01:58:16 CDT 2013


Author: wilde
Date: 2013-04-09 01:57:55 -0500 (Tue, 09 Apr 2013)
New Revision: 6418

Added:
   SwiftTutorials/UofC_2013-04-09/README
   SwiftTutorials/UofC_2013-04-09/SwiftRCCTutorial.2013.0409.pptx
   SwiftTutorials/UofC_2013-04-09/bin/
   SwiftTutorials/UofC_2013-04-09/bin/avg.sh
   SwiftTutorials/UofC_2013-04-09/bin/cleanup
   SwiftTutorials/UofC_2013-04-09/bin/filterinfo.sh
   SwiftTutorials/UofC_2013-04-09/bin/genapplist
   SwiftTutorials/UofC_2013-04-09/bin/getinfo.sh
   SwiftTutorials/UofC_2013-04-09/bin/getlanduse.pl
   SwiftTutorials/UofC_2013-04-09/bin/makeinput
   SwiftTutorials/UofC_2013-04-09/bin/myapp
   SwiftTutorials/UofC_2013-04-09/bin/random.sh
   SwiftTutorials/UofC_2013-04-09/bin/random2.sh
   SwiftTutorials/UofC_2013-04-09/bin/random3.sh
   SwiftTutorials/UofC_2013-04-09/bin/random4.sh
   SwiftTutorials/UofC_2013-04-09/bin/runswift
   SwiftTutorials/UofC_2013-04-09/bin/setup.sh
   SwiftTutorials/UofC_2013-04-09/bin/suminfo.sh
   SwiftTutorials/UofC_2013-04-09/data/
   SwiftTutorials/UofC_2013-04-09/data/data.txt
   SwiftTutorials/UofC_2013-04-09/data/sat/
   SwiftTutorials/UofC_2013-04-09/data/sat/t0
   SwiftTutorials/UofC_2013-04-09/data/sat/t1
   SwiftTutorials/UofC_2013-04-09/data/sat/t2
   SwiftTutorials/UofC_2013-04-09/data/sat/t3
   SwiftTutorials/UofC_2013-04-09/data/sat/t4
   SwiftTutorials/UofC_2013-04-09/data/sat/t5
   SwiftTutorials/UofC_2013-04-09/data/sat/t6
   SwiftTutorials/UofC_2013-04-09/data/sat/t7
   SwiftTutorials/UofC_2013-04-09/data/sat/t8
   SwiftTutorials/UofC_2013-04-09/data/sat/t9
   SwiftTutorials/UofC_2013-04-09/part01/
   SwiftTutorials/UofC_2013-04-09/part01/README
   SwiftTutorials/UofC_2013-04-09/part01/p1.swift
   SwiftTutorials/UofC_2013-04-09/part01/tc
   SwiftTutorials/UofC_2013-04-09/part02/
   SwiftTutorials/UofC_2013-04-09/part02/README
   SwiftTutorials/UofC_2013-04-09/part02/p2.swift
   SwiftTutorials/UofC_2013-04-09/part02/p2b.swift
   SwiftTutorials/UofC_2013-04-09/part02/tc
   SwiftTutorials/UofC_2013-04-09/part03/
   SwiftTutorials/UofC_2013-04-09/part03/README
   SwiftTutorials/UofC_2013-04-09/part03/p3.swift
   SwiftTutorials/UofC_2013-04-09/part03/tc
   SwiftTutorials/UofC_2013-04-09/part04/
   SwiftTutorials/UofC_2013-04-09/part04/README
   SwiftTutorials/UofC_2013-04-09/part04/p4.swift
   SwiftTutorials/UofC_2013-04-09/part04/tc
   SwiftTutorials/UofC_2013-04-09/part05/
   SwiftTutorials/UofC_2013-04-09/part05/README
   SwiftTutorials/UofC_2013-04-09/part05/p5.swift
   SwiftTutorials/UofC_2013-04-09/part05/tc
   SwiftTutorials/UofC_2013-04-09/scripts/
   SwiftTutorials/UofC_2013-04-09/scripts/catsn.swift
   SwiftTutorials/UofC_2013-04-09/scripts/script01.swift
   SwiftTutorials/UofC_2013-04-09/scripts/script02.swift
   SwiftTutorials/UofC_2013-04-09/scripts/script03.swift
   SwiftTutorials/UofC_2013-04-09/scripts/script04.swift
Log:
Initial version

Added: SwiftTutorials/UofC_2013-04-09/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/README	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/README	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,81 @@
+
+INTRODUCTION TO SWIFT
+
+SETUP
+
+Obtain the tutorial package
+
+Change directory into the created directory called "tutorial"
+
+This directory contains:
+
+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
+
+This script simply runs the getinfo command found in bin/getinfo.sh
+
+You can run this on the login node by typing:
+
+bin/getinfo.sh
+
+Inspect getinfo.sh to see what it does.
+
+The Swift syntax in scripts/script01.swift directs the output of
+getinfo.sh to file output/info.txt
+
+Run the Swift script by typing:
+
+runswift scripts/script01.swift
+
+Check that the output is created in the output directory
+
+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.
+
+runswift scripts/script02.swift
+
+Check that the output is created successfully
+
+EXERCISE 3 - Run parallel jobs with pipelines
+
+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
+
+Inspect bin/filterinfo.sh to see what it does to the output of getinfo.sh
+
+runswift scripts/script03.swift
+
+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

Added: SwiftTutorials/UofC_2013-04-09/SwiftRCCTutorial.2013.0409.pptx
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/UofC_2013-04-09/SwiftRCCTutorial.2013.0409.pptx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/UofC_2013-04-09/bin/avg.sh
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/avg.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/avg.sh	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+awk '
+
+{ sum += $1}
+
+END { print sum/NR }
+' $*
+


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/avg.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/cleanup
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/cleanup	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/cleanup	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+echo Removing:
+echo
+ls -ltd *log *.d swiftwork _concurrent output *.kml *.swiftx swift.log applist config sites.xml pathlist 2>/dev/null
+echo
+echo Enter y to proceed:
+read ok
+if [ _$ok = _y -o _$ok = _Y -o _$ok = _yes ]; then
+  echo
+  set -x
+  rm -rf *log *.d swiftwork _concurrent output *.kml *.swiftx swift.log applist config sites.xml pathlist
+else
+  echo
+  echo No files removed.
+fi
+


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/cleanup
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/filterinfo.sh
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/filterinfo.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/filterinfo.sh	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,2 @@
+#! /bin/sh
+grep getinfo.sh $1 | wc -l >$2


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/filterinfo.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/genapplist
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/genapplist	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/genapplist	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,7 @@
+cat <<END
+cluster cat        /bin/cat               null null null
+cluster sh         /bin/sh                null null null
+cluster getinfo    $PWD/bin/getinfo.sh    null null null
+cluster filterinfo $PWD/bin/filterinfo.sh null null null
+cluster suminfo    $PWD/bin/suminfo.sh    null null null
+END


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/genapplist
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/getinfo.sh
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/getinfo.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/getinfo.sh	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+hostname -f
+date
+sleep 2
+ps -u $USER -H


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/getinfo.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/getlanduse.pl
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/getlanduse.pl	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/getlanduse.pl	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,33 @@
+#!/usr/bin/perl -w
+
+# Input to this program should be a raw, greyscale RGB file
+# Usage: rgb_histogram.pl myfile.rgb
+
+if($#ARGV != 1) {
+  die "usage $0: imageFile runTime"
+}
+
+my $image_filename = shift;
+my $runtime = shift;
+
+open(IMAGEFILE, "$image_filename") || die "$0: Unable to open $image_filename!\n";
+binmode IMAGEFILE;
+
+my @pixelcount;
+foreach my $count (0..255) { $pixelcount[$count] = 0; }
+
+# Read values, three bytes at a time
+$/ = \3; 
+foreach(<IMAGEFILE>) {
+   $pixelcount[unpack('C', $_)]++;
+}
+close(IMAGEFILE);
+
+ at sortedcount = sort {$b <=> $a} @pixelcount;
+
+foreach my $count (0..255) {
+   if($sortedcount[$count] == 0) { next; }
+   printf("%d %d\n", $sortedcount[$count], $count);
+}
+
+sleep($runtime);


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/getlanduse.pl
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/makeinput
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/makeinput	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/makeinput	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+nfiles=${1:-10}
+
+rm -rf input
+mkdir input
+cp ../data/sat/t? input/
+( cd input
+  n=0
+  for h in $(seq -w 00 99); do
+    for v in $(seq -w 00 99); do
+      n=$((n+1))
+      if [ $n -gt $nfiles ]; then
+        break;
+      else
+        f=t$(($RANDOM%10))
+        ln $f h${h}v${v}.rgb
+      fi
+    done
+  done
+  rm t?
+)


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/makeinput
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/myapp
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/myapp	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/myapp	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+hostname -f
+date
+sleep 3
+ps -u $USER -H -f


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/myapp
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/random.sh
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/random.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/random.sh	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,2 @@
+#! /bin/sh
+echo $RANDOM


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/random.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/random2.sh
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/random2.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/random2.sh	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,5 @@
+#! /bin/sh
+
+range=$1
+
+echo $(($RANDOM%range))


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/random2.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/random3.sh
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/random3.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/random3.sh	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+range=$1
+n=$2
+
+for ((i=0;i<n;i++)); do
+  echo $(($RANDOM%range))
+done
+


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/random3.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/random4.sh
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/random4.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/random4.sh	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+range=$1
+n=$2
+runtime=$3
+
+sleep $runtime
+
+for ((i=0;i<n;i++)); do
+  echo $(($RANDOM%range))
+done
+


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/random4.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/runswift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/runswift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/runswift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,102 @@
+#! /bin/sh
+
+cat <<END >pathlist
+rule .*_concurrent/.* DIRECT $PWD/tmp
+rule .*               DIRECT /
+END
+
+cat <<END >config
+status.mode=provider
+use.provider.staging=false
+use.wrapper.staging=false
+wrapperlog.always.transfer=true
+execution.retries=0
+lazy.errors=false
+provider.staging.pin.swiftfiles=false
+sitedir.keep=true
+file.gc.enabled=false
+tcp.port.range=50000,51000
+END
+
+reservationID=${reservationID:-swift}
+
+cat <<END >sites.xml
+
+<config>
+
+<pool handle="local">
+
+  <execution provider="local"/>
+  <profile namespace="karajan" key="jobThrottle">0.03</profile>
+  <profile namespace="karajan" key="initialScore">10000</profile>
+  <filesystem provider="local" url="none" />
+  <workdirectory>$PWD/swiftwork</workdirectory>
+
+</pool>
+
+<pool handle="cluster">
+
+  <execution provider="coaster" jobmanager="local:slurm" url="localhost:1"/>
+
+  <profile namespace="globus" key="jobsPerNode">12</profile>
+  <profile namespace="globus" key="ppn">12</profile>
+  <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="queue">westmere</profile>
+
+  <profile namespace="globus" key="providerAttributes">slurm.resource_list=advres=$reservationID</profile>
+
+  <profile namespace="karajan" key="jobThrottle">5.99</profile>
+  <profile namespace="karajan" key="initialScore">10000</profile>
+
+  <profile namespace="globus" key="highOverAllocation">100</profile>
+  <profile namespace="globus" key="lowOverAllocation">100</profile>
+  <profile namespace="globus" key="maxtime">18000</profile>
+  <profile namespace="globus" key="maxwalltime">02:00:00</profile>
+
+  <filesystem provider="local" url="none" />
+  <workdirectory>$PWD/swiftwork</workdirectory>
+
+</pool>
+
+<pool handle="clustermpi">
+
+  <execution provider="coaster" jobmanager="local:slurm" url="localhost:2" />
+
+  <profile namespace="globus" key="jobsPerNode">1</profile>
+  <profile namespace="globus" key="ppn">12</profile>
+  <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="jobType">single</profile>
+  <profile namespace="globus" key="queue">westmere</profile>
+
+  <profile namespace="globus" key="providerAttributes">slurm.resource_list=advres=$reservationID</profile>
+
+  <profile namespace="karajan" key="jobThrottle">0.64</profile>
+  <profile namespace="karajan" key="initialScore">10000</profile>
+
+  <profile namespace="globus" key="highOverAllocation">100</profile>
+  <profile namespace="globus" key="lowOverAllocation">100</profile>
+  <profile namespace="globus" key="maxtime">9000</profile>
+  <profile namespace="globus" key="maxwalltime">01:00:00</profile>
+
+  <filesystem provider="local" url="none" />
+  <workdirectory>$PWD/swiftwork</workdirectory>
+
+</pool>
+
+</config>
+
+END
+
+genapplist >applist
+
+set -x
+#swift -config config -tc.file applist -sites.file sites.xml -cdm.file pathlist $*
+swift -config config -tc.file applist -sites.file sites.xml $*
+
+
+
+


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/runswift
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/bin/setup.sh
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/setup.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/setup.sh	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,13 @@
+module load swift
+
+echo 0=$0
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+demobin=$(cd $(dirname $0); pwd)
+
+echo demobin=$demobin DIR=$DIR
+
+return
+
+PATH=$PWD/bin:$PATH

Added: SwiftTutorials/UofC_2013-04-09/bin/suminfo.sh
===================================================================
--- SwiftTutorials/UofC_2013-04-09/bin/suminfo.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/bin/suminfo.sh	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,2 @@
+#! /bin/sh
+awk '{ sum += $1 } END { print "Total processes observed: " sum }' $*


Property changes on: SwiftTutorials/UofC_2013-04-09/bin/suminfo.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2013-04-09/data/data.txt
===================================================================
--- SwiftTutorials/UofC_2013-04-09/data/data.txt	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/data/data.txt	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1 @@
+Hi Swift!

Added: SwiftTutorials/UofC_2013-04-09/data/sat/t0
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/UofC_2013-04-09/data/sat/t0
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/UofC_2013-04-09/data/sat/t1
===================================================================
--- SwiftTutorials/UofC_2013-04-09/data/sat/t1	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/data/sat/t1	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,13792 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
+
+
+
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file

Added: SwiftTutorials/UofC_2013-04-09/data/sat/t2
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/UofC_2013-04-09/data/sat/t2
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/UofC_2013-04-09/data/sat/t3
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/UofC_2013-04-09/data/sat/t3
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/UofC_2013-04-09/data/sat/t4
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/UofC_2013-04-09/data/sat/t4
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/UofC_2013-04-09/data/sat/t5
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/UofC_2013-04-09/data/sat/t5
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/UofC_2013-04-09/data/sat/t6
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/UofC_2013-04-09/data/sat/t6
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/UofC_2013-04-09/data/sat/t7
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/UofC_2013-04-09/data/sat/t7
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/UofC_2013-04-09/data/sat/t8
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/UofC_2013-04-09/data/sat/t8
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/UofC_2013-04-09/data/sat/t9
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/UofC_2013-04-09/data/sat/t9
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/UofC_2013-04-09/part01/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part01/README	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part01/README	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,39 @@
+
+First Swift script - run a "simulation" program, random.sh
+
+Verify that random.sh is in your path, and that it works:
+
+$ which random.sh
+$ random.sh
+
+Study the Swift program:
+
+$ cat p1.swift
+
+Examine the tool catalog file:
+
+$ cat tc
+
+Run the program:
+
+$ swift -tc.file tc p1.swift
+
+Look at the output:
+
+$ cat _concurrent/*
+
+Look at the other files generated:
+
+$ ls -l
+
+We'll talk more about these files later
+
+$ cleanup
+
+Then test the sript a few more times.
+
+$ swift -tc.file tc p1.swift; cat _concurrent/*
+
+$ swift -tc.file tc p1.swift; cat _concurrent/*
+
+$ swift -tc.file tc p1.swift; cat _concurrent/*

Added: SwiftTutorials/UofC_2013-04-09/part01/p1.swift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part01/p1.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part01/p1.swift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,8 @@
+type file;
+
+app (file o) mysim ()
+{
+  random stdout=@filename(o);
+}
+
+file f = mysim();

Added: SwiftTutorials/UofC_2013-04-09/part01/tc
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part01/tc	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part01/tc	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1 @@
+localhost random random.sh

Added: SwiftTutorials/UofC_2013-04-09/part02/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part02/README	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part02/README	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,33 @@
+
+Swift script - run a "simulation" program, random.sh, specifying the output filename
+
+Study the Swift program:
+
+$ cat p2.swift
+
+Examine the tool catalog file:
+
+$ cat tc
+
+Run the program:
+
+$ swift -tc.file tc p2.swift
+
+Look at the output:
+
+$ cat sim.out
+
+Then test the sript a few more times.
+
+$ swift -tc.file tc p1.swift; cat sim.out
+
+$ swift -tc.file tc p1.swift; cat sim.out
+
+$ swift -tc.file tc p1.swift; cat sim.out
+
+Things to try:
+
+- change the output filename
+
+- add a dir component to the output filename
+

Added: SwiftTutorials/UofC_2013-04-09/part02/p2.swift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part02/p2.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part02/p2.swift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,9 @@
+type file;
+
+app (file o) mysim ()
+{
+  random stdout=@filename(o);
+}
+
+file f<"sim.out">;
+f = mysim();

Added: SwiftTutorials/UofC_2013-04-09/part02/p2b.swift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part02/p2b.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part02/p2b.swift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,9 @@
+type file;
+
+app (file o) mysim ()
+{
+  random stdout=@filename(o);
+}
+
+file f<"output/sim.out">;
+f = mysim();

Added: SwiftTutorials/UofC_2013-04-09/part02/tc
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part02/tc	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part02/tc	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1 @@
+localhost random random.sh

Added: SwiftTutorials/UofC_2013-04-09/part03/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part03/README	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part03/README	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,20 @@
+
+Swift script - run many instances of a "simulation" program in a foreach() loop
+
+
+Run the program:
+
+$ swift -tc.file tc p3.swift
+
+Look at the output:
+
+$ cd _concurrent
+$ ls -l
+$ cat *
+
+Look at the order in which the files were written:
+
+$ ls -lt
+
+We'll come back to this...
+

Added: SwiftTutorials/UofC_2013-04-09/part03/p3.swift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part03/p3.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part03/p3.swift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,11 @@
+type file;
+
+app (file o) mysim ()
+{
+  random stdout=@filename(o);
+}
+
+foreach i in [0:9] {
+  file f = mysim();
+}
+

Added: SwiftTutorials/UofC_2013-04-09/part03/tc
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part03/tc	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part03/tc	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1 @@
+localhost random random.sh

Added: SwiftTutorials/UofC_2013-04-09/part04/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part04/README	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part04/README	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,44 @@
+
+Swift script - run many instances of a "simulation" 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 bu not all builtins)
+
+- @strcat() coerces numeric args to strings
+
+- <"filename"> was a shorthand for <single_file_mapper;...> but the latter is more flexible.
+
+Run the program:
+
+$ swift -tc.file tc p4.swift
+
+Look at the output:
+
+$ cd output
+$ ls -l
+$ cat *
+
+
+Try:
+
+- changing the output names
+
+- @arg("argname") returns arguments after the .swift script on the swift command line:
+
+    swift -tc.file tc p4.swift -myarg1=value1 ...
+
+  @toInt() converts strings to integers:
+
+    @toInt(@arg("myArg1"))
+
+  Adjust the script to take the number of simulations to do from the command line
+
+- trace(expr1,...) traces expressions on stdout.
+
+  Try inserting a few traces.  But remember: Swift is *very* concurrent!
+
+
+
+

Added: SwiftTutorials/UofC_2013-04-09/part04/p4.swift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part04/p4.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part04/p4.swift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,12 @@
+type file;
+
+app (file o) mysim ()
+{
+  random stdout=@filename(o);
+}
+
+foreach i in [0:9] {
+  file f <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
+  f = mysim();
+}
+

Added: SwiftTutorials/UofC_2013-04-09/part04/tc
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part04/tc	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part04/tc	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1 @@
+localhost random random.sh

Added: SwiftTutorials/UofC_2013-04-09/part05/README
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part05/README	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part05/README	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,27 @@
+
+Swift script - run many instances of a "simulation" 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 bu not all builtins)
+
+- @strcat() coerces numeric args to strings
+
+- <"filename"> was a shorthand for <single_file_mapper;...> but the latter is more flexible.
+
+Run the program:
+
+$ swift -tc.file tc p4.swift
+
+Look at the output:
+
+$ cd output
+$ ls -l
+$ cat *
+
+
+Try:
+
+- changing the output names
+

Added: SwiftTutorials/UofC_2013-04-09/part05/p5.swift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part05/p5.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part05/p5.swift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,22 @@
+type file;
+
+app (file o) mysim ()
+{
+  random stdout=@filename(o);
+}
+
+app (file o) analyze (file s[])
+{
+  average @filenames(s) stdout=@filename(o);
+}
+
+file sims[];
+
+foreach i in [0:9] {
+  file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
+  simout = mysim();
+  sims[i] = simout;
+}
+
+file stats<"output/average.out">;
+stats = analyze(sims);

Added: SwiftTutorials/UofC_2013-04-09/part05/tc
===================================================================
--- SwiftTutorials/UofC_2013-04-09/part05/tc	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/part05/tc	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,2 @@
+localhost random  random.sh
+localhost average avg.sh

Added: SwiftTutorials/UofC_2013-04-09/scripts/catsn.swift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/scripts/catsn.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/scripts/catsn.swift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,12 @@
+type file;
+
+app (file o) cat (file i)
+{
+  cat @i stdout=@o;
+}
+
+file out[]<simple_mapper; location="outdir", prefix="f.",suffix=".out">;
+foreach j in [1:@toint(@arg("n","1"))] {
+  file data<"data.txt">;
+  out[j] = cat(data);
+}

Added: SwiftTutorials/UofC_2013-04-09/scripts/script01.swift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/scripts/script01.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/scripts/script01.swift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,9 @@
+type file;
+
+app (file o) getinfo ()
+{
+  getinfo stdout=@o;
+}
+
+file info <"output/info.txt">;
+info = getinfo();

Added: SwiftTutorials/UofC_2013-04-09/scripts/script02.swift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/scripts/script02.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/scripts/script02.swift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,13 @@
+type file;
+
+app (file o) getinfo ()
+{
+  getinfo stdout=@o;
+}
+
+foreach i in [0:24] {
+  string fname = @strcat("output/info.",i,".txt");
+  file info <single_file_mapper; file=fname>;
+  info = getinfo();
+}
+

Added: SwiftTutorials/UofC_2013-04-09/scripts/script03.swift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/scripts/script03.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/scripts/script03.swift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,19 @@
+type file;
+
+app (file o) getinfo ()
+{
+  getinfo stdout=@o;
+}
+
+app (file o) filterinfo (file i)
+{
+  filterinfo @i @o;
+}
+
+foreach i in [0:24] {
+  string fname = @strcat("output/info.",i,".txt");
+  file info <single_file_mapper; file=fname>;
+  info = getinfo();
+  file filtered = filterinfo(info);
+}
+

Added: SwiftTutorials/UofC_2013-04-09/scripts/script04.swift
===================================================================
--- SwiftTutorials/UofC_2013-04-09/scripts/script04.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2013-04-09/scripts/script04.swift	2013-04-09 06:57:55 UTC (rev 6418)
@@ -0,0 +1,25 @@
+type file;
+
+app (file o) getinfo ()
+{
+  getinfo stdout=@o;
+}
+
+app (file o) filter (file i)
+{
+  filterinfo @i @o;
+}
+
+file filtered[];
+
+foreach i in [0:24] {
+  string fname = @strcat("output/info.",i,".txt");
+  file info <single_file_mapper; file=fname>;
+  info = getinfo();
+  // replace: filtered[i] = filter(info);
+  // with:
+  string filfname = ???
+  filfname = 
+  filtered[i] = 
+}
+




More information about the Swift-commit mailing list