[Swift-commit] r6572 - in SwiftTutorials/CMTS_2013-06-17/basic_swift: . swift10
ketan at ci.uchicago.edu
ketan at ci.uchicago.edu
Mon Jun 17 14:14:57 CDT 2013
Author: ketan
Date: 2013-06-17 14:14:57 -0500 (Mon, 17 Jun 2013)
New Revision: 6572
Added:
SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/
SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/README
SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/apps
SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/gold_5nm.coor
SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/gold_qvals.txt
SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/p10.swift
SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/particles.dat
SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/sites.xml
Log:
TJ Lane's example
Added: SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/README
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/README (rev 0)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/README 2013-06-17 19:14:57 UTC (rev 6572)
@@ -0,0 +1,25 @@
+
+TOPIC: Example illustrating readData from a file with multiple fields
+
+To run:
+
+ $ swift p10.swift
+
+In this example, multiple fields from a file are read into a Swift struct
+variable. The file particles.dat contains eight fields corresponding to eight
+members in the struct type defined in p10.swift as follows:
+
+type shootargs{
+ string coords;
+ string qvals;
+ int numphi;
+ int numshots;
+ int nummolec;
+ float photons;
+ int parallel;
+ string output_filename;
+}
+
+Note that the first row in the particles.dat corresponds to the member names in
+the shootargs type which is how Swift assigns values to structure member
+variables.
Added: SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/apps
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/apps (rev 0)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/apps 2013-06-17 19:14:57 UTC (rev 6572)
@@ -0,0 +1,3 @@
+cmtsworkshop random4 random4.sh
+cmtsworkshop echo echo
+localhost average avg.sh
Added: SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/gold_5nm.coor
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/gold_5nm.coor (rev 0)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/gold_5nm.coor 2013-06-17 19:14:57 UTC (rev 6572)
@@ -0,0 +1,3 @@
+====
+Test.
+====
Added: SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/gold_qvals.txt
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/gold_qvals.txt (rev 0)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/gold_qvals.txt 2013-06-17 19:14:57 UTC (rev 6572)
@@ -0,0 +1,3 @@
+=====
+Hello
+=====
Added: SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/p10.swift
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/p10.swift (rev 0)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/p10.swift 2013-06-17 19:14:57 UTC (rev 6572)
@@ -0,0 +1,30 @@
+type qvalfile;
+type coordfile;
+type shotfile;
+
+type shootargs{
+ string coords;
+ string qvals;
+ int numphi;
+ int numshots;
+ int nummolec;
+ float photons;
+ int parallel;
+ string output_filename;
+}
+
+app (shotfile outfile) shootsim (shootargs args, coordfile coords, qvalfile qvals) {
+ echo "polshoot" "-s" @coords "-f" @qvals "-x" args.numphi "-n" args.numshots
+ "-m" args.nummolec "-g" args.photons "-p" args.parallel "-o" @outfile
+ stdout=@outfile; # Note double use of outfile, just for testing/demo
+}
+
+shootargs myargs[] = readData("particles.dat");
+
+foreach a in myargs {
+ shotfile output <single_file_mapper; file=a.output_filename>;
+ coordfile coords <single_file_mapper; file=a.coords>;
+ qvalfile qvals <single_file_mapper; file=a.qvals>;
+ output = shootsim(a, coords, qvals);
+}
+
Added: SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/particles.dat
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/particles.dat (rev 0)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/particles.dat 2013-06-17 19:14:57 UTC (rev 6572)
@@ -0,0 +1,6 @@
+coords qvals numphi numshots nummolec photons parallel output_filename
+gold_5nm.coor gold_qvals.txt 3600 10 1 0.25 12 out0.ring
+gold_5nm.coor gold_qvals.txt 3600 10 2 0.5 12 out1.ring
+gold_5nm.coor gold_qvals.txt 3600 10 4 1.0 12 out2.ring
+gold_5nm.coor gold_qvals.txt 3600 10 8 2.0 12 out3.ring
+gold_5nm.coor gold_qvals.txt 3600 10 16 4.0 12 out4.ring
Added: SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/sites.xml
===================================================================
--- SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/sites.xml (rev 0)
+++ SwiftTutorials/CMTS_2013-06-17/basic_swift/swift10/sites.xml 2013-06-17 19:14:57 UTC (rev 6572)
@@ -0,0 +1,39 @@
+<config>
+
+ <pool handle="localhost">
+ <execution provider="local"/>
+ <filesystem provider="local"/>
+ <workdirectory>/scratch/midway/{env.USER}/swiftwork</workdirectory>
+ </pool>
+
+ <pool handle="cmtsworkshop">
+ <execution provider="coaster" jobmanager="local:slurm"/>
+
+ <!-- Set partition and account here: -->
+ <profile namespace="globus" key="queue">cmtsworkshop</profile>
+ <profile namespace="globus" key="ppn">8</profile>
+ <profile namespace="globus" key="project">cmtsworkshop</profile>
+
+ <!-- Set number of jobs and nodes per job here: -->
+ <profile namespace="globus" key="slots">4</profile>
+ <profile namespace="globus" key="maxnodes">1</profile>
+ <profile namespace="globus" key="nodegranularity">1</profile>
+ <profile namespace="globus" key="jobsPerNode">8</profile> <!-- apps per node! -->
+ <profile namespace="karajan" key="jobThrottle">.31</profile> <!-- eg .31 -> 32 -->
+
+ <!-- Set estimated app time (maxwalltime) and requested job time (maxtime) here: -->
+ <profile namespace="globus" key="maxWalltime">00:15:00</profile>
+ <profile namespace="globus" key="maxtime">1800</profile> <!-- in seconds! -->
+
+ <!-- Set data staging model and work dir here: -->
+ <filesystem provider="local"/>
+ <workdirectory>/scratch/midway/{env.USER}/swiftwork</workdirectory>
+
+ <!-- Typically leave these constant: -->
+ <profile namespace="globus" key="slurm.exclusive">false</profile>
+ <profile namespace="globus" key="highOverAllocation">100</profile>
+ <profile namespace="globus" key="lowOverAllocation">100</profile>
+ <profile namespace="karajan" key="initialScore">10000</profile>
+ </pool>
+
+</config>
More information about the Swift-commit
mailing list