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
b65ce7bd
Commit
b65ce7bd
authored
21 years ago
by
Mark Grondona
Browse files
Options
Downloads
Patches
Plain Diff
o add -q,--quit-on-interrupt option to srun
parent
9a0f7aaf
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
NEWS
+1
-0
1 addition, 0 deletions
NEWS
doc/man/man1/srun.1
+6
-0
6 additions, 0 deletions
doc/man/man1/srun.1
src/srun/opt.c
+8
-1
8 additions, 1 deletion
src/srun/opt.c
src/srun/opt.h
+1
-0
1 addition, 0 deletions
src/srun/opt.h
src/srun/signals.c
+4
-0
4 additions, 0 deletions
src/srun/signals.c
with
20 additions
and
1 deletion
NEWS
+
1
−
0
View file @
b65ce7bd
...
...
@@ -26,6 +26,7 @@ documents those changes that are of interest to users and admins.
-- Added job and node state descriptions to the squeue and sinfo man pages
-- Backup slurmctld to generate core file on SIGABRT
-- Backup slurmctld to re-read slurm.conf on SIGHUP
-- Added -q,--quit-on-interrupt option to srun.
* Changes in SLURM 0.3.0.0-pre6
===============================
...
...
This diff is collapsed.
Click to expand it.
doc/man/man1/srun.1
+
6
−
0
View file @
b65ce7bd
...
...
@@ -226,6 +226,12 @@ all remaining tasks. The default value is unlimited. This can be useful to
insure that a job is terminated in a timely fashion in the event that one
or more tasks terminate prematurely.
.TP
\fB\-q\fR, \fB\-\-quit-on-interrupt\fR
Quit immediately on single SIGINT (Ctrl-C). Use of this option
disables the status feature normally available when \fBsrun\fR receives
a single Ctrl-C and causes \fBsrun\fR to instead immediately terminate the
running job.
.TP
\fB\-\-uid\fR=\fIuser\fR
If
.B srun
...
...
This diff is collapsed.
Click to expand it.
src/srun/opt.c
+
8
−
1
View file @
b65ce7bd
...
...
@@ -416,6 +416,8 @@ static void _opt_default()
opt
.
join
=
false
;
opt
.
max_wait
=
slurm_get_wait_time
();
opt
.
quit_on_intr
=
false
;
_verbose
=
0
;
opt
.
slurmd_debug
=
LOG_LEVEL_QUIET
;
...
...
@@ -634,6 +636,7 @@ static void _opt_args(int argc, char **argv)
{
"wait"
,
required_argument
,
0
,
'W'
},
{
"exclude"
,
required_argument
,
0
,
'x'
},
{
"no-allocate"
,
no_argument
,
0
,
'Z'
},
{
"quit-on-interrupt"
,
no_argument
,
0
,
'q'
},
{
"contiguous"
,
no_argument
,
0
,
LONG_OPT_CONT
},
{
"mincpus"
,
required_argument
,
0
,
LONG_OPT_MINCPU
},
...
...
@@ -650,7 +653,7 @@ static void _opt_args(int argc, char **argv)
{
"usage"
,
no_argument
,
0
,
LONG_OPT_USAGE
}
};
char
*
opt_string
=
"+a:Abc:C:d:D:e:Hi:IjJ:klm:n:N:"
"o:Op:r:st:T:uvVw:W:x:Z"
;
"o:Op:r:st:T:uvVw:W:x:Z
q
"
;
char
**
rest
=
NULL
;
opt
.
progname
=
xbasename
(
argv
[
0
]);
...
...
@@ -769,6 +772,9 @@ static void _opt_args(int argc, char **argv)
xfree
(
opt
.
partition
);
opt
.
partition
=
xstrdup
(
optarg
);
break
;
case
(
int
)
'q'
:
opt
.
quit_on_intr
=
true
;
break
;
case
(
int
)
'r'
:
xfree
(
opt
.
relative
);
opt
.
relative
=
xstrdup
(
optarg
);
...
...
@@ -1319,6 +1325,7 @@ static void _help(void)
printf
(
" -T, --threads=threads set srun launch fanout
\n
"
);
printf
(
" -W, --wait=sec seconds to wait after first task ends
\n
"
);
printf
(
" before killing job
\n
"
);
printf
(
" -q, --quit-on-interrupt quit on single Ctrl-C
\n
"
);
printf
(
"
\n
Allocate only:
\n
"
);
printf
(
" -A, --allocate allocate resources and spawn a shell
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
src/srun/opt.h
+
1
−
0
View file @
b65ce7bd
...
...
@@ -130,6 +130,7 @@ typedef struct srun_options {
bool
no_kill
;
/* --no-kill, -k */
bool
share
;
/* --share, -s */
int
max_wait
;
/* --wait, -W */
bool
quit_on_intr
;
/* --quit-on-interrupt, -q */
#ifdef HAVE_TOTALVIEW
bool
totalview
;
/* srun controlled by TotalView */
#endif
...
...
This diff is collapsed.
Click to expand it.
src/srun/signals.c
+
4
−
0
View file @
b65ce7bd
...
...
@@ -189,6 +189,10 @@ _sigterm_handler(int signum)
static
void
_handle_intr
(
job_t
*
job
,
time_t
*
last_intr
,
time_t
*
last_intr_sent
)
{
if
(
opt
.
quit_on_intr
)
{
job_force_termination
(
job
);
pthread_exit
(
0
);
}
if
((
time
(
NULL
)
-
*
last_intr
)
>
1
)
{
info
(
"interrupt (one more within 1 sec to abort)"
);
...
...
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