From 9cda8c3aee233f9e457024f96e018e993d6fce88 Mon Sep 17 00:00:00 2001 From: JakeNarkizian Date: Mon, 5 Oct 2015 02:11:23 -0700 Subject: [PATCH] Added Support For Terabyte Output And shm Processors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified init in MemoryString class in gridengine.py to support for terabyte (T) MEMTOT output from host, and specified shm processors via -pe shm in prepareQsub function. GridEngine Parallel Environment is now configurable, “shm” is the default value unless TOIL_GRIDENGINE_PE environment variable is set and non-empty --- src/toil/batchSystems/gridengine.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/toil/batchSystems/gridengine.py b/src/toil/batchSystems/gridengine.py index 850f4575ab..8c455f30c8 100644 --- a/src/toil/batchSystems/gridengine.py +++ b/src/toil/batchSystems/gridengine.py @@ -31,7 +31,7 @@ class MemoryString: def __init__(self, string): - if string[-1] == 'K' or string[-1] == 'M' or string[-1] == 'G': + if string[-1] == 'K' or string[-1] == 'M' or string[-1] == 'G' or string[-1] == 'T': self.unit = string[-1] self.val = float(string[:-1]) else: @@ -54,6 +54,8 @@ def byteVal(self): return self.val * 1048576 elif self.unit == 'G': return self.val * 1073741824 + elif self.unit == 'T': + return self.val * 1099511627776 def __cmp__(self, other): return cmp(self.bytes, other.bytes) @@ -76,7 +78,8 @@ def prepareQsub(cpu, mem, jobID): if len(reqline) > 0: qsubline.extend(["-hard", "-l", ",".join(reqline)]) if cpu is not None and math.ceil(cpu) > 1: - qsubline.extend(["-pe", "smp", str(int(math.ceil(cpu)))]) + peConfig = os.getenv('TOIL_GRIDENGINE_PE') or "shm" + qsubline.extend(["-pe", peConfig, str(int(math.ceil(cpu)))]) return qsubline