diff --git a/NEWS b/NEWS index b0dae062d5adb8953cb3e51b80f4877b1be513f2..c1c0e00c3d37643f7cf07ba290030bdb68c979fb 100644 --- a/NEWS +++ b/NEWS @@ -11,7 +11,9 @@ documents those changes that are of interest to users and admins. WARNING: A NodeName may now occur only once in a slurm.conf file. If you want to temporarily make nodes DOWN in the slurm.conf, use the new DownNodes keyword (see "man slurm.conf"). - + -- Gracefully handle request to submit batch job from within an existing batch job. + -- Warn user attempting to create a job allocation from within an existing job + allocation. * Changes in SLURM 1.1.0-pre2 ============================= diff --git a/src/srun/allocate.c b/src/srun/allocate.c index 5294ef74484d7801b38682e08d64b808d78e34d3..ed976bef2f8fd6362e61023be910614b82949a18 100644 --- a/src/srun/allocate.c +++ b/src/srun/allocate.c @@ -96,6 +96,15 @@ allocate_nodes(void) xsignal_save_mask(&oset); xsignal_unblock(sigarray); + /* Do not re-use existing job id when submitting new job + * from within a running job */ + if (j->job_id != NO_VAL) { + info("WARNING: Creating SLURM job allocation from within " + "another allocation"); + info("WARNING: You are attempting to initiate a second job"); + j->job_id = NO_VAL; + } + while ((rc = slurm_allocate_resources(j, &resp) < 0) && _retry()) { if (destroy_job) goto done;