Skip to content

Commit

Permalink
🐛 support lsf encapsulated jobs (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mflevine authored and jsmedmar committed Mar 4, 2019
1 parent 202589e commit c205323
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests/test_lsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_build_bsub_line():
obtained = lsf.build_bsub_line(cpu=cpu, mem=mem, runtime=1, jobname="Test Job")

if per_core_reservation():
mem = float(mem) / 1024 ** 3 / int(cpu)
mem = float(mem) / 1024 ** 3 / int(cpu or 1)
else:
mem = old_div(float(mem), 1024 ** 3)

Expand Down Expand Up @@ -87,6 +87,10 @@ def test_build_bsub_line():
del os.environ["TOIL_LSF_ARGS"]


def test_build_bsub_line_zero_cpus():
lsf.build_bsub_line(cpu=0, mem=2147483648, runtime=1, jobname="Test Job")


@SKIP_LSF
def test_bsubline_works():
command = lsf.build_bsub_line(cpu=1, mem=2147483648, runtime=1, jobname="Test Job")
Expand Down
2 changes: 1 addition & 1 deletion toil_container/lsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def build_bsub_line(cpu, mem, runtime, jobname):

if mem:
if os.getenv(_PER_SLOT_LSF_CONFIG) == "Y" or per_core_reservation():
mem = float(mem) / 1024 ** 3 / int(cpu)
mem = float(mem) / 1024 ** 3 / int(cpu or 1)
else:
mem = old_div(float(mem), 1024 ** 3)

Expand Down

0 comments on commit c205323

Please sign in to comment.