Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Commit

Permalink
Add job info for Torque and PBS (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe authored and lesteve committed Apr 14, 2018
1 parent 5c235a4 commit 5d3b57f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dask_drmaa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ def get_session():
worker_bin_path = os.path.join(sys.exec_prefix, 'bin', 'dask-worker')

# All JOB_ID and TASK_ID environment variables
_drm_info = drmaa.Session().drmsInfo
_session = drmaa.Session()
_drm_info = _session.drmsInfo
_drmaa_implementation = _session.drmaaImplementation

if "SLURM" in _drm_info:
JOB_PARAM = "%j"
JOB_ID = "$SLURM_JOB_ID"
Expand All @@ -47,6 +50,10 @@ def get_session():
JOB_PARAM = "$JOB_ID"
JOB_ID = "$JOB_ID"
TASK_ID = "$SGE_TASK_ID"
elif "Torque" == _drm_info or "PBS" in _drmaa_implementation:
JOB_PARAM = "$PBS_JOBID"
JOB_ID = "$PBS_JOBID"
TASK_ID = "$PBS_TASKNUM"
else:
JOB_PARAM = ""
JOB_ID = ""
Expand Down

0 comments on commit 5d3b57f

Please sign in to comment.