Skip to content
Snippets Groups Projects
Commit 311e1b80 authored by Don Lipari's avatar Don Lipari
Browse files

Finished the work to allow scancel to select jobs by wckey

parent 88bb16aa
No related branches found
No related tags found
No related merge requests found
...@@ -84,7 +84,7 @@ Print additional logging. Multiple v's increase logging detail. ...@@ -84,7 +84,7 @@ Print additional logging. Multiple v's increase logging detail.
This option is incompatible with the \fB\-\-quiet\fR option. This option is incompatible with the \fB\-\-quiet\fR option.
.TP .TP
\fB\-V\fR, \fB\-\-Version\fR \fB\-V\fR, \fB\-\-version\fR
Print the version number of the scancel command. Print the version number of the scancel command.
.TP .TP
...@@ -94,6 +94,11 @@ a comma\-separated list of hosts, a range of hosts (host[1\-5,7,...] for ...@@ -94,6 +94,11 @@ a comma\-separated list of hosts, a range of hosts (host[1\-5,7,...] for
example), or a filename. The host list will be assumed to be a filename only example), or a filename. The host list will be assumed to be a filename only
if it contains a "/" character. if it contains a "/" character.
.TP
\fB\-\-wckey\fR=\fIwckey\fR
Restrict the scancel operation to jobs using this workload
characterization key.
.TP .TP
ARGUMENTS ARGUMENTS
...@@ -153,6 +158,9 @@ environment variables, along with their corresponding options, are listed below. ...@@ -153,6 +158,9 @@ environment variables, along with their corresponding options, are listed below.
\fBSCANCEL_VERBOSE\fR \fBSCANCEL_VERBOSE\fR
\fB\-v\fR, \fB\-\-verbose\fR \fB\-v\fR, \fB\-\-verbose\fR
.TP 20 .TP 20
\fBSCANCEL_WCKEY\fR
\fB\-\-wckey\fR=\fIwckey\fR
.TP 20
\fBSLURM_CONF\fR \fBSLURM_CONF\fR
The location of the SLURM configuration file. The location of the SLURM configuration file.
......
...@@ -116,7 +116,8 @@ main (int argc, char *argv[]) ...@@ -116,7 +116,8 @@ main (int argc, char *argv[])
(opt.partition) || (opt.partition) ||
(opt.qos) || (opt.qos) ||
(opt.state != JOB_END) || (opt.state != JOB_END) ||
(opt.user_name)) { (opt.user_name) ||
(opt.wckey)) {
_filter_job_records (); _filter_job_records ();
} }
_cancel_jobs (); _cancel_jobs ();
...@@ -248,6 +249,24 @@ _filter_job_records (void) ...@@ -248,6 +249,24 @@ _filter_job_records (void)
} }
} }
if (opt.wckey != NULL) {
char *job_key = job_ptr[i].wckey;
/*
* A wckey that begins with '*' indicates that the wckey
* was applied by default. When the --wckey option does
* not begin with a '*', act on all wckeys with the same
* name, default or not.
*/
if ((opt.wckey[0] != '*') && (job_key[0] == '*'))
job_key++;
if (strcmp(job_key, job_ptr[i].wckey) != 0) {
job_ptr[i].job_id = 0;
continue;
}
}
if (opt.job_cnt == 0) if (opt.job_cnt == 0)
continue; continue;
for (j = 0; j < opt.job_cnt; j++) { for (j = 0; j < opt.job_cnt; j++) {
......
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