diff --git a/doc/html/heterogeneous_jobs.shtml b/doc/html/heterogeneous_jobs.shtml index b2df83119f60681e819ee00d5f8c096701d8f41e..59d74441b81bd7ca8df74521ea123d8545563b55 100644 --- a/doc/html/heterogeneous_jobs.shtml +++ b/doc/html/heterogeneous_jobs.shtml @@ -223,7 +223,7 @@ $ squeue --job=93 JOBID PARTITION NAME USER ST TIME NODES NODELIST </pre> -<pWhile a heterogeneous job is in pending state, only the entire job can be +<p>While a heterogeneous job is in pending state, only the entire job can be cancelled rather than it's individual components. A request to cancel an individual component of a heterogeneous job not in pending state will return an error. @@ -233,6 +233,19 @@ After the job has begun execution, the individual component can be cancelled.</p is only supported for a pack leader. Requests for email notifications for other components of a heterogeneous job will be silently ignored.</p> +<p>Requests to modify an individual component of a job using the scontrol +command must specify the job ID with the "#+#" notation. +A request to modify a job by specifying the pack_job_id will modify all +components of a heterogeneous job. +For example:</p> +<pre> +# Change the account of compnent 2 of heterogeneous job 123: +$ scontrol update jobid=123+2 account=abc + +# Change the time limit of all components of heterogeneous job 123: +$ scontrol update jobid=123 timelimit=60 +</pre> + <p>Requests to perform the following operations a job can only be requested for a pack leader and will be applied to all components of that heterogeneous job. Requests to operate on individual components of the heterogeneous will return @@ -470,6 +483,6 @@ especially other heterogeneous jobs.</p> <p class="footer"><a href="#top">top</a></p> -<p style="text-align:center;">Last modified 11 August 2017</p> +<p style="text-align:center;">Last modified 14 August 2017</p> <!--#include virtual="footer.txt"--> diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index 1049ce85cacae02c6593b1da3021e443138a47a2..d8dd9bcddd9eab1a2eaf4937d6dfedd24214cd2b 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -12767,9 +12767,11 @@ extern int update_job(slurm_msg_t *msg, uid_t uid, bool send_msg) */ extern int update_job_str(slurm_msg_t *msg, uid_t uid) { + slurm_msg_t resp_msg; job_desc_msg_t *job_specs = (job_desc_msg_t *) msg->data; - struct job_record *job_ptr, *new_job_ptr; + struct job_record *job_ptr, *new_job_ptr, *pack_job; + ListIterator iter; long int long_id; uint32_t job_id = 0, pack_offset; bitstr_t *array_bitmap = NULL, *tmp_bitmap; @@ -12799,6 +12801,20 @@ extern int update_job_str(slurm_msg_t *msg, uid_t uid) if (end_ptr[0] == '\0') { /* Single job (or full job array) */ struct job_record *job_ptr_done = NULL; job_ptr = find_job_record(job_id); + if (job_ptr && job_ptr->pack_job_list) { + iter = list_iterator_create(job_ptr->pack_job_list); + while ((pack_job = list_next(iter))) { + if (job_ptr->pack_job_id != + pack_job->pack_job_id) { + error("%s: Bad pack_job_list for job %u", + __func__, job_ptr->pack_job_id); + continue; + } + rc = _update_job(pack_job, job_specs, uid); + } + list_iterator_destroy(iter); + goto reply; + } if (job_ptr && (((job_ptr->array_task_id == NO_VAL) && (job_ptr->array_recs == NULL)) || @@ -12842,7 +12858,7 @@ extern int update_job_str(slurm_msg_t *msg, uid_t uid) goto reply; } else if (end_ptr[0] == '+') { /* Pack job element */ long_id = strtol(end_ptr+1, &tmp, 10); - if ((long_id <= 0) || (long_id == LONG_MAX) || + if ((long_id < 0) || (long_id == LONG_MAX) || (tmp[0] != '\0')) { info("%s: invalid job id %s", __func__, job_id_str); rc = ESLURM_INVALID_JOB_ID;