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
1240c1f6
Commit
1240c1f6
authored
13 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
dd scancel support for --clusters option
parent
9b559a5c
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
NEWS
+1
-0
1 addition, 0 deletions
NEWS
src/scancel/opt.c
+3
-3
3 additions, 3 deletions
src/scancel/opt.c
src/scancel/scancel.c
+41
-6
41 additions, 6 deletions
src/scancel/scancel.c
src/squeue/squeue.c
+2
-0
2 additions, 0 deletions
src/squeue/squeue.c
with
47 additions
and
9 deletions
NEWS
+
1
−
0
View file @
1240c1f6
...
@@ -26,6 +26,7 @@ documents those changes that are of interest to users and admins.
...
@@ -26,6 +26,7 @@ documents those changes that are of interest to users and admins.
-- Improve accuracy of REQUEST_JOB_WILL_RUN start time with respect to higher
-- Improve accuracy of REQUEST_JOB_WILL_RUN start time with respect to higher
priority pending jobs.
priority pending jobs.
-- Add -R/--reservation option to squeue command as a job filter.
-- Add -R/--reservation option to squeue command as a job filter.
-- Add scancel support for --clusters option.
* Changes in SLURM 2.3.0.pre5
* Changes in SLURM 2.3.0.pre5
=============================
=============================
...
...
This diff is collapsed.
Click to expand it.
src/scancel/opt.c
+
3
−
3
View file @
1240c1f6
...
@@ -365,10 +365,10 @@ static void _opt_args(int argc, char **argv)
...
@@ -365,10 +365,10 @@ static void _opt_args(int argc, char **argv)
break
;
break
;
case
(
int
)
'M'
:
case
(
int
)
'M'
:
opt
.
ctld
=
true
;
opt
.
ctld
=
true
;
if
(
opt
.
clusters
)
if
(
opt
.
clusters
)
list_destroy
(
opt
.
clusters
);
list_destroy
(
opt
.
clusters
);
if
(
!
(
opt
.
clusters
=
opt
.
clusters
=
slurmdb_get_info_cluster
(
optarg
);
slurmdb_get_info_cluster
(
optarg
))
)
{
if
(
!
opt
.
clusters
)
{
error
(
"'%s' invalid entry for --cluster"
,
error
(
"'%s' invalid entry for --cluster"
,
optarg
);
optarg
);
exit
(
1
);
exit
(
1
);
...
...
This diff is collapsed.
Click to expand it.
src/scancel/scancel.c
+
41
−
6
View file @
1240c1f6
...
@@ -59,6 +59,7 @@
...
@@ -59,6 +59,7 @@
#include
"slurm/slurm.h"
#include
"slurm/slurm.h"
#include
"src/common/list.h"
#include
"src/common/log.h"
#include
"src/common/log.h"
#include
"src/common/xstring.h"
#include
"src/common/xstring.h"
#include
"src/common/xmalloc.h"
#include
"src/common/xmalloc.h"
...
@@ -69,14 +70,16 @@
...
@@ -69,14 +70,16 @@
#define MAX_THREADS 20
#define MAX_THREADS 20
static
void
_cancel_jobs
(
void
);
static
void
_cancel_jobs
(
void
);
static
void
*
_cancel_job_id
(
void
*
cancel_info
);
static
void
*
_cancel_job_id
(
void
*
cancel_info
);
static
void
*
_cancel_step_id
(
void
*
cancel_info
);
static
void
*
_cancel_step_id
(
void
*
cancel_info
);
static
int
_confirmation
(
int
i
,
uint32_t
step_id
);
static
int
_confirmation
(
int
i
,
uint32_t
step_id
);
static
void
_filter_job_records
(
void
);
static
void
_filter_job_records
(
void
);
static
void
_load_job_records
(
void
);
static
void
_load_job_records
(
void
);
static
int
_verify_job_ids
(
void
);
static
int
_multi_cluster
(
List
clusters
);
static
int
_proc_cluster
(
void
);
static
int
_verify_job_ids
(
void
);
static
job_info_msg_t
*
job_buffer_ptr
=
NULL
;
static
job_info_msg_t
*
job_buffer_ptr
=
NULL
;
...
@@ -107,9 +110,41 @@ main (int argc, char *argv[])
...
@@ -107,9 +110,41 @@ main (int argc, char *argv[])
log_alter
(
log_opts
,
SYSLOG_FACILITY_DAEMON
,
NULL
);
log_alter
(
log_opts
,
SYSLOG_FACILITY_DAEMON
,
NULL
);
}
}
if
(
opt
.
clusters
)
rc
=
_multi_cluster
(
opt
.
clusters
);
else
rc
=
_proc_cluster
();
exit
(
rc
);
}
/* _multi_cluster - process job cancellation across a list of clusters */
static
int
_multi_cluster
(
List
clusters
)
{
ListIterator
itr
;
int
rc
=
0
,
rc2
;
itr
=
list_iterator_create
(
clusters
);
if
(
!
itr
)
fatal
(
"list_iterator_create: malloc failure"
);
while
((
working_cluster_rec
=
list_next
(
itr
)))
{
rc2
=
_proc_cluster
();
rc
=
MAX
(
rc
,
rc2
);
}
list_iterator_destroy
(
itr
);
return
rc
;
}
/* _proc_cluster - process job cancellation on a specific cluster */
static
int
_proc_cluster
(
void
)
{
int
rc
;
_load_job_records
();
_load_job_records
();
rc
=
_verify_job_ids
();
rc
=
_verify_job_ids
();
if
((
opt
.
account
)
||
if
((
opt
.
account
)
||
(
opt
.
interactive
)
||
(
opt
.
interactive
)
||
(
opt
.
job_name
)
||
(
opt
.
job_name
)
||
...
@@ -120,14 +155,14 @@ main (int argc, char *argv[])
...
@@ -120,14 +155,14 @@ main (int argc, char *argv[])
(
opt
.
state
!=
JOB_END
)
||
(
opt
.
state
!=
JOB_END
)
||
(
opt
.
user_name
)
||
(
opt
.
user_name
)
||
(
opt
.
wckey
))
{
(
opt
.
wckey
))
{
_filter_job_records
();
_filter_job_records
();
}
}
_cancel_jobs
();
_cancel_jobs
();
slurm_free_job_info_msg
(
job_buffer_ptr
);
exit
(
rc
)
;
return
rc
;
}
}
/* _load_job_records - load all job information for filtering and verification */
/* _load_job_records - load all job information for filtering and verification */
static
void
static
void
_load_job_records
(
void
)
_load_job_records
(
void
)
...
...
This diff is collapsed.
Click to expand it.
src/squeue/squeue.c
+
2
−
0
View file @
1240c1f6
...
@@ -117,6 +117,8 @@ static int _multi_cluster(List clusters)
...
@@ -117,6 +117,8 @@ static int _multi_cluster(List clusters)
int
rc
=
0
,
rc2
;
int
rc
=
0
,
rc2
;
itr
=
list_iterator_create
(
clusters
);
itr
=
list_iterator_create
(
clusters
);
if
(
!
itr
)
fatal
(
"list_iterator_create: malloc failure"
);
while
((
working_cluster_rec
=
list_next
(
itr
)))
{
while
((
working_cluster_rec
=
list_next
(
itr
)))
{
if
(
first
)
if
(
first
)
first
=
false
;
first
=
false
;
...
...
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