diff --git a/doc/html/job_array.shtml b/doc/html/job_array.shtml index 1b30d00d251a9324734c50e6a944b1789a662398..85950d663addcae4c1e8961ae166ab971acf0c94 100644 --- a/doc/html/job_array.shtml +++ b/doc/html/job_array.shtml @@ -179,9 +179,14 @@ JobId=15 ArrayJobId=13 ArrayTaskId=3 Name=tmp $ scontrol update JobId=15 TimeLimit=30 </pre> -<p>The scontrol hold, holdu and release commands will operate on all +<p>The scontrol command will accept a job array element specification for +the update job command, but only operate on one job (or job array element). +The scontrol hold, holdu and release commands will operate on all elements of a job array or individual elements as shown below.</p> <pre> +# Modify a job +$ scontrol update jobid=13_1 ... + # Hold all elements of job array 13 $ scontrol hold 13 @@ -193,8 +198,9 @@ $ scontrol release 13_2 <p>The following Slurm commands do not currently recognize job arrays and their use requires the use of Slurm job IDs, which are unique for each array element: -sacct, sattach, sbcast, smap, sprio, sreport, sshare, sstat, strigger, and -sview. +sacct, sbcast, smap, sreport, sshare, sstat, strigger, and sview. +The sattach, sprio and sstat commands have been modified to permit +specification of either job IDs or job array elements. The sview command has been modified to permit display of a job's ArrayJobId and ArrayTaskId fields. Both fields are displayed with a value of "N/A" if the job is not part of a job array.</p> diff --git a/src/sattach/opt.c b/src/sattach/opt.c index 80668841101f8916910e3677f9633fbafc96d7b2..3fce189baa5fbb2307d1d74abf1ad93fad6e61cb 100644 --- a/src/sattach/opt.c +++ b/src/sattach/opt.c @@ -392,8 +392,8 @@ static void _parse_jobid_stepid(char *jobid_str) step = ptr + 1; } - jobid = strtol(job, &ptr, 10); - if (!xstring_is_whitespace(ptr)) { + jobid = slurm_xlate_job_id(job); + if (jobid == 0) { error("\"%s\" does not look like a jobid", job); _usage(); xfree(job); diff --git a/src/scontrol/update_job.c b/src/scontrol/update_job.c index 3290b209e6df48932a1211080e3cc11620302300..3bb7540b78728a24a5d3fcd20d9b9a7aafdfbb7f 100644 --- a/src/scontrol/update_job.c +++ b/src/scontrol/update_job.c @@ -403,7 +403,8 @@ scontrol_update_job (int argc, char *argv[]) } if (strncasecmp(tag, "JobId", MAX(taglen, 3)) == 0) { - if (parse_uint32(val, &job_msg.job_id)) { + job_msg.job_id = slurm_xlate_job_id(val); + if (job_msg.job_id == 0) { error ("Invalid JobId value: %s", val); exit_code = 1; return 0; diff --git a/src/sprio/opts.c b/src/sprio/opts.c index b5afc0a39245888e93db9297c583384440d9c6aa..ea96ef138fbe10fb372fbfb1855a73b987ce8d90 100644 --- a/src/sprio/opts.c +++ b/src/sprio/opts.c @@ -439,9 +439,8 @@ _build_job_list( char* str ) my_list = list_create( NULL ); my_job_list = xstrdup( str ); job = strtok_r( my_job_list, ",", &tmp_char ); - while (job) - { - i = strtol( job, (char **) NULL, 10 ); + while (job) { + i = slurm_xlate_job_id(job); if (i <= 0) { error( "Invalid job id: %s", job ); exit( 1 ); diff --git a/src/sstat/options.c b/src/sstat/options.c index 93909ccfc27e1dc1dbff678b8c37ae30fa2e20b9..7b22ffcb716419a32f89b6eef96a849e5e325e27 100644 --- a/src/sstat/options.c +++ b/src/sstat/options.c @@ -189,7 +189,8 @@ static int _addto_job_list(List job_list, char *names) selected_step->stepid = atoi(dot); } - selected_step->jobid = atoi(name); + selected_step->jobid = + slurm_xlate_job_id(name); xfree(name); while ((curr_step = list_next(itr))) { @@ -233,7 +234,7 @@ static int _addto_job_list(List job_list, char *names) else selected_step->stepid = atoi(dot); } - selected_step->jobid = atoi(name); + selected_step->jobid = slurm_xlate_job_id(name); xfree(name); while ((curr_step = list_next(itr))) {