Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions beopest_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -32,9 +33,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
Expand Down Expand Up @@ -65,7 +66,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:
Expand All @@ -74,8 +75,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 a few seconds to be sure the master started up correctly
print '. '*(csec+1)
time.sleep(1)
for i in range(numworkers):
Expand Down