From 940d63a7bc3e5d907e1b6a70ec007ea68153e00e Mon Sep 17 00:00:00 2001 From: Max Levine Date: Tue, 5 Mar 2019 12:01:59 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20actually=20fix=20encapsulated=20?= =?UTF-8?q?jobs=20(#25)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- toil_container/VERSION | 2 +- toil_container/lsf.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/toil_container/VERSION b/toil_container/VERSION index 65087b4..e25d8d9 100644 --- a/toil_container/VERSION +++ b/toil_container/VERSION @@ -1 +1 @@ -1.1.4 +1.1.5 diff --git a/toil_container/lsf.py b/toil_container/lsf.py index d8ed790..107bf1b 100644 --- a/toil_container/lsf.py +++ b/toil_container/lsf.py @@ -267,9 +267,11 @@ def build_bsub_line(cpu, mem, runtime, jobname): "'{}'".format(jobname), ] + cpu = int(cpu) or 1 + if mem: if os.getenv(_PER_SLOT_LSF_CONFIG) == "Y" or per_core_reservation(): - mem = float(mem) / 1024 ** 3 / int(cpu or 1) + mem = float(mem) / 1024 ** 3 / cpu else: mem = old_div(float(mem), 1024 ** 3) @@ -281,7 +283,7 @@ def build_bsub_line(cpu, mem, runtime, jobname): bsubline += ["-M", str(mem_limit)] if cpu: - bsubline += ["-n", str(int(cpu))] + bsubline += ["-n", str(cpu)] if runtime: bsubline += [os.getenv("TOIL_CONTAINER_RUNTIME_FLAG", "-W"), str(int(runtime))]