Skip to content

Commit 06ce979

Browse files
authored
Merge pull request #137 from jekriske-lilly/master
Grab environment variables needed for grid engine
2 parents ecabfd8 + 40639cb commit 06ce979

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
@@ -724,6 +724,16 @@ def state_gethost(self):
724724
self.log.error("Spawner unable to match host addr in job {0} with status {1}".format(self.job_id, self.job_status))
725725
return
726726

727+
def get_env(self):
728+
env = super().get_env()
729+
730+
# SGE relies on environment variables to launch local jobs. Ensure that these values are included
731+
# in the environment used to run the spawner.
732+
for key in ['SGE_CELL','SGE_EXECD','SGE_ROOT','SGE_CLUSTER_NAME','SGE_QMASTER_PORT', 'SGE_EXECD_PORT','PATH']:
733+
if key in os.environ and key not in env:
734+
env[key] = os.environ[key]
735+
return env
736+
727737

728738
class CondorSpawner(UserEnvMixin,BatchSpawnerRegexStates):
729739
batch_script = Unicode("""

0 commit comments

Comments
 (0)