Skip to content

Commit

Permalink
fixed a stupid bug for max no slots - it's now olC corresponding to -C
Browse files Browse the repository at this point in the history
  • Loading branch information
mfiers committed Nov 8, 2012
1 parent cfa58b9 commit 8876a9f
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions moa/plugin/system/openLavaActor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def hook_defineCommandOptions(job, parser):
parser.add_argument('--olx', default='', dest='openlavaExtra',
help='Extra arguments for bsub')

parser.add_argument('--oln', default=1, type=int, dest='openlavaSlots',
parser.add_argument('--olC', default=1, type=int, dest='openlavaCores',
help='The number of cores the jobs requires')

parser.add_argument('--oldummy', default=False, dest='openlavaDummy',
Expand Down Expand Up @@ -96,17 +96,12 @@ def s(*cl):
s("#BSUB -e %s" % errfile)
s("#BSUB -q %s" % sysConf.args.openlavaQueue)

#bsub_cl.extend(["-o", outfile])
#bsub_cl.extend(["-e", errfile])
#bsub_cl.extend(["-q", sysConf.args.openlavaQueue])

if '--oln' in sys.argv:
slots = sysConf.args.openlavaSlots
cores = sysConf.args.openlavaCores
else:
slots = sysConf.job.conf.get('threads', sysConf.args.openlavaSlots)
cores = sysConf.job.conf.get('threads', sysConf.args.openlavaCores)

s("#BSUB -n %d" % slots)
#bsub_cl.extend(["-n", slots])
s("#BSUB -C %d" % cores)

if sysConf.args.openlavaExtra.strip():
s("#BSUB %s" % sysConf.args.openlavaExtra)
Expand Down Expand Up @@ -203,15 +198,14 @@ def s(*cl):
os.chmod(tmpfile.name, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)

l.debug("executing bsub")
moa.ui.message("Submitting job to openlava")
moa.ui.message("Executing")
moa.ui.message(" ".join(map(str, bsub_cl)))

p = sp.Popen(map(str, bsub_cl), cwd=wd, stdout=sp.PIPE, stdin=sp.PIPE)
o, e = p.communicate("\n".join(sc))

jid = int(o.split("<")[1].split(">")[0])

moa.ui.message("Submitted a job to openlava with id %d" % jid)

if not sysConf.job.data.openlava.jids.get(command):
sysConf.job.data.openlava.jids[command] = []

Expand All @@ -227,9 +221,14 @@ def s(*cl):
l.debug("jids stored %s" % str(sysConf.job.data.openlava.jids))
return p.returncode

OnErrorScript = """
OnSuccessScript = """
#BSUB -w '({%- for j in jids -%}
{%- if loop.index0 > 0 %}&&{% endif -%}
done({{j}})
{%- endfor -%})'
"""

OnErrorScript = """
"""

Expand Down

0 comments on commit 8876a9f

Please sign in to comment.