Skip to content
Snippets Groups Projects
Commit 70532fe3 authored by Morris Jette's avatar Morris Jette
Browse files

add job array support to sstat, sprio and sattach

parent 98e6b2dc
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
......@@ -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);
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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))) {
......
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