From abebc55cdd7cc2f9bf150cf4197ed6c4744de964 Mon Sep 17 00:00:00 2001 From: sienkiew Date: Fri, 7 Oct 2011 14:23:25 +0000 Subject: checkpoint git-svn-id: https://svn.stsci.edu/svn/ssb/etal/steuermann/trunk@439 d34015c8-bcbb-4646-8ac8-8ba5febf221d --- steuermann/run_all.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'steuermann/run_all.py') diff --git a/steuermann/run_all.py b/steuermann/run_all.py index 1e179a2..71cabd1 100644 --- a/steuermann/run_all.py +++ b/steuermann/run_all.py @@ -177,7 +177,7 @@ def run_interactive( xnodes, run_name, db) : register_database(db, run_name, xnodes) - runner = run.runner( xnodes, steuermann.config.logdir ) + runner = run.runner( xnodes ) for x in xnodes : xnodes[x].finished = 0 @@ -440,10 +440,7 @@ def run_step( runner, xnodes, run_name, db ) : else : try : - if runner.run(x, run_name, no_run=no_run) : - # returns true/false whether it actually ran it - it may not because of resource limits - db.execute("UPDATE sm_status SET start_time = ?, status = 'R' WHERE ( run = ? AND host = ? AND tablename = ? AND cmd = ? )", - ( str(datetime.datetime.now()), run_name, host, table, cmd ) ) + tmp = runner.run(x, run_name, no_run=no_run, logfile = make_log_file_name(run_name, host, table, cmd) ) except run.run_exception, e : now = str(datetime.datetime.now()) db.execute("UPDATE sm_status SET start_time=?, end_time=?, status='E', notes=? WHERE ( run=? AND host=? AND tablename=? AND cmd=? )", @@ -451,6 +448,11 @@ def run_step( runner, xnodes, run_name, db ) : x.finished = 1 no_sleep = 1 keep_running = 1 + else : + if tmp : + # returns true/false whether it actually ran it - it may not because of resource limits + db.execute("UPDATE sm_status SET start_time = ?, status = 'R' WHERE ( run = ? AND host = ? AND tablename = ? AND cmd = ? )", + ( str(datetime.datetime.now()), run_name, host, table, cmd ) ) db.commit() @@ -510,6 +512,10 @@ def info_callback_depth( db, run, tablename, host, cmd ) : return n.depth ##### +def make_log_file_name( run_name, table, host, cmd ) : + return '%s/run/%s/%s/%s/%s.log'%(steuermann.config.logdir, run_name, table, host, cmd) + if __name__ == '__main__' : main() + -- cgit