aboutsummaryrefslogtreecommitdiff
path: root/steuermann/run_all.py
diff options
context:
space:
mode:
authorcslocum <cslocum@d34015c8-bcbb-4646-8ac8-8ba5febf221d>2012-11-07 10:55:30 -0500
committercslocum <cslocum@d34015c8-bcbb-4646-8ac8-8ba5febf221d>2012-11-07 10:55:30 -0500
commit0eccf18e674d623e28e9d61b1a73799316ed1083 (patch)
tree6a718b28c593ac8cce412783d0adb72954b4aa2e /steuermann/run_all.py
parentb63cde4fd3eb66ab9a707dcadfe964e135f1f594 (diff)
downloadsteuermann-0eccf18e674d623e28e9d61b1a73799316ed1083.tar.gz
added feature: can pass -h <hosts_ini_file> to smc to specify which .ini file to load hosts info from
git-svn-id: https://svn.stsci.edu/svn/ssb/etal/steuermann/trunk@833 d34015c8-bcbb-4646-8ac8-8ba5febf221d
Diffstat (limited to 'steuermann/run_all.py')
-rw-r--r--steuermann/run_all.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/steuermann/run_all.py b/steuermann/run_all.py
index d61f10d..28d6398 100644
--- a/steuermann/run_all.py
+++ b/steuermann/run_all.py
@@ -58,6 +58,7 @@ def main() :
'-a' : '' , # run all nodes non-interactively
'-r' : '=' , # give run name
'-n' : '' , # do not actually execute any processes
+ '-h' : '=' , # give hosts (*.ini) file
} )
#
@@ -70,17 +71,24 @@ def main() :
xnodes = di_nodes.node_index
+ # get run name
if '-r' in opt :
run_name = opt['-r']
else :
run_name = "user_%s_%s"%(username,str(datetime.datetime.now()).replace(' ','_'))
+ # get hosts (*.ini) file name
+ if '-h' in opt :
+ hosts_ini = opt['-h']
+ else :
+ hosts_ini = os.path.join(os.path.dirname(__file__), 'hosts.ini')
+
db = steuermann.config.open_db()
if all :
- run_all(xnodes, run_name, db)
+ run_all(xnodes, run_name, hosts_ini, db)
else :
- run_interactive( xnodes, run_name, db )
+ run_interactive( xnodes, run_name, hosts_ini, db )
#
@@ -182,14 +190,14 @@ report show report
"""
-def run_interactive( xnodes, run_name, db) :
+def run_interactive( xnodes, run_name, hosts_ini, db) :
org_run_name = run_name
run_count = 0
register_database(db, run_name, xnodes)
- runner = run.runner( xnodes )
+ runner = run.runner( xnodes, hosts_ini )
for x in xnodes :
xnodes[x].finished = 0
@@ -364,7 +372,7 @@ def register_database(db, run, xnodes ) :
#
-def run_all(xnodes, run_name, db) :
+def run_all(xnodes, run_name, hosts_ini, db) :
for x in xnodes :
x = xnodes[x]
@@ -375,7 +383,7 @@ def run_all(xnodes, run_name, db) :
register_database(db, run_name, xnodes)
- runner = run.runner( xnodes )
+ runner = run.runner( xnodes, hosts_ini )
none_running = 0
# will count how many times through there was nothing running