[Swift-commit] r7912 - in SwiftApps/swift-galaxy/swift: . powergrid
ketan at ci.uchicago.edu
ketan at ci.uchicago.edu
Thu Jun 12 12:23:21 CDT 2014
Author: ketan
Date: 2014-06-12 12:23:20 -0500 (Thu, 12 Jun 2014)
New Revision: 7912
Added:
SwiftApps/swift-galaxy/swift/powergrid/
SwiftApps/swift-galaxy/swift/powergrid/ampl.xml
SwiftApps/swift-galaxy/swift/powergrid/characterization.png
SwiftApps/swift-galaxy/swift/powergrid/gensample.xml
SwiftApps/swift-galaxy/swift/powergrid/lower.xml
SwiftApps/swift-galaxy/swift/powergrid/powergrid.xml
SwiftApps/swift-galaxy/swift/powergrid/runmatlab.xml
SwiftApps/swift-galaxy/swift/powergrid/swift-inference.xml
SwiftApps/swift-galaxy/swift/powergrid/swift-lmps
SwiftApps/swift-galaxy/swift/powergrid/swift-lmps.xml
SwiftApps/swift-galaxy/swift/powergrid/swift-powergrid
SwiftApps/swift-galaxy/swift/powergrid/upper.xml
Log:
powergrid galaxy tools
Added: SwiftApps/swift-galaxy/swift/powergrid/ampl.xml
===================================================================
--- SwiftApps/swift-galaxy/swift/powergrid/ampl.xml (rev 0)
+++ SwiftApps/swift-galaxy/swift/powergrid/ampl.xml 2014-06-12 17:23:20 UTC (rev 7912)
@@ -0,0 +1,13 @@
+<tool id="ampl" name="ampl">
+ <description>Run the inference model to calculate bounds</description>
+ <command interpreter="python">
+ <!-- runampl _s _fix_x @_what @_stoch_model @_xhat_out @_obj_out @_illinois @_edrevised_model @_ascii_data @_print_results @_ampl_res -->
+ run_ampl.py "${sample}" "${fix_x}" "${what}" "${stoch_model}" "${xhat_out}" "${obj_out}" "${illinois}" "${edrevised_model}" "${ascii_data}" "${print_results}" "{ampl_res}"
+ </command>
+ <inputs>
+ <param name="sample" size="2" type="text" label="sample size" help="Sample size" />
+ </inputs>
+ <outputs>
+ <data format="txt" name="outfile" type="data" label="output" />
+ </outputs>
+</tool>
Added: SwiftApps/swift-galaxy/swift/powergrid/characterization.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/swift-galaxy/swift/powergrid/characterization.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/swift-galaxy/swift/powergrid/gensample.xml
===================================================================
--- SwiftApps/swift-galaxy/swift/powergrid/gensample.xml (rev 0)
+++ SwiftApps/swift-galaxy/swift/powergrid/gensample.xml 2014-06-12 17:23:20 UTC (rev 7912)
@@ -0,0 +1,12 @@
+<tool id="gensample" name="gensample">
+ <description>Generate a random sample</description>
+ <command interpreter="python">
+ /home/ubuntu/powergridapps/bin/gensample.py "${sample}" "${outfile}"
+ </command>
+ <inputs>
+ <param name="sample" size="2" type="text" label="sample size" help="Sample size" />
+ </inputs>
+ <outputs>
+ <data format="txt" name="outfile" type="data" label="output" />
+ </outputs>
+</tool>
Added: SwiftApps/swift-galaxy/swift/powergrid/lower.xml
===================================================================
--- SwiftApps/swift-galaxy/swift/powergrid/lower.xml (rev 0)
+++ SwiftApps/swift-galaxy/swift/powergrid/lower.xml 2014-06-12 17:23:20 UTC (rev 7912)
@@ -0,0 +1,3 @@
+<tool id="lbound" name="lower">
+ <description>Run the inference model to calculate lower bound</description>
+</tool>
Added: SwiftApps/swift-galaxy/swift/powergrid/powergrid.xml
===================================================================
--- SwiftApps/swift-galaxy/swift/powergrid/powergrid.xml (rev 0)
+++ SwiftApps/swift-galaxy/swift/powergrid/powergrid.xml 2014-06-12 17:23:20 UTC (rev 7912)
@@ -0,0 +1,32 @@
+<tool id="powergrid" name="Swift - Power Grid Inference for Stochastic Optimization">
+ <description>Swift - Power Grid Inference for Stochastic Optimization </description>
+
+ <command interpreter="bash">
+ swift-powergrid $site $batch $log_file
+ </command>
+
+ <inputs>
+ <param name="site" type="select" label="Execution Location">
+ <option value="midway">Midway</option>
+ <option value="uc3">UC3</option>
+ <option value="localhost">Localhost</option>
+ <option value="stampede">Stampede</option>
+ </param>
+ <param name="batch" type="text" value="20" label="value for batch size"/>
+
+<!--
+ <param name="stochmodel" type="data" label="stochmodel"/>
+ <param name="edrevised" type="data" label="edrevised"/>
+ <param name="asciidata" type="data" label="ascii data "/>
+ <param name="printres" type="data" label="print res inc file"/>
+ <param name="illinois" type="data" label="Illinois data file"/>
+ <param name="wind_data" type="data" label="wind data file"/>
+ -->
+ </inputs>
+
+ <outputs>
+ <data format="txt" type="data" name="log_file"/>
+ </outputs>
+
+</tool>
+
Added: SwiftApps/swift-galaxy/swift/powergrid/runmatlab.xml
===================================================================
--- SwiftApps/swift-galaxy/swift/powergrid/runmatlab.xml (rev 0)
+++ SwiftApps/swift-galaxy/swift/powergrid/runmatlab.xml 2014-06-12 17:23:20 UTC (rev 7912)
@@ -0,0 +1,12 @@
+<tool id="gensample" name="gensample">
+ <description>Generate a random sample</description>
+ <command interpreter="python">
+ gensample.py "${sample}" "${outfile}"
+ </command>
+ <inputs>
+ <param name="sample" size="2" type="text" label="sample size" help="Sample size" />
+ </inputs>
+ <outputs>
+ <data format="txt" name="outfile" type="data" label="output" />
+ </outputs>
+</tool>
Added: SwiftApps/swift-galaxy/swift/powergrid/swift-inference.xml
===================================================================
--- SwiftApps/swift-galaxy/swift/powergrid/swift-inference.xml (rev 0)
+++ SwiftApps/swift-galaxy/swift/powergrid/swift-inference.xml 2014-06-12 17:23:20 UTC (rev 7912)
@@ -0,0 +1,55 @@
+<tool id="swift-inference" name="Swift - Power Grid Inference for Stochastic Optimization">
+ <description>Swift - Power Grid Inference for Stochastic Optimization </description>
+
+ <command interpreter="bash">
+ swift-powergrid $site $batch $sample $log_file
+ </command>
+
+ <inputs>
+ <param name="site" type="select" label="Execution Location">
+ <option value="localhost">Localhost</option>
+ <option value="midway">Midway</option>
+ <option value="uc3">UC3</option>
+ <option value="stampede">Stampede</option>
+ </param>
+ <param name="batch" type="text" value="20" label="value for batch size"/>
+ <param name="sample" type="text" value="10,100" label="comma-seperated list of samples"/>
+<!--
+ <param name="stochmodel" type="data" label="stochmodel"/>
+ <param name="edrevised" type="data" label="edrevised"/>
+ <param name="asciidata" type="data" label="ascii data "/>
+ <param name="printres" type="data" label="print res inc file"/>
+ <param name="illinois" type="data" label="Illinois data file"/>
+ <param name="wind_data" type="data" label="wind data file"/>
+ -->
+ </inputs>
+
+ <outputs>
+ <data format="txt" type="data" name="log_file"/>
+ </outputs>
+ <help>
+**The Swift power grid inference analysis tool. This tool runs an inference model written in AMPL using the Coin IPOPT solver.**
+
+-----
+
+The electrical power prices in a region are a result of
+combination of many stochastic and temporal factors, including variation in
+supply and demand due to market, social, and environmental factors. Evaluating
+the feasibility of future generation power grid networks and renewable energy
+sources requires modeling and simulation of this complex system. In particular,
+the power grid application described here is used to statistically infer the
+changes in the unit commitment prices with respect to small variations in
+random factors.
+
+-----
+
+The application involves running a stochastic model for a
+large number of elements generated via a three-level nested *foreach*
+loop. A numerical algorithm is run to compute lower and upper bounds, which
+converge for large enough samples. A moderate sample size of five samples can
+generate hundreds of thousands of tasks. Each task makes call to the
+Python-implemented sample generation and AMPL models.
+
+ </help>
+</tool>
+
Added: SwiftApps/swift-galaxy/swift/powergrid/swift-lmps
===================================================================
--- SwiftApps/swift-galaxy/swift/powergrid/swift-lmps (rev 0)
+++ SwiftApps/swift-galaxy/swift/powergrid/swift-lmps 2014-06-12 17:23:20 UTC (rev 7912)
@@ -0,0 +1,276 @@
+#!/bin/bash
+
+site=$1
+numhrs=$2
+state=$3
+#edrevised=$4
+#asciidata=$5
+#printres=$6
+#illinois=$7
+#wind_data=$8
+#sample=$3
+logfile=$4
+
+#cp $stochmodel stochmodel.run
+#cp $edrevised edrevised.mod
+#cp $asciidata set_data_ascii.inc
+#cp $printres print_results_revised.inc
+#cp $illinois Illinois.tgz
+#cp $wind_data wind_data.dat
+echo $@>/tmp/tmp.txt
+#swift=/home/maheshwari/swift-0.94/cog/modules/swift/dist/swift-svn/bin/swift
+swift=$(\which swift)
+# use "here" document for configs
+
+wdir=$(mktemp -d /tmp/swift-gal.XXXX)
+
+cat << EOF > $wdir/lmps4galaxy.swift
+type file;
+
+app (file _amplout, file _stdout, file _stderr) runampl (file _model, file _bundle, int _idx){
+ amplrun @_model @_bundle _idx @_amplout stdout=@_stdout stderr=@_stderr;
+}
+
+app (file _plot, file _stdout, file _stderr) runmatlab (file _data, file _bundle){
+ matlabrun @_data @_bundle @_plot stdout=@_stdout stderr=@_stderr;
+}
+
+/*
+for i in `seq 1 8760`; do echo $i>idx_data.dat; ampl edrevised.run > /sandbox/ketan/std.out.$i; mv Results/lmp_results.dat /sandbox/ketan/lmp_results.$i.dat; done
+*/
+
+file model<"/home/ubuntu/powergridapps/KETAN_VERSION/MODEL_LMP/edrevised.run">;
+file bundle<"/home/ubuntu/powergridapps/KETAN_VERSION/MODEL_LMP/bundle.tgz">;
+
+file amplout[] <simple_mapper; location="outdir", prefix="amplout", suffix=".tgz">;
+file out[] <simple_mapper; location="outdir", prefix="stdout", suffix=".txt">;
+file err[] <simple_mapper; location="outdir", prefix="stderr", suffix=".txt">;
+
+/*
+file plotres[] <simple_mapper; location="outdir", prefix="plot", suffix=".eps">;
+file plotout[] <simple_mapper; location="outdir", prefix="plotout", suffix=".txt">;
+file ploterr[] <simple_mapper; location="outdir", prefix="ploterr", suffix=".txt">;
+*/
+
+foreach i in [1:${numhrs}]{
+ (amplout[i], out[i], err[i]) = runampl (model, bundle, i);
+ //(plotres[i], plotout[i], ploterr[i]) = runmatlab (amplout[i]);
+}
+EOF
+
+case "$site" in
+midway )
+cat << EOF > $wdir/sites.xml
+<config>
+ <pool handle="midway">
+ <execution provider="coaster" jobmanager="local:slurm"/>
+ <filesystem provider="local" />
+ <profile namespace="globus" key="queue">sandyb</profile>
+ <profile namespace="globus" key="jobsPerNode">16</profile>
+ <profile namespace="globus" key="maxWalltime">02:00:00</profile>
+ <profile namespace="globus" key="maxTime">7500</profile>
+ <profile namespace="globus" key="highOverAllocation">100</profile>
+ <profile namespace="globus" key="lowOverAllocation">100</profile>
+ <profile namespace="globus" key="slots">2</profile>
+ <profile namespace="globus" key="maxNodes">1</profile>
+ <profile namespace="globus" key="nodeGranularity">1</profile>
+ <profile namespace="karajan" key="jobThrottle">.31</profile>
+ <profile namespace="karajan" key="initialScore">10000</profile>
+ <workdirectory>/tmp/swift.work</workdirectory>
+ </pool>
+</config>
+EOF
+
+cat << EOF > $wdir/tc
+midway echo echo
+midway cat cat
+midway gensample /home/maheshwari/powergridapps/bin/gensample.py
+midway runampl /home/maheshwari/powergridapps/bin/run_ampl.py
+midway runampl_l /home/maheshwari/powergridapps/bin/run_ampl_l.py
+midway runampl_u /home/maheshwari/powergridapps/bin/run_ampl_u.py
+EOF
+
+cat << EOF > $wdir/cf
+use.provider.staging=true
+wrapperlog.always.transfer=true
+execution.retries=0
+provider.staging.pin.swiftfiles=false
+sitedir.keep=true
+lazy.errors=false
+use.wrapper.staging=false
+EOF
+;;
+
+uc3 )
+cat << EOF > $wdir/sites.xml
+<config>
+ <pool handle="uc3">
+ <execution provider="coaster" url="uc3-sub.uchicago.edu" jobmanager="ssh-cl:condor"/>
+ <!--<execution provider="coaster" jobmanager="local:condor"/>-->
+ <profile namespace="karajan" key="jobThrottle">.09</profile>
+ <profile namespace="karajan" key="initialScore">1000</profile>
+ <profile namespace="globus" key="jobsPerNode">1</profile>
+ <profile namespace="globus" key="maxWalltime">3600</profile>
+ <profile namespace="globus" key="nodeGranularity">1</profile>
+ <profile namespace="globus" key="highOverAllocation">100</profile>
+ <profile namespace="globus" key="lowOverAllocation">100</profile>
+ <profile namespace="globus" key="slots">1</profile>
+ <profile namespace="globus" key="condor.Requirements">UidDomain == "osg-gk.mwt2.org"</profile>
+ <profile namespace="globus" key="maxNodes">1</profile>
+ <profile namespace="globus" key="condor.+AccountingGroup">"group_friends.{env.USER}"</profile>
+ <profile namespace="globus" key="jobType">nonshared</profile>
+ <filesystem provider="local" url="none" />
+ <!--<workdirectory>/home/maheshwari/test/catsn/swift.work</workdirectory>-->
+ <workdirectory>/tmp/swift.work</workdirectory>
+ </pool>
+</config>
+EOF
+
+cat << EOF > $wdir/tc
+uc3 echo /bin/echo
+uc3 cat /bin/cat
+uc3 runampl run_ampl.py
+uc3 runampl_l run_ampl_l.py
+uc3 runampl_u run_ampl_u.py
+EOF
+
+cat << EOF > $wdir/cf
+use.provider.staging=true
+wrapperlog.always.transfer=true
+execution.retries=1
+provider.staging.pin.swiftfiles=false
+sitedir.keep=true
+lazy.errors=false
+EOF
+;;
+
+stampede )
+cat << EOF > $wdir/sites.xml
+<?xml version="1.0" encoding="UTF-8"?>
+<config xmlns="http://www.ci.uchicago.edu/swift/SwiftSites">
+<pool handle="stampede">
+ <execution provider="coaster" jobmanager="ssh-cl:slurm" url="stampede.tacc.utexas.edu"/>
+ <filesystem provider="local"/>
+ <profile namespace="globus" key="jobsPerNode">16</profile>
+ <profile namespace="globus" key="ppn">16</profile>
+ <profile namespace="globus" key="project">TG-EAR130015</profile>
+ <profile namespace="globus" key="queue">normal</profile>
+ <profile namespace="globus" key="slurm.mail-user">ketancmaheshwari at gmail.com</profile>
+ <profile namespace="globus" key="slurm.mail-type">ALL</profile>
+ <profile namespace="globus" key="maxWalltime">02:00:00</profile>
+ <profile namespace="globus" key="maxTime">8000</profile>
+ <profile namespace="globus" key="highOverAllocation">100</profile>
+ <profile namespace="globus" key="lowOverAllocation">100</profile>
+ <profile namespace="globus" key="slots">1</profile>
+ <profile namespace="globus" key="maxNodes">1</profile>
+ <profile namespace="globus" key="nodeGranularity">1</profile>
+ <profile namespace="karajan" key="jobThrottle">.15</profile>
+ <profile namespace="karajan" key="initialScore">10000</profile>
+ <workdirectory>/tmp/swift.work</workdirectory>
+</pool>
+</config>
+EOF
+
+cat << EOF > $wdir/tc
+stampede echo echo
+stampede cat cat
+stampede gensample gensample.py
+stampede runampl run_ampl.py
+stampede runampl_l run_ampl_l.py
+stampede runampl_u run_ampl_u.py
+EOF
+
+cat << EOF > $wdir/cf
+use.provider.staging=true
+wrapperlog.always.transfer=true
+execution.retries=0
+provider.staging.pin.swiftfiles=false
+sitedir.keep=true
+lazy.errors=false
+use.wrapper.staging=false
+EOF
+;;
+
+localhost )
+cat << EOF > $wdir/sites.xml
+<config xmlns="http://www.ci.uchicago.edu/swift/SwiftSites" >
+ <pool handle="localhost">
+ <filesystem provider="local" />
+ <execution provider="local" />
+ <workdirectory>/tmp/swift.workdir</workdirectory>
+ <profile namespace="karajan" key="jobThrottle">0.1</profile>
+ </pool>
+</config>
+EOF
+
+cat << EOF > $wdir/tc
+localhost echo echo
+localhost cat cat
+localhost amplrun runampl.sh
+localhost gensample gensample.py
+localhost runampl run_ampl.py
+localhost runampl_l run_ampl_l.py
+localhost runampl_u run_ampl_u.py
+EOF
+
+cat << EOF > $wdir/cf
+use.provider.staging=false
+wrapperlog.always.transfer=true
+execution.retries=0
+provider.staging.pin.swiftfiles=false
+sitedir.keep=false
+lazy.errors=false
+foreach.max.threads=32
+EOF
+;;
+
+* )
+echo "defaulting to localhost"
+cat << EOF > $wdir/sites.xml
+<config xmlns="http://www.ci.uchicago.edu/swift/SwiftSites" >
+ <pool handle="localhost">
+ <filesystem provider="local" />
+ <execution provider="local" />
+ <workdirectory>/tmp/swift.workdir</workdirectory>
+ <profile namespace="karajan" key="jobThrottle">0.1</profile>
+ </pool>
+</config>
+EOF
+
+cat << EOF > $wdir/tc
+localhost echo echo
+localhost cat cat
+localhost gensample gensample.py
+localhost runampl run_ampl.py
+localhost runampl_l run_ampl_l.py
+localhost runampl_u run_ampl_u.py
+EOF
+
+cat << EOF > $wdir/cf
+use.provider.staging=false
+wrapperlog.always.transfer=true
+execution.retries=0
+provider.staging.pin.swiftfiles=false
+sitedir.keep=false
+lazy.errors=false
+foreach.max.threads=32
+EOF
+;;
+esac
+
+cd $wdir
+
+$swift -ui http:9090 -sites.file sites.xml -tc.file tc -config cf lmps4galaxy.swift 2> std.err
+#$swift -sites.file /tmp/sites.xml -tc.file /tmp/tc -config /tmp/cf /tmp/inference4galaxy.swift -batch=$batch -stochmodel=stochmodel.run -edrevised=edrevised.mod -asciidata=set_data_ascii.inc -printres=print_results_revised.inc -illinois=Illinois.tgz -wind_data=wind_data.dat 2> std.err
+
+EXITCODE=$?
+
+if [ "$EXITCODE" -ne "0" ]; then
+ cat std.err >&2
+fi
+cp std.err $logfile
+rm std.err
+exit $EXITCODE
+
+cd ..
+
Property changes on: SwiftApps/swift-galaxy/swift/powergrid/swift-lmps
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftApps/swift-galaxy/swift/powergrid/swift-lmps.xml
===================================================================
--- SwiftApps/swift-galaxy/swift/powergrid/swift-lmps.xml (rev 0)
+++ SwiftApps/swift-galaxy/swift/powergrid/swift-lmps.xml 2014-06-12 17:23:20 UTC (rev 7912)
@@ -0,0 +1,57 @@
+<tool id="swift-lmps" name="Swift - Power Grid LMP Computation">
+ <description>Swift - Power Grid LMP Computation</description>
+
+ <command interpreter="bash">
+ swift-lmps $site $numhrs $state $log_file
+ </command>
+
+ <inputs>
+ <param name="site" type="select" label="Execution Location">
+ <option value="localhost">Localhost</option>
+ <option value="midway">Midway</option>
+ <option value="uc3">UC3</option>
+ <option value="stampede">Stampede</option>
+ </param>
+
+ <param name="numhrs" type="text" value="150" label="compute lmp for these many hours"/>
+ <param name="state" type="select" label="Select State (Illinois supported currently)">
+ <option value="localhost">Illinois</option>
+ <option value="midway">Indianapolis</option>
+ <option value="uc3">Iowa</option>
+ <option value="stampede">Wisconsin</option>
+ </param>
+<!--
+ <param name="sample" type="text" value="10,100" label="comma-seperated list of samples"/>
+ <param name="stochmodel" type="data" label="stochmodel"/>
+ <param name="edrevised" type="data" label="edrevised"/>
+ <param name="asciidata" type="data" label="ascii data "/>
+ <param name="printres" type="data" label="print res inc file"/>
+ <param name="illinois" type="data" label="Illinois data file"/>
+ <param name="wind_data" type="data" label="wind data file"/>
+-->
+ </inputs>
+
+ <outputs>
+ <data format="txt" type="data" name="log_file"/>
+ </outputs>
+ <help>
+**The Swift power grid locational marginal price computation tool. This tool runs an inference model written in AMPL using the Coin IPOPT solver.**
+-----
+Optimal power flow studies are crucial in understanding the flow and price
+patterns in electricity under different demand and network conditions. A big
+computational challenge arising in power grid analysis is that simulations need
+to be run at high time resolutions in order to capture effects occurring at
+multiple time scales. The power flow simulation application analyzes historical
+conditions in the Illinois grid to simulate instant power prices on an hourly
+basis.
+
+-----
+The application runs linear programming solvers invoked via an AMPL (A
+Mathematical Programming Language) model representation and collects flow,
+generation, and price data with attached geographical coordinates. A typical
+application consists of running the model in 8,760 independent executions
+corresponding to each hour of the year.
+
+ </help>
+</tool>
+
Added: SwiftApps/swift-galaxy/swift/powergrid/swift-powergrid
===================================================================
--- SwiftApps/swift-galaxy/swift/powergrid/swift-powergrid (rev 0)
+++ SwiftApps/swift-galaxy/swift/powergrid/swift-powergrid 2014-06-12 17:23:20 UTC (rev 7912)
@@ -0,0 +1,311 @@
+#!/bin/bash
+
+site=$1
+batch=$2
+#stochmodel=$3
+#edrevised=$4
+#asciidata=$5
+#printres=$6
+#illinois=$7
+#wind_data=$8
+sample=$3
+logfile=$4
+
+#cp $stochmodel stochmodel.run
+#cp $edrevised edrevised.mod
+#cp $asciidata set_data_ascii.inc
+#cp $printres print_results_revised.inc
+#cp $illinois Illinois.tgz
+#cp $wind_data wind_data.dat
+echo $@>>/tmp/tmp.txt
+#swift=/home/maheshwari/swift-0.94/cog/modules/swift/dist/swift-svn/bin/swift
+swift=$(\which swift)
+# use "here" document for configs
+
+wdir=$(mktemp -d /tmp/swift-gal.XXXX)
+
+cat << EOF > $wdir/inference4galaxy.swift
+type file;
+
+#string basepath="/home/ubuntu/powergridapps/swiftscripts";
+
+file stoch_model<"/home/ubuntu/powergridapps/swiftscripts/stochmodel.mod">;
+file edrevised_model<"/home/ubuntu/powergridapps/swiftscripts/edrevised.mod">;
+file ascii_data<"/home/ubuntu/powergridapps/swiftscripts/set_data_ascii.inc">;
+file print_results<"/home/ubuntu/powergridapps/swiftscripts/print_results_revised.inc">;
+file illinois<"/home/ubuntu/powergridapps/swiftscripts/Illinois.tgz">;
+file wind_data<"/home/ubuntu/powergridapps/swiftscripts/wind_data.dat">;
+
+file norm_out[] <simple_mapper; location="outdir", prefix="norm", suffix=".out">;
+
+file out[] <simple_mapper; location="outdir", prefix="ampl", suffix=".out">;
+file obj_out[] <simple_mapper; location="obj_outdir", prefix="obj_ampl", suffix=".out">;
+file ampl_res[] <simple_mapper; location="Results", prefix="ampl_res", suffix=".out">;
+
+file xhat_out[] <simple_mapper; location="outdir", prefix="xhat", suffix=".out">;
+
+file out_l[][][] <simple_mapper; location="outdir", prefix="out_l", suffix=".out">;
+file obj_out_l[][][] <simple_mapper; location="obj_outdir", prefix="obj_out_l", suffix=".out">;
+file ampl_l_res[][][] <simple_mapper; location="Results", prefix="ampl_res_l", suffix=".out">;
+
+file out_u[][][] <simple_mapper; location="outdir", prefix="out_u", suffix=".out">;
+file obj_out_u[][][] <simple_mapper; location="obj_outdir", prefix="obj_out_u", suffix=".out">;
+file ampl_u_res[][][] <simple_mapper; location="Results", prefix="ampl_res_u", suffix=".out">;
+
+app ( file _norm_out ) gensample (int _s, file _wind_data){
+
+ gensample _s @_norm_out @_wind_data;
+}
+
+app ( file _obj_out, file _xhat_out, file _ampl_res, file _out)
+ ampl_app ( int _s, int _fix_x, file _what, file _stoch_model, file _illinois, file _edrevised_model, file _ascii_data, file _print_results) {
+
+ runampl _s _fix_x @_what @_stoch_model @_xhat_out @_obj_out @_illinois @_edrevised_model @_ascii_data @_print_results @_ampl_res stdout=@_out;
+}
+
+app (file _obj_out, file _ampl_l_res, file _out) ampl_app_L (
+ int _s, int _fix_x, file _what, file _stoch_model, file _illinois, file _edrevised_model, file _ascii_data, file _print_results) {
+
+ runampl_l _s _fix_x @_what @_stoch_model @_obj_out @_illinois @_edrevised_model @_ascii_data @_print_results @_ampl_l_res stdout=@_out;
+}
+
+app (file _obj_out, file _ampl_u_res, file _out) ampl_app_U (
+ int _s, int _fix_x, file _what, file _stoch_model, file _xhat, file _illinois, file _edrevised_model, file _ascii_data, file _print_results) {
+
+ runampl_u _s _fix_x @_what @_stoch_model @_xhat @_obj_out @_illinois @_edrevised_model @_ascii_data @_print_results @_ampl_u_res stdout=@_out;
+}
+
+//int nS[] = [10, 100]; //number of scenario sweeps
+int nS[] = [${sample}]; //number of scenario sweeps
+
+int Batch = @toInt(@arg("batch", "30"));
+
+foreach S, idxs in nS{
+ (norm_out[idxs]) = gensample (S, wind_data);
+ (obj_out[idxs], xhat_out[idxs], ampl_res[idxs], out[idxs]) = ampl_app (S, 0, norm_out[idxs], stoch_model, illinois, edrevised_model, ascii_data, print_results);
+
+ foreach B, idxb in [10:Batch:10]{
+ foreach k in [0:B]{
+ (obj_out_l[idxs][idxb][k], ampl_l_res[idxs][idxb][k], out_l[idxs][idxb][k]) = ampl_app_L(S, 0, norm_out[idxs], stoch_model, illinois, edrevised_model, ascii_data, print_results);
+ (obj_out_u[idxs][idxb][k], ampl_u_res[idxs][idxb][k], out_u[idxs][idxb][k]) = ampl_app_U(S, 1, norm_out[idxs], stoch_model, xhat_out[idxs], illinois, edrevised_model, ascii_data, print_results);
+ }
+ }
+}
+
+EOF
+
+case "$site" in
+midway )
+cat << EOF > $wdir/sites.xml
+<config>
+ <pool handle="midway">
+ <execution provider="coaster" jobmanager="local:slurm"/>
+ <filesystem provider="local" />
+ <profile namespace="globus" key="queue">sandyb</profile>
+ <profile namespace="globus" key="jobsPerNode">16</profile>
+ <profile namespace="globus" key="maxWalltime">02:00:00</profile>
+ <profile namespace="globus" key="maxTime">7500</profile>
+ <profile namespace="globus" key="highOverAllocation">100</profile>
+ <profile namespace="globus" key="lowOverAllocation">100</profile>
+ <profile namespace="globus" key="slots">2</profile>
+ <profile namespace="globus" key="maxNodes">1</profile>
+ <profile namespace="globus" key="nodeGranularity">1</profile>
+ <profile namespace="karajan" key="jobThrottle">.31</profile>
+ <profile namespace="karajan" key="initialScore">10000</profile>
+ <workdirectory>/tmp/swift.work</workdirectory>
+ </pool>
+</config>
+EOF
+
+cat << EOF > $wdir/tc
+midway echo echo
+midway cat cat
+midway gensample /home/maheshwari/powergridapps/bin/gensample.py
+midway runampl /home/maheshwari/powergridapps/bin/run_ampl.py
+midway runampl_l /home/maheshwari/powergridapps/bin/run_ampl_l.py
+midway runampl_u /home/maheshwari/powergridapps/bin/run_ampl_u.py
+EOF
+
+cat << EOF > $wdir/cf
+use.provider.staging=true
+wrapperlog.always.transfer=true
+execution.retries=0
+provider.staging.pin.swiftfiles=false
+sitedir.keep=true
+lazy.errors=false
+use.wrapper.staging=false
+EOF
+;;
+
+uc3 )
+cat << EOF > $wdir/sites.xml
+<config>
+ <pool handle="uc3">
+ <execution provider="coaster" url="uc3-sub.uchicago.edu" jobmanager="ssh-cl:condor"/>
+ <!--<execution provider="coaster" jobmanager="local:condor"/>-->
+ <profile namespace="karajan" key="jobThrottle">.09</profile>
+ <profile namespace="karajan" key="initialScore">1000</profile>
+ <profile namespace="globus" key="jobsPerNode">1</profile>
+ <profile namespace="globus" key="maxWalltime">3600</profile>
+ <profile namespace="globus" key="nodeGranularity">1</profile>
+ <profile namespace="globus" key="highOverAllocation">100</profile>
+ <profile namespace="globus" key="lowOverAllocation">100</profile>
+ <profile namespace="globus" key="slots">1</profile>
+ <profile namespace="globus" key="condor.Requirements">UidDomain == "osg-gk.mwt2.org"</profile>
+ <profile namespace="globus" key="maxNodes">1</profile>
+ <profile namespace="globus" key="condor.+AccountingGroup">"group_friends.{env.USER}"</profile>
+ <profile namespace="globus" key="jobType">nonshared</profile>
+ <filesystem provider="local" url="none" />
+ <!--<workdirectory>/home/maheshwari/test/catsn/swift.work</workdirectory>-->
+ <workdirectory>/tmp/swift.work</workdirectory>
+ </pool>
+</config>
+EOF
+
+cat << EOF > $wdir/tc
+uc3 echo /bin/echo
+uc3 cat /bin/cat
+uc3 runampl run_ampl.py
+uc3 runampl_l run_ampl_l.py
+uc3 runampl_u run_ampl_u.py
+EOF
+
+cat << EOF > $wdir/cf
+use.provider.staging=true
+wrapperlog.always.transfer=true
+execution.retries=1
+provider.staging.pin.swiftfiles=false
+sitedir.keep=true
+lazy.errors=false
+EOF
+;;
+
+stampede )
+cat << EOF > $wdir/sites.xml
+<?xml version="1.0" encoding="UTF-8"?>
+<config xmlns="http://www.ci.uchicago.edu/swift/SwiftSites">
+<pool handle="stampede">
+ <execution provider="coaster" jobmanager="ssh-cl:slurm" url="stampede.tacc.utexas.edu"/>
+ <filesystem provider="local"/>
+ <profile namespace="globus" key="jobsPerNode">16</profile>
+ <profile namespace="globus" key="ppn">16</profile>
+ <profile namespace="globus" key="project">TG-EAR130015</profile>
+ <profile namespace="globus" key="queue">normal</profile>
+ <profile namespace="globus" key="slurm.mail-user">ketancmaheshwari at gmail.com</profile>
+ <profile namespace="globus" key="slurm.mail-type">ALL</profile>
+ <profile namespace="globus" key="maxWalltime">02:00:00</profile>
+ <profile namespace="globus" key="maxTime">8000</profile>
+ <profile namespace="globus" key="highOverAllocation">100</profile>
+ <profile namespace="globus" key="lowOverAllocation">100</profile>
+ <profile namespace="globus" key="slots">1</profile>
+ <profile namespace="globus" key="maxNodes">1</profile>
+ <profile namespace="globus" key="nodeGranularity">1</profile>
+ <profile namespace="karajan" key="jobThrottle">.15</profile>
+ <profile namespace="karajan" key="initialScore">10000</profile>
+ <workdirectory>/tmp/swift.work</workdirectory>
+</pool>
+</config>
+EOF
+
+cat << EOF > $wdir/tc
+stampede echo echo
+stampede cat cat
+stampede gensample gensample.py
+stampede runampl run_ampl.py
+stampede runampl_l run_ampl_l.py
+stampede runampl_u run_ampl_u.py
+EOF
+
+cat << EOF > $wdir/cf
+use.provider.staging=true
+wrapperlog.always.transfer=true
+execution.retries=0
+provider.staging.pin.swiftfiles=false
+sitedir.keep=true
+lazy.errors=false
+use.wrapper.staging=false
+EOF
+;;
+
+localhost )
+cat << EOF > $wdir/sites.xml
+<config xmlns="http://www.ci.uchicago.edu/swift/SwiftSites" >
+ <pool handle="localhost">
+ <filesystem provider="local" />
+ <execution provider="local" />
+ <workdirectory>/tmp/swift.workdir</workdirectory>
+ <profile namespace="karajan" key="jobThrottle">0.1</profile>
+ </pool>
+</config>
+EOF
+
+cat << EOF > $wdir/tc
+localhost echo echo
+localhost cat cat
+localhost gensample gensample.py
+localhost runampl run_ampl.py
+localhost runampl_l run_ampl_l.py
+localhost runampl_u run_ampl_u.py
+EOF
+
+cat << EOF > $wdir/cf
+use.provider.staging=false
+wrapperlog.always.transfer=true
+execution.retries=0
+provider.staging.pin.swiftfiles=false
+sitedir.keep=false
+lazy.errors=false
+foreach.max.threads=32
+EOF
+;;
+
+* )
+echo "defaulting to localhost"
+cat << EOF > $wdir/sites.xml
+<config xmlns="http://www.ci.uchicago.edu/swift/SwiftSites" >
+ <pool handle="localhost">
+ <filesystem provider="local" />
+ <execution provider="local" />
+ <workdirectory>/tmp/swift.workdir</workdirectory>
+ <profile namespace="karajan" key="jobThrottle">0.1</profile>
+ </pool>
+</config>
+EOF
+
+cat << EOF > $wdir/tc
+localhost echo echo
+localhost cat cat
+localhost gensample gensample.py
+localhost runampl run_ampl.py
+localhost runampl_l run_ampl_l.py
+localhost runampl_u run_ampl_u.py
+EOF
+
+cat << EOF > $wdir/cf
+use.provider.staging=false
+wrapperlog.always.transfer=true
+execution.retries=0
+provider.staging.pin.swiftfiles=false
+sitedir.keep=false
+lazy.errors=false
+foreach.max.threads=32
+EOF
+;;
+esac
+
+cd $wdir
+
+$swift -ui http:9090 -sites.file sites.xml -tc.file tc -config cf inference4galaxy.swift -batch=$batch 2> std.err
+#$swift -sites.file /tmp/sites.xml -tc.file /tmp/tc -config /tmp/cf /tmp/inference4galaxy.swift -batch=$batch -stochmodel=stochmodel.run -edrevised=edrevised.mod -asciidata=set_data_ascii.inc -printres=print_results_revised.inc -illinois=Illinois.tgz -wind_data=wind_data.dat 2> std.err
+
+EXITCODE=$?
+
+if [ "$EXITCODE" -ne "0" ]; then
+ cat std.err >&2
+fi
+cp std.err $logfile
+rm std.err
+exit $EXITCODE
+
+cd ..
+
Property changes on: SwiftApps/swift-galaxy/swift/powergrid/swift-powergrid
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftApps/swift-galaxy/swift/powergrid/upper.xml
===================================================================
--- SwiftApps/swift-galaxy/swift/powergrid/upper.xml (rev 0)
+++ SwiftApps/swift-galaxy/swift/powergrid/upper.xml 2014-06-12 17:23:20 UTC (rev 7912)
@@ -0,0 +1,3 @@
+<tool id="ubound" name="upper">
+ <description>Run the inference model to calculate upper bound</description>
+</tool>
More information about the Swift-commit
mailing list