Skip to content

Commit 40639cb

Browse files
Grab environment variables needed for grid engine
1 parent 383e8a3 commit 40639cb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

batchspawner/batchspawner.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,16 @@ def state_gethost(self):
683683
self.log.error("Spawner unable to match host addr in job {0} with status {1}".format(self.job_id, self.job_status))
684684
return
685685

686+
def get_env(self):
687+
env = super().get_env()
688+
689+
# SGE relies on environment variables to launch local jobs. Ensure that these values are included
690+
# in the environment used to run the spawner.
691+
for key in ['SGE_CELL','SGE_EXECD','SGE_ROOT','SGE_CLUSTER_NAME','SGE_QMASTER_PORT', 'SGE_EXECD_PORT','PATH']:
692+
if key in os.environ and key not in env:
693+
env[key] = os.environ[key]
694+
return env
695+
686696

687697
class CondorSpawner(UserEnvMixin,BatchSpawnerRegexStates):
688698
batch_script = Unicode("""

0 commit comments

Comments
 (0)