Skip to content

Commit

Permalink
jobid fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorEijkhout committed Jul 12, 2024
1 parent 2485a4f commit 9cad998
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/pylauncher/pylauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
otoelog = """
Change log
4.3
- slurm submit launcher
- slurm submit launcher, jobid detection fixed
4.2
- queuestate through explicit option
4.1
Expand Down Expand Up @@ -1115,11 +1115,12 @@ def JobId():
``HostName``): this should only return a number if we are actually in a job.
"""
hostname = ClusterName()
if hostname=="ls4":
return os.environ["JOB_ID"]
elif hostname in ["ls5","ls6","maverick","stampede",] \
or re.match('stampede2',hostname) or re.match('stampede3',hostname):
if "SLURM_JOB_ID" in os.environ.keys():
# case SLURM
return os.environ["SLURM_JOB_ID"]
elif "PBS_JOBID" in os.environ.keys():
# case PBS
return os.environ["PBS_JOBID"]
elif hostname in ["pace"]:
return os.environ["PBS_JOBID"]
else:
Expand Down

0 comments on commit 9cad998

Please sign in to comment.