Skip to content
Snippets Groups Projects
Commit 3cb97031 authored by Moe Jette's avatar Moe Jette
Browse files

Tweak re-use of slurm_jobid in batch job, only use it if

expliclty set on srun execute line, do not re-use it from 
the SLURM_JOBID env var (which prevents submitting a 
series of batch jobs).
parent ec29d1de
No related branches found
No related tags found
No related merge requests found
...@@ -679,6 +679,7 @@ static void _opt_default() ...@@ -679,6 +679,7 @@ static void _opt_default()
opt.job_name = NULL; opt.job_name = NULL;
opt.jobid = NO_VAL; opt.jobid = NO_VAL;
opt.jobid_set = false;
opt.dependency = NO_VAL; opt.dependency = NO_VAL;
opt.account = NULL; opt.account = NULL;
...@@ -1360,6 +1361,7 @@ void set_options(const int argc, char **argv, int first) ...@@ -1360,6 +1361,7 @@ void set_options(const int argc, char **argv, int first)
break; break;
case LONG_OPT_JOBID: case LONG_OPT_JOBID:
opt.jobid = _get_int(optarg, "jobid"); opt.jobid = _get_int(optarg, "jobid");
opt.jobid_set = true;
break; break;
case LONG_OPT_TIMEO: case LONG_OPT_TIMEO:
opt.msg_timeout = opt.msg_timeout =
......
...@@ -106,6 +106,7 @@ typedef struct srun_options { ...@@ -106,6 +106,7 @@ typedef struct srun_options {
distribution; /* --distribution=, -m dist */ distribution; /* --distribution=, -m dist */
char *job_name; /* --job-name=, -J name */ char *job_name; /* --job-name=, -J name */
unsigned int jobid; /* --jobid=jobid */ unsigned int jobid; /* --jobid=jobid */
bool jobid_set; /* true of jobid explicitly set */
char *mpi_type; /* --mpi=type */ char *mpi_type; /* --mpi=type */
unsigned int dependency;/* --dependency, -P jobid */ unsigned int dependency;/* --dependency, -P jobid */
int nice; /* --nice */ int nice; /* --nice */
......
...@@ -458,9 +458,10 @@ _run_batch_job(void) ...@@ -458,9 +458,10 @@ _run_batch_job(void)
if (!(req = job_desc_msg_create_from_opts (script))) if (!(req = job_desc_msg_create_from_opts (script)))
fatal ("Unable to create job request"); fatal ("Unable to create job request");
/* Do not re-use existing job id when submitting new job /* Do not re-use existing job id from environment variable
* from within a running job */ * when submitting new job from within a running job */
req->job_id = NO_VAL; if (opt.jobid_set != NO_VAL)
req->job_id = (uint32_t)opt.jobid;
retries = 0; retries = 0;
while ( (retries < MAX_RETRIES) while ( (retries < MAX_RETRIES)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment