Skip to content

Commit

Permalink
always honor TOIL_GRIDENGINE_PE and never assume a site-dependent def…
Browse files Browse the repository at this point in the history
…ault (#3041)

* always honor TOIL_GRIDENGINE_PE and never assume a site-dependent default

* requite TOIL_GRIDENGINE_PE if multiple CPUs are used

* give hints on where to look for coorrent PE values
  • Loading branch information
diekhans authored Apr 16, 2020
1 parent d4c7862 commit b523cc4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/toil/batchSystems/gridengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,12 @@ def prepareQsub(self, cpu, mem, jobID):
if arg.startswith(("vf=", "hvmem=", "-pe")):
raise ValueError("Unexpected CPU, memory or pe specifications in TOIL_GRIDGENGINE_ARGs: %s" % arg)
qsubline.extend(sgeArgs)
if cpu is not None and math.ceil(cpu) > 1:
peConfig = os.getenv('TOIL_GRIDENGINE_PE') or 'shm'
qsubline.extend(['-pe', peConfig, str(int(math.ceil(cpu)))])
if os.getenv('TOIL_GRIDENGINE_PE') is not None:
peCpu = int(math.ceil(cpu)) if cpu is not None else 1
qsubline.extend(['-pe', os.getenv('TOIL_GRIDENGINE_PE'), str(peCpu)])
elif (cpu is not None) and (cpu > 1):
raise RuntimeError("must specify PE in TOIL_GRIDENGINE_PE environment variable when using multiple CPUs. "
"Run qconf -spl and your local documentation for possible values")

stdoutfile = self.boss.formatStdOutErrPath(jobID, 'gridengine', '$JOB_ID', 'std_output')
stderrfile = self.boss.formatStdOutErrPath(jobID, 'gridengine', '$JOB_ID', 'std_error')
Expand Down

0 comments on commit b523cc4

Please sign in to comment.