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

Make job name command options more consistent

The "scontrol hold/release" commands accept either "name=" or "jobname=". I've modified the documentation to only show "jobname" for consistentcy with the "scontrol update" command.

I have also modified the "scancel" command to accept "--jobname=" in addition to the existing "--name=" and "-n".
parent 7f385f1a
No related branches found
No related tags found
No related merge requests found
...@@ -56,7 +56,7 @@ Interactive mode. Confirm each job_id.step_id before performing the cancel opera ...@@ -56,7 +56,7 @@ Interactive mode. Confirm each job_id.step_id before performing the cancel opera
Cluster to issue commands to. Cluster to issue commands to.
.TP .TP
\fB\-n\fR, \fB\-\-name\fR=\fIjob_name\fR \fB\-n\fR, \fB\-\-jobname\fR=\fIjob_name\fR, \fB\-\-name\fR=\fIjob_name\fR
Restrict the scancel operation to jobs with this job name. Restrict the scancel operation to jobs with this job name.
.TP .TP
......
...@@ -191,7 +191,9 @@ This is the default behavior. ...@@ -191,7 +191,9 @@ This is the default behavior.
\fBhold\fP \fIjob_list\fP \fBhold\fP \fIjob_list\fP
Prevent a pending job from beginning started (sets it's priority to 0). Prevent a pending job from beginning started (sets it's priority to 0).
Use the \fIrelease\fP command to permit the job to be scheduled. Use the \fIrelease\fP command to permit the job to be scheduled.
The job_list argument is a comma separated list of job IDs. The job_list argument is a comma separated list of job IDs OR
"jobname=" with the job's name, which will attempt to hold all jobs having
that name.
Note that when a job is held by a system administrator using the \fBhold\fP Note that when a job is held by a system administrator using the \fBhold\fP
command, only a system administrator may release the job for execution (also command, only a system administrator may release the job for execution (also
see the \fBuhold\fP command). When the job is held by its owner, it may also see the \fBuhold\fP command). When the job is held by its owner, it may also
...@@ -275,8 +277,9 @@ or removed from the cluster. ...@@ -275,8 +277,9 @@ or removed from the cluster.
.TP .TP
\fBrelease\fP \fIjob_list\fP \fBrelease\fP \fIjob_list\fP
Release a previously held job to begin execution. Release a previously held job to begin execution.
The job_list argument is a comma separated list of job IDs. It is possible to The job_list argument is a comma separated list of job IDs OR
use the job name, specifying "name=job_name". "jobname=" with the job's name, which will attempt to hold all jobs having
that name.
Also see \fBhold\fR. Also see \fBhold\fR.
.TP .TP
......
...@@ -362,8 +362,8 @@ static void _opt_env(void) ...@@ -362,8 +362,8 @@ static void _opt_env(void)
*/ */
static void _opt_args(int argc, char **argv) static void _opt_args(int argc, char **argv)
{ {
int opt_char; char **rest = NULL;
int option_index; int i, opt_char, option_index;
static struct option long_options[] = { static struct option long_options[] = {
{"account", required_argument, 0, 'A'}, {"account", required_argument, 0, 'A'},
{"batch", no_argument, 0, 'b'}, {"batch", no_argument, 0, 'b'},
...@@ -372,6 +372,7 @@ static void _opt_args(int argc, char **argv) ...@@ -372,6 +372,7 @@ static void _opt_args(int argc, char **argv)
{"interactive", no_argument, 0, 'i'}, {"interactive", no_argument, 0, 'i'},
{"cluster", required_argument, 0, 'M'}, {"cluster", required_argument, 0, 'M'},
{"clusters", required_argument, 0, 'M'}, {"clusters", required_argument, 0, 'M'},
{"jobname", required_argument, 0, 'n'},
{"name", required_argument, 0, 'n'}, {"name", required_argument, 0, 'n'},
{"nodelist", required_argument, 0, 'w'}, {"nodelist", required_argument, 0, 'w'},
{"partition", required_argument, 0, 'p'}, {"partition", required_argument, 0, 'p'},
...@@ -464,10 +465,17 @@ static void _opt_args(int argc, char **argv) ...@@ -464,10 +465,17 @@ static void _opt_args(int argc, char **argv)
} }
} }
if (optind < argc) { if (optind < argc)
char **rest = argv + optind; rest = argv + optind;
if (rest && (rest[0][0] >= '0') && (rest[0][0] <= '9')) {
opt.job_list = rest; opt.job_list = rest;
_xlate_job_step_ids(rest); _xlate_job_step_ids(rest);
} else if (rest) {
for (i = optind; i < argc; i++) {
if (opt.job_name)
xstrcat(opt.job_name, ",");
xstrcat(opt.job_name, argv[i]);
}
} }
if (!_opt_verify()) if (!_opt_verify())
......
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