mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-10 12:21:57 +08:00
slurm job id (#1605)
This commit is contained in:
@@ -508,6 +508,12 @@ class Trainer(
|
||||
try:
|
||||
job_id = os.environ['SLURM_JOB_ID']
|
||||
job_id = int(job_id)
|
||||
|
||||
# in interactive mode, don't make logs use the same job id
|
||||
in_slurm_interactive_mode = os.environ['SLURM_JOB_NAME'] == 'bash'
|
||||
if in_slurm_interactive_mode:
|
||||
job_id = None
|
||||
|
||||
except Exception:
|
||||
job_id = None
|
||||
return job_id
|
||||
|
||||
Reference in New Issue
Block a user