[Swift-commit] r6982 - in SwiftTutorials/raven: part04 part05 part06

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Fri Aug 23 13:19:50 CDT 2013


Author: davidk
Date: 2013-08-23 13:19:50 -0500 (Fri, 23 Aug 2013)
New Revision: 6982

Removed:
   SwiftTutorials/raven/part04/app
   SwiftTutorials/raven/part05/app
   SwiftTutorials/raven/part05/sitecount.sh
   SwiftTutorials/raven/part06/app
Modified:
   SwiftTutorials/raven/part04/apps
   SwiftTutorials/raven/part04/p4.swift
   SwiftTutorials/raven/part05/apps
   SwiftTutorials/raven/part05/p5.swift
   SwiftTutorials/raven/part06/apps
   SwiftTutorials/raven/part06/p6.swift
Log:
Call apps directly rather than staging them


Deleted: SwiftTutorials/raven/part04/app
===================================================================
--- SwiftTutorials/raven/part04/app	2013-08-23 18:15:39 UTC (rev 6981)
+++ SwiftTutorials/raven/part04/app	2013-08-23 18:19:50 UTC (rev 6982)
@@ -1 +0,0 @@
-link ../app
\ No newline at end of file

Modified: SwiftTutorials/raven/part04/apps
===================================================================
--- SwiftTutorials/raven/part04/apps	2013-08-23 18:15:39 UTC (rev 6981)
+++ SwiftTutorials/raven/part04/apps	2013-08-23 18:19:50 UTC (rev 6982)
@@ -1 +1 @@
-raven sh /bin/bash
+raven simulation /home/users/p01537/raven/app/simulate.sh

Modified: SwiftTutorials/raven/part04/p4.swift
===================================================================
--- SwiftTutorials/raven/part04/p4.swift	2013-08-23 18:15:39 UTC (rev 6981)
+++ SwiftTutorials/raven/part04/p4.swift	2013-08-23 18:19:50 UTC (rev 6982)
@@ -1,15 +1,11 @@
 
 type file;
 
-# Application program to be called by this script:
-
-file simulation_prog <"app/simulate.sh">;
-
 # "app" function for the simulation application:
 
-app (file out, file log) simulation (file prog, int timesteps, int sim_range)
+app (file out, file log) simulation (int timesteps, int sim_range)
 {
-  sh @prog "-t" timesteps "-r" sim_range stdout=@out stderr=@log;
+  simulation "-t" timesteps "-r" sim_range stdout=@out stderr=@log;
 }
 
 # Command line parameters to this script:
@@ -26,6 +22,6 @@
 foreach i in [0:nsim-1] {
   file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
   file simlog <single_file_mapper; file=@strcat("output/sim_",i,".log")>;
-  (simout,simlog) = simulation(simulation_prog, steps, range);
+  (simout,simlog) = simulation(steps, range);
 }
 

Deleted: SwiftTutorials/raven/part05/app
===================================================================
--- SwiftTutorials/raven/part05/app	2013-08-23 18:15:39 UTC (rev 6981)
+++ SwiftTutorials/raven/part05/app	2013-08-23 18:19:50 UTC (rev 6982)
@@ -1 +0,0 @@
-link ../app
\ No newline at end of file

Modified: SwiftTutorials/raven/part05/apps
===================================================================
--- SwiftTutorials/raven/part05/apps	2013-08-23 18:15:39 UTC (rev 6981)
+++ SwiftTutorials/raven/part05/apps	2013-08-23 18:19:50 UTC (rev 6982)
@@ -1 +1,2 @@
-raven sh /bin/bash
+raven simulation /home/users/p01537/raven/app/simulate.sh
+raven analyze /home/users/p01537/raven/app/stats.sh

Modified: SwiftTutorials/raven/part05/p5.swift
===================================================================
--- SwiftTutorials/raven/part05/p5.swift	2013-08-23 18:15:39 UTC (rev 6981)
+++ SwiftTutorials/raven/part05/p5.swift	2013-08-23 18:19:50 UTC (rev 6982)
@@ -1,18 +1,13 @@
 type file;
 
-# Define external application programs to be invoked
-
-file simulation_prog <"app/simulate.sh">;
-file analysis_prog   <"app/stats.sh">;
-
-app (file out, file log) simulation (file prog, int timesteps, int sim_range, file bias_file, int scale, int sim_count)
+app (file out, file log) simulation (int timesteps, int sim_range, file bias_file, int scale, int sim_count)
 {
-  sh @filename(prog) "-t" timesteps "-r" sim_range "-B" @bias_file "-x" scale "-n" sim_count stdout=@out stderr=@log;
+  simulation "-t" timesteps "-r" sim_range "-B" @bias_file "-x" scale "-n" sim_count stdout=@out stderr=@log;
 }
 
-app (file out) analyze (file prog, file s[])
+app (file out) analyze (file s[])
 {
-  sh @filename(prog) @filenames(s) stdout=@filename(out);
+  analyze @filenames(s) stdout=@filename(out);
 }
 
 # Command line params to this script
@@ -32,11 +27,11 @@
 foreach i in [0:nsim-1] {
   file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
   file simlog <single_file_mapper; file=@strcat("output/sim_",i,".log")>;
-  (simout, simlog) = simulation(simulation_prog, steps, range, bias, 100000, count);
+  (simout, simlog) = simulation(steps, range, bias, 100000, count);
   sims[i] = simout;
 }
 
 # Generate "analysis" file containing average of all "simulations"
 
 file stats<"output/stats.out">;         
-stats = analyze(analysis_prog,sims);
+stats = analyze(sims);

Deleted: SwiftTutorials/raven/part05/sitecount.sh
===================================================================
--- SwiftTutorials/raven/part05/sitecount.sh	2013-08-23 18:15:39 UTC (rev 6981)
+++ SwiftTutorials/raven/part05/sitecount.sh	2013-08-23 18:19:50 UTC (rev 6982)
@@ -1,3 +0,0 @@
-# condor_q -l $USER | grep MATCH_EXP_JOBGLIDEIN_ResourceName | cut -d '=' -f 2 | sort | uniq -c
-
-condor_q -l $USER | grep LastRemoteHost | cut -d '=' -f 2 | sort | uniq -c

Deleted: SwiftTutorials/raven/part06/app
===================================================================
--- SwiftTutorials/raven/part06/app	2013-08-23 18:15:39 UTC (rev 6981)
+++ SwiftTutorials/raven/part06/app	2013-08-23 18:19:50 UTC (rev 6982)
@@ -1 +0,0 @@
-link ../app
\ No newline at end of file

Modified: SwiftTutorials/raven/part06/apps
===================================================================
--- SwiftTutorials/raven/part06/apps	2013-08-23 18:15:39 UTC (rev 6981)
+++ SwiftTutorials/raven/part06/apps	2013-08-23 18:19:50 UTC (rev 6982)
@@ -1 +1,4 @@
-raven sh /bin/bash
+raven simulation /home/users/p01537/raven/app/simulate.sh
+raven analyze /home/users/p01537/raven/app/stats.sh
+raven genseed /home/users/p01537/raven/app/simulate.sh
+raven genbias /home/users/p01537/raven/app/simulate.sh

Modified: SwiftTutorials/raven/part06/p6.swift
===================================================================
--- SwiftTutorials/raven/part06/p6.swift	2013-08-23 18:15:39 UTC (rev 6981)
+++ SwiftTutorials/raven/part06/p6.swift	2013-08-23 18:19:50 UTC (rev 6982)
@@ -1,34 +1,27 @@
 type file;
 
-# Define external application programs to be invoked
-
-file simulation_prog <"app/simulate.sh">;
-file analysis_prog   <"app/stats.sh">;
-file genbias_prog = simulation_prog;
-file genseed_prog = simulation_prog;
-
 # app() functions for application programs to be called:
 
-app (file out) genseed (file prog, int nseeds)
+app (file out) genseed (int nseeds)
 {
-  sh @prog "-r" 2000000 "-n" nseeds stdout=@out;
+  genseed "-r" 2000000 "-n" nseeds stdout=@out;
 }
 
-app (file out) genbias (file prog, int bias_range, int nvalues)
+app (file out) genbias (int bias_range, int nvalues)
 {
-  sh @prog "-r" bias_range "-n" nvalues stdout=@out;
+  genbias "-r" bias_range "-n" nvalues stdout=@out;
 }
 
-app (file out, file log) simulation (file prog, int timesteps, int sim_range,
+app (file out, file log) simulation (int timesteps, int sim_range,
                                      file bias_file, int scale, int sim_count)
 {
-  sh @prog "-t" timesteps "-r" sim_range "-B" @bias_file "-x" scale
+  simulation "-t" timesteps "-r" sim_range "-B" @bias_file "-x" scale
            "-n" sim_count stdout=@out stderr=@log;
 }
 
-app (file out) analyze (file prog, file s[])
+app (file out) analyze (file s[])
 {
-  sh @prog @filenames(s) stdout=@out;
+  analyze @filenames(s) stdout=@out;
 }
 
 # Command line arguments
@@ -43,7 +36,7 @@
 tracef("\n*** Script parameters: nsim=%i range=%i count=%i\n\n", nsim, range, count);
 
 file seedfile<"output/seed.dat">;        # Dynamically generated bias for simulation ensemble
-seedfile = genseed(genseed_prog, 1);
+seedfile = genseed(1);
 
 int seedval = readData(seedfile);
 tracef("Generated seed=%i\n", seedval);
@@ -54,10 +47,10 @@
   file biasfile <single_file_mapper; file=@strcat("output/bias_",i,".dat")>;
   file simout   <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
   file simlog   <single_file_mapper; file=@strcat("output/sim_",i,".log")>;
-  biasfile = genbias(genbias_prog, 1000, 20);
-  (simout,simlog) = simulation(simulation_prog, steps, range, biasfile, 100000, count);
+  biasfile = genbias(1000, 20);
+  (simout,simlog) = simulation(steps, range, biasfile, 100000, count);
   sims[i] = simout;
 }
 
 file stats<"output/stats.out">;            # Final output file: average of all "simulations"
-stats = analyze(analysis_prog,sims);
+stats = analyze(sims);




More information about the Swift-commit mailing list