Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
ba7f29a6
Commit
ba7f29a6
authored
21 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Added new --quiet option to scancel so jobs that are already done don't
report an error message.
parent
08e51717
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/man/man1/scancel.1
+7
-2
7 additions, 2 deletions
doc/man/man1/scancel.1
src/scancel/opt.c
+12
-7
12 additions, 7 deletions
src/scancel/opt.c
src/scancel/scancel.c
+9
-5
9 additions, 5 deletions
src/scancel/scancel.c
with
28 additions
and
14 deletions
doc/man/man1/scancel.1
+
7
−
2
View file @
ba7f29a6
.TH SCANCEL "1" "October 2003" "scancel 0.
2
" "Slurm components"
.TH SCANCEL "1" "October 2003" "scancel 0.
3
" "Slurm components"
.SH "NAME"
scancel \- Used to signal jobs or job steps that are under the control of Slurm.
.SH "SYNOPSIS"
...
...
@@ -28,6 +28,10 @@ The name of jobs to be signaled.
\fB\-p\fR, \fB\-\-partition\fR=\fIpartition_name\fR
The name of the partition from which jobs are to be signaled.
.TP
\fB\-q\fR, \fB\-\-quiet\fR
Do not report an error if the specified job is already completed.
This option is incompatible with the \fB\-\-verbose\fR option.
.TP
\fB\-s\fR, \fB\-\-signal\fR=\fIsignal_name\fR
The name or number of the signal to be send. Default value is "KILL".
.TP
...
...
@@ -39,7 +43,8 @@ either "PENDING" or "RUNNING".
The name of the user whose jobs are to be signaled.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Print additional logging. Multiple v's increase logging detail.
Print additional logging. Multiple v's increase logging detail.
This option is incompatible with the \fB\-\-quiet\fR option.
.TP
\fB\-V\fR, \fB\-\-Version\fR
Print the version number of the scontrol command.
...
...
This diff is collapsed.
Click to expand it.
src/scancel/opt.c
+
12
−
7
View file @
ba7f29a6
...
...
@@ -204,7 +204,7 @@ static void _opt_default()
opt
.
state
=
JOB_END
;
opt
.
user_name
=
NULL
;
opt
.
user_id
=
0
;
opt
.
verbose
=
false
;
opt
.
verbose
=
0
;
}
/*
...
...
@@ -250,13 +250,13 @@ static void _opt_env()
if
(
(
val
=
getenv
(
"SCANCEL_VERBOSE"
))
)
{
if
(
strcasecmp
(
val
,
"true"
)
==
0
)
opt
.
verbose
=
true
;
opt
.
verbose
=
1
;
else
if
(
strcasecmp
(
val
,
"T"
)
==
0
)
opt
.
verbose
=
true
;
opt
.
verbose
=
1
;
else
if
(
strcasecmp
(
val
,
"false"
)
==
0
)
opt
.
verbose
=
false
;
opt
.
verbose
=
0
;
else
if
(
strcasecmp
(
val
,
"F"
)
==
0
)
opt
.
verbose
=
false
;
opt
.
verbose
=
0
;
else
error
(
"Unrecognized SCANCEL_VERBOSE value: %s"
,
val
);
...
...
@@ -274,6 +274,7 @@ static void _opt_args(int argc, char **argv)
{
"interactive"
,
no_argument
,
0
,
'i'
},
{
"name"
,
required_argument
,
0
,
'n'
},
{
"partition"
,
required_argument
,
0
,
'p'
},
{
"quiet"
,
no_argument
,
0
,
'q'
},
{
"signal"
,
required_argument
,
0
,
's'
},
{
"state"
,
required_argument
,
0
,
't'
},
{
"user"
,
required_argument
,
0
,
'u'
},
...
...
@@ -283,7 +284,7 @@ static void _opt_args(int argc, char **argv)
{
"usage"
,
no_argument
,
0
,
OPT_LONG_USAGE
}
};
while
((
opt_char
=
getopt_long
(
argc
,
argv
,
"in:p:s:t:u:vV"
,
while
((
opt_char
=
getopt_long
(
argc
,
argv
,
"in:p:
q
s:t:u:vV"
,
long_options
,
&
option_index
))
!=
-
1
)
{
switch
(
opt_char
)
{
case
(
int
)
'?'
:
...
...
@@ -299,6 +300,9 @@ static void _opt_args(int argc, char **argv)
case
(
int
)
'p'
:
opt
.
partition
=
xstrdup
(
optarg
);
break
;
case
(
int
)
'q'
:
opt
.
verbose
=
-
1
;
break
;
case
(
int
)
's'
:
opt
.
signal
=
_xlate_signal_name
(
optarg
);
break
;
...
...
@@ -429,7 +433,7 @@ static void _opt_list(void)
static
void
_usage
(
void
)
{
printf
(
"Usage: scancel [-n job_name] [-u user] [-p partition] [-s name | integer]
\n
"
);
printf
(
"Usage: scancel [-n job_name] [-u user] [-p partition]
[-q]
[-s name | integer]
\n
"
);
printf
(
" [-t PENDING | RUNNING] [--usage] [-v] [-V] [job_id[.step_id]]
\n
"
);
}
...
...
@@ -439,6 +443,7 @@ static void _help(void)
printf
(
" -i, --interactive require response from user for each job
\n
"
);
printf
(
" -n, --name=job_name name of job to be signalled
\n
"
);
printf
(
" -p, --partition=partition name of job's partition
\n
"
);
printf
(
" -q, --quiet disable warnings
\n
"
);
printf
(
" -s, --signal=name | integer signal to send to job, default is SIGKILL
\n
"
);
printf
(
" -t, --states=states states to jobs to cancel,
\n
"
);
printf
(
" default is pending and running,
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
src/scancel/scancel.c
+
9
−
5
View file @
ba7f29a6
...
...
@@ -72,7 +72,7 @@ main (int argc, char *argv[])
if
(
opt
.
verbose
)
{
log_opts
.
stderr_level
+=
opt
.
verbose
;
log_alter
(
log_opts
,
SYSLOG_FACILITY_DAEMON
,
NULL
);
}
}
if
((
opt
.
interactive
)
||
(
opt
.
job_name
)
||
...
...
@@ -229,8 +229,10 @@ _cancel_job_id (uint32_t job_id, uint16_t signal)
sleep
(
5
+
i
);
}
if
(
error_code
)
{
error
(
"Kill job error on job id %u: %s"
,
job_id
,
slurm_strerror
(
slurm_get_errno
()));
error_code
=
slurm_get_errno
();
if
((
opt
.
verbose
>=
0
)
||
(
error_code
!=
ESLURM_ALREADY_DONE
))
error
(
"Kill job error on job id %u: %s"
,
job_id
,
slurm_strerror
(
slurm_get_errno
()));
}
}
...
...
@@ -249,8 +251,10 @@ _cancel_step_id (uint32_t job_id, uint32_t step_id, uint16_t signal)
sleep
(
5
+
i
);
}
if
(
error_code
)
{
error
(
"Kill job error on job id %u.%u: %s"
,
job_id
,
step_id
,
slurm_strerror
(
slurm_get_errno
()));
error_code
=
slurm_get_errno
();
if
((
opt
.
verbose
>=
0
)
||
(
error_code
!=
ESLURM_ALREADY_DONE
))
error
(
"Kill job error on job id %u.%u: %s"
,
job_id
,
step_id
,
slurm_strerror
(
slurm_get_errno
()));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment