From fd783928b9c6a2ecb5a32b47ca491987219deb6d Mon Sep 17 00:00:00 2001 From: Paul Juckem Date: Fri, 1 May 2015 14:01:58 -0500 Subject: [PATCH 1/2] Fixed Beopest_launcher.py to process a list of model directories. Also added ability to specify relative paths by adding os.path.basename(). --- beopest_launcher.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/beopest_launcher.py b/beopest_launcher.py index b8c303b..66b4cc5 100644 --- a/beopest_launcher.py +++ b/beopest_launcher.py @@ -32,9 +32,9 @@ def tf2flag(intxt): bp = inpardat.findall('.//bp')[0].text casefile = inpardat.findall('.//casefile')[0].text mod_dirs = [] -tmp = inpardat.findall('.//mod_dir') -for el in tmp: - mod_dirs.append(el.text) +tmp = inpardat.findall('.//mod_dir')[0].text +for el in tmp.split(','): + mod_dirs.append(el.strip()) stdir = inpardat.findall('.//stdir')[0].text mflags = inpardat.findall('.//mflags')[0].text masterip = inpardat.findall('.//masterip')[0].text @@ -65,7 +65,7 @@ def tf2flag(intxt): os.mkdir('worker%s' %(i)) for cfold in mod_dirs: print ' copying %s' %(cfold) - shutil.copytree(cfold,os.path.join(currdir,'worker%s' %(i),cfold)) + shutil.copytree(cfold,os.path.join(currdir,'worker%s' %(i),os.path.basename(cfold))) # launch the master if STARTMASTER: @@ -74,8 +74,8 @@ def tf2flag(intxt): os.chdir(currdir) if STARTWORKERS: - print 'pausing 10 seconds to let the master get rolling' - for csec in range(10): # wait 10 seconds to be sure the master started up correctly + print 'pausing 2 seconds to let the master get rolling' + for csec in range(2): # wait 10 seconds to be sure the master started up correctly print '. '*(csec+1) time.sleep(1) for i in range(numworkers): From 62a5671cb983f22a70b9af29d630e7a156ab758c Mon Sep 17 00:00:00 2001 From: Paul Juckem Date: Thu, 31 Mar 2016 10:19:50 -0500 Subject: [PATCH 2/2] minor updates to beopest_launcher. mostly comments --- beopest_launcher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beopest_launcher.py b/beopest_launcher.py index 66b4cc5..0c6c18e 100644 --- a/beopest_launcher.py +++ b/beopest_launcher.py @@ -2,7 +2,8 @@ # after estimation has already commenced. # For initial start (including master), set "workerstartN" to zero. # For starting additional slaves after this launcher has already run once, -# set "workerstartN" equal to the first available "worker#" that is available. +# set "workerstartN" equal to the first available "worker#" that is available, set +# KILLOLD to False, and STARTMASTER to False. import os import shutil @@ -75,7 +76,7 @@ def tf2flag(intxt): if STARTWORKERS: print 'pausing 2 seconds to let the master get rolling' - for csec in range(2): # wait 10 seconds to be sure the master started up correctly + for csec in range(2): # wait a few seconds to be sure the master started up correctly print '. '*(csec+1) time.sleep(1) for i in range(numworkers):