[Swift-commit] r6086 - in SwiftTutorials/UofC_2012-11-27: . bin data scripts

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Tue Nov 27 11:24:46 CST 2012


Author: wozniak
Date: 2012-11-27 11:24:46 -0600 (Tue, 27 Nov 2012)
New Revision: 6086

Added:
   SwiftTutorials/UofC_2012-11-27/README
   SwiftTutorials/UofC_2012-11-27/bin/
   SwiftTutorials/UofC_2012-11-27/bin/cleanup
   SwiftTutorials/UofC_2012-11-27/bin/filterinfo.sh
   SwiftTutorials/UofC_2012-11-27/bin/genapplist
   SwiftTutorials/UofC_2012-11-27/bin/getinfo.sh
   SwiftTutorials/UofC_2012-11-27/bin/myapp
   SwiftTutorials/UofC_2012-11-27/bin/runswift
   SwiftTutorials/UofC_2012-11-27/bin/setup.sh
   SwiftTutorials/UofC_2012-11-27/bin/suminfo.sh
   SwiftTutorials/UofC_2012-11-27/data/
   SwiftTutorials/UofC_2012-11-27/data/data.txt
   SwiftTutorials/UofC_2012-11-27/scripts/
   SwiftTutorials/UofC_2012-11-27/scripts/catsn.swift
   SwiftTutorials/UofC_2012-11-27/scripts/script01.swift
   SwiftTutorials/UofC_2012-11-27/scripts/script02.swift
   SwiftTutorials/UofC_2012-11-27/scripts/script03.swift
   SwiftTutorials/UofC_2012-11-27/scripts/script04.swift
   SwiftTutorials/UofC_2012-11-27/scripts/script05.swift
Log:
Import tutorial content


Added: SwiftTutorials/UofC_2012-11-27/README
===================================================================
--- SwiftTutorials/UofC_2012-11-27/README	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/README	2012-11-27 17:24:46 UTC (rev 6086)
@@ -0,0 +1,6 @@
+
+Introduction to Swift
+
+
+Exercise 1 - Run a simple command under Swift
+

Added: SwiftTutorials/UofC_2012-11-27/bin/cleanup
===================================================================
--- SwiftTutorials/UofC_2012-11-27/bin/cleanup	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/bin/cleanup	2012-11-27 17:24:46 UTC (rev 6086)
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+echo Removing:
+echo
+ls -ltd script??-* 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 script??-* swiftwork _concurrent output *.kml *.swiftx swift.log applist config sites.xml pathlist
+else
+  echo
+  echo No files removed.
+fi
+


Property changes on: SwiftTutorials/UofC_2012-11-27/bin/cleanup
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2012-11-27/bin/filterinfo.sh
===================================================================
--- SwiftTutorials/UofC_2012-11-27/bin/filterinfo.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/bin/filterinfo.sh	2012-11-27 17:24:46 UTC (rev 6086)
@@ -0,0 +1,2 @@
+#! /bin/sh
+grep getinfo.sh $1 | wc -l >$2


Property changes on: SwiftTutorials/UofC_2012-11-27/bin/filterinfo.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2012-11-27/bin/genapplist
===================================================================
--- SwiftTutorials/UofC_2012-11-27/bin/genapplist	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/bin/genapplist	2012-11-27 17:24:46 UTC (rev 6086)
@@ -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_2012-11-27/bin/genapplist
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2012-11-27/bin/getinfo.sh
===================================================================
--- SwiftTutorials/UofC_2012-11-27/bin/getinfo.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/bin/getinfo.sh	2012-11-27 17:24:46 UTC (rev 6086)
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+hostname -f
+date
+sleep 2
+ps -u $USER -H


Property changes on: SwiftTutorials/UofC_2012-11-27/bin/getinfo.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2012-11-27/bin/myapp
===================================================================
--- SwiftTutorials/UofC_2012-11-27/bin/myapp	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/bin/myapp	2012-11-27 17:24:46 UTC (rev 6086)
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+hostname -f
+date
+sleep 3
+ps -u $USER -H -f


Property changes on: SwiftTutorials/UofC_2012-11-27/bin/myapp
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2012-11-27/bin/runswift
===================================================================
--- SwiftTutorials/UofC_2012-11-27/bin/runswift	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/bin/runswift	2012-11-27 17:24:46 UTC (rev 6086)
@@ -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_2012-11-27/bin/runswift
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2012-11-27/bin/setup.sh
===================================================================
--- SwiftTutorials/UofC_2012-11-27/bin/setup.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/bin/setup.sh	2012-11-27 17:24:46 UTC (rev 6086)
@@ -0,0 +1 @@
+PATH=/home/wilde/swift/rev/swift-training/bin:$PWD/bin:$PATH

Added: SwiftTutorials/UofC_2012-11-27/bin/suminfo.sh
===================================================================
--- SwiftTutorials/UofC_2012-11-27/bin/suminfo.sh	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/bin/suminfo.sh	2012-11-27 17:24:46 UTC (rev 6086)
@@ -0,0 +1,2 @@
+#! /bin/sh
+awk '{ sum += $1 } END { print "Total processes observed: " sum }' $*


Property changes on: SwiftTutorials/UofC_2012-11-27/bin/suminfo.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/UofC_2012-11-27/data/data.txt
===================================================================
--- SwiftTutorials/UofC_2012-11-27/data/data.txt	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/data/data.txt	2012-11-27 17:24:46 UTC (rev 6086)
@@ -0,0 +1 @@
+Hi Swift!

Added: SwiftTutorials/UofC_2012-11-27/scripts/catsn.swift
===================================================================
--- SwiftTutorials/UofC_2012-11-27/scripts/catsn.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/scripts/catsn.swift	2012-11-27 17:24:46 UTC (rev 6086)
@@ -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_2012-11-27/scripts/script01.swift
===================================================================
--- SwiftTutorials/UofC_2012-11-27/scripts/script01.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/scripts/script01.swift	2012-11-27 17:24:46 UTC (rev 6086)
@@ -0,0 +1,9 @@
+type file;
+
+app (file o) getinfo ()
+{
+  getinfo stdout=@o;
+}
+
+file info <"output/info.txt">;
+info = getinfo();

Added: SwiftTutorials/UofC_2012-11-27/scripts/script02.swift
===================================================================
--- SwiftTutorials/UofC_2012-11-27/scripts/script02.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/scripts/script02.swift	2012-11-27 17:24:46 UTC (rev 6086)
@@ -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_2012-11-27/scripts/script03.swift
===================================================================
--- SwiftTutorials/UofC_2012-11-27/scripts/script03.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/scripts/script03.swift	2012-11-27 17:24:46 UTC (rev 6086)
@@ -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_2012-11-27/scripts/script04.swift
===================================================================
--- SwiftTutorials/UofC_2012-11-27/scripts/script04.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/scripts/script04.swift	2012-11-27 17:24:46 UTC (rev 6086)
@@ -0,0 +1,25 @@
+type file;
+
+app (file o) getinfo ()
+{
+  getinfo stdout=@o;
+}
+
+app (file o) filter (file i)
+{
+  filterinfo @i @o;
+}
+
+app (file o) reduce (file i[])
+  reduceinfo @filenames(i)
+}
+
+file filtered[];
+
+foreach i in [0:24] {
+  string fname = @strcat("info.",i,".txt");
+  file info <single_file_mapper; file=fname>;
+  info = getinfo();
+  filtered[i] = filterinfo(info);
+}
+

Added: SwiftTutorials/UofC_2012-11-27/scripts/script05.swift
===================================================================
--- SwiftTutorials/UofC_2012-11-27/scripts/script05.swift	                        (rev 0)
+++ SwiftTutorials/UofC_2012-11-27/scripts/script05.swift	2012-11-27 17:24:46 UTC (rev 6086)
@@ -0,0 +1,30 @@
+type file;
+
+app (file o) getinfo ()
+{
+  getinfo stdout=@o;
+}
+
+app (file o) filter (file i)
+{
+  filterinfo @i @o;
+}
+
+app (file o) reduce (file i[])
+{
+  suminfo @filenames(i) stdout=@o;
+}
+
+file filtered[];
+
+foreach i in [0:24] {
+  string fname = @strcat("info.",i,".txt");
+  file info <single_file_mapper; file=fname>;
+  info = getinfo();
+  filtered[i] = filter(info);
+}
+
+file sum<"sum.data">;
+
+sum = reduce(filtered);
+




More information about the Swift-commit mailing list