[Swift-commit] r3007 - SwiftApps/SEE/trunk

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Jul 14 17:06:08 CDT 2009


Author: aespinosa
Date: 2009-07-14 17:06:08 -0500 (Tue, 14 Jul 2009)
New Revision: 3007

Added:
   SwiftApps/SEE/trunk/cmd_mapper.sh
   SwiftApps/SEE/trunk/instance_mapper.sh
Modified:
   SwiftApps/SEE/trunk/ampl.swift
   SwiftApps/SEE/trunk/run_ampl
   SwiftApps/SEE/trunk/runampl.sh
Log:
Struct-urized swift script.  Added required mappers for clean code

Modified: SwiftApps/SEE/trunk/ampl.swift
===================================================================
--- SwiftApps/SEE/trunk/ampl.swift	2009-07-14 07:59:07 UTC (rev 3006)
+++ SwiftApps/SEE/trunk/ampl.swift	2009-07-14 22:06:08 UTC (rev 3007)
@@ -1,29 +1,57 @@
-type Template {}
-type AMPLIn{}
-type AMPLOut {}
-type STDOut {}
+type Template;
+type AmplIn;
+type StdOut;
 
-app (AMPLOut expend, AMPLOut limits, AMPLOut price, AMPLOut ratio, AMPLOut solve, STDOut ofile) run_ampl (string instanceID, Template temp, AMPLIn mod, AMPLIn process, AMPLIn output, AMPLIn so, AMPLIn tree)
+type AmplCmd {
+  Template temp;
+  AmplIn mod;
+  AmplIn process;
+  AmplIn output;
+  AmplIn so;
+  AmplIn tree;
+}
+
+type ExpendDat;
+type LimitsDat;
+type PriceDat;
+type RatioDat;
+type SolveDat;
+
+type ExpendOut;
+type PriceOut;
+type RatioOut;
+
+type AmplFilter {
+  ExpendOut expend_out;
+  PriceOut price_out;
+  RatioOut ratio_out; 
+}
+
+type AmplResult {
+  ExpendDat expend;
+  LimitsDat limits;
+  PriceDat price;
+  RatioDat ratio;
+  SolveDat solve;
+  StdOut ofile;
+  AmplFilter out;
+}
+
+app (AmplResult result) run_ampl (string instanceID, AmplCmd cmd)
 {
-   run_ampl instanceID @filename(temp) @filename(mod) @filename(process) @filename(output) @filename(so) @filename(tree) stdout=@filename(ofile);
+  run_ampl instanceID @filename(cmd.temp) 
+      @filename(cmd.mod) @filename(cmd.process)
+      @filename(cmd.output) @filename(cmd.so) @filename(cmd.tree) 
+      stdout=@filename(result.ofile);
 }
 
-int runs[]=[5001:10000];
+AmplCmd const_cmd <ext;exec="./cmd_mapper.sh">;
+
+int runs[]=[2001:2002];
 foreach i in runs {
-  Template temp <"template">;
-  AMPLIn mod <"armington.mod">;
-  AMPLIn process <"armington_process.cmd">;
-  AMPLIn output <"armington_output.cmd">;
-  AMPLIn so <"ces.so">;
-  AMPLIn tree <"subproblems/producer_tree.mod">;
   
   string instanceID = @strcat("run", i);
 
-  AMPLOut expend  <single_file_mapper;file=@strcat("result/", instanceID, "/expend.dat")>;
-  AMPLOut limits  <single_file_mapper;file=@strcat("result/", instanceID, "/limits.dat")>;
-  AMPLOut price  <single_file_mapper;file=@strcat("result/", instanceID, "/price.dat")>;  
-  AMPLOut ratio  <single_file_mapper;file=@strcat("result/", instanceID, "/ratio.dat")>;
-  AMPLOut solve  <single_file_mapper;file=@strcat("result/", instanceID, "/solve.dat")>;
-  STDOut ofile <single_file_mapper;file=@strcat("result/", instanceID, "/stdout")>;
-  (expend, limits, price, ratio, solve, ofile)=run_ampl(instanceID, temp, mod, process, output, tree, so);
+  AmplResult res <ext;exec="./instance_mapper.sh", i=instanceID>;
+  res = run_ampl(instanceID, const_cmd);
 }

Added: SwiftApps/SEE/trunk/cmd_mapper.sh
===================================================================
--- SwiftApps/SEE/trunk/cmd_mapper.sh	                        (rev 0)
+++ SwiftApps/SEE/trunk/cmd_mapper.sh	2009-07-14 22:06:08 UTC (rev 3007)
@@ -0,0 +1,8 @@
+#!/bin/bash
+echo "temp template"
+echo "mod armington.mod"
+echo "process armington_process.cmd"
+echo "output armington_output.cmd"
+echo "so ces.so"
+echo "tree subproblems/producer_tree.mod"
+


Property changes on: SwiftApps/SEE/trunk/cmd_mapper.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: SwiftApps/SEE/trunk/instance_mapper.sh
===================================================================
--- SwiftApps/SEE/trunk/instance_mapper.sh	                        (rev 0)
+++ SwiftApps/SEE/trunk/instance_mapper.sh	2009-07-14 22:06:08 UTC (rev 3007)
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+while getopts ":i:" options; do
+  case $options in
+    i) export instance=$OPTARG ;;
+    *) exit 1;;
+  esac
+done
+
+echo "expend result/$instance/expend.dat";
+echo "limits result/$instance/limits.dat";
+echo "price result/$instance/price.dat";
+echo "ratio result/$instance/ratio.dat";
+echo "solve result/$instance/solve.dat";
+
+echo "ofile result/$instance/stdout";
+
+echo "out.expend_out result/$instance/expend.out";
+echo "out.price_out result/$instance/price.out";
+echo "out.ratio_out result/$instance/ratio.out";


Property changes on: SwiftApps/SEE/trunk/instance_mapper.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: SwiftApps/SEE/trunk/run_ampl
===================================================================
--- SwiftApps/SEE/trunk/run_ampl	2009-07-14 07:59:07 UTC (rev 3006)
+++ SwiftApps/SEE/trunk/run_ampl	2009-07-14 22:06:08 UTC (rev 3007)
@@ -1,5 +1,5 @@
 #!/bin/bash
-export PATH=$PATH:/home/zzhang/amplbin/
+export PATH=$PATH:/panfs/panasas/CMS/data/amplbin/
 export PATH_LICENSE_STRING="2640088036&Todd_Munson&Argonne_National_Laboratory&&USR&&14_12_2001&1000&COMP&GEN&0_0_0&0_0_0&0&0_0" 
 
 if [ $# -lt 1 ]; then

Modified: SwiftApps/SEE/trunk/runampl.sh
===================================================================
--- SwiftApps/SEE/trunk/runampl.sh	2009-07-14 07:59:07 UTC (rev 3006)
+++ SwiftApps/SEE/trunk/runampl.sh	2009-07-14 22:06:08 UTC (rev 3007)
@@ -8,5 +8,5 @@
    #-tc.file ./tc.data ampl.swift
 #swift -runid teraport -sites.file ./sites-teraport.xml \
    #-tc.file ./tc.data ampl.swift
-swift -runid run3k_firefly  -config swift.properties \
+swift -runid testing  -config swift.properties \
     -sites.file ./ff-grid.xml -tc.file ./tc.data ampl.swift




More information about the Swift-commit mailing list