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
07e657ed
Commit
07e657ed
authored
10 years ago
by
David Bigagli
Browse files
Options
Downloads
Patches
Plain Diff
Implement the scancel command to send the job string to slurmctld
if no other command line options are specified.
parent
2ba307c2
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
src/scancel/opt.c
+28
-0
28 additions, 0 deletions
src/scancel/opt.c
src/scancel/scancel.c
+7
-2
7 additions, 2 deletions
src/scancel/scancel.c
src/scancel/scancel.h
+2
-2
2 additions, 2 deletions
src/scancel/scancel.h
with
37 additions
and
4 deletions
src/scancel/opt.c
+
28
−
0
View file @
07e657ed
...
...
@@ -151,6 +151,33 @@ int initialize_and_process_args(int argc, char *argv[])
}
/* has_default_opt()
*
* No getopt() options were specified, only the
* job ids is on the command line.
*
*/
bool
has_default_opt
(
void
)
{
if
(
opt
.
account
==
NULL
&&
opt
.
batch
==
false
&&
opt
.
interactive
==
false
&&
opt
.
job_name
==
NULL
&&
opt
.
partition
==
NULL
&&
opt
.
qos
==
NULL
&&
opt
.
reservation
==
NULL
&&
opt
.
signal
==
(
uint16_t
)
-
1
&&
opt
.
state
==
JOB_END
&&
opt
.
user_id
==
0
&&
opt
.
user_name
==
NULL
&&
opt
.
wckey
==
NULL
&&
opt
.
nodelist
==
NULL
)
{
return
true
;
}
return
false
;
}
static
uint16_t
_xlate_state_name
(
const
char
*
state_name
,
bool
env_var
)
{
...
...
@@ -223,6 +250,7 @@ static void _opt_default(void)
#endif
opt
.
interactive
=
false
;
opt
.
job_cnt
=
0
;
opt
.
job_list
=
NULL
;
opt
.
job_name
=
NULL
;
opt
.
nodelist
=
NULL
;
opt
.
partition
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
src/scancel/scancel.c
+
7
−
2
View file @
07e657ed
...
...
@@ -150,7 +150,10 @@ _proc_cluster(void)
int
filter_cnt
=
0
;
int
rc
;
_signal_job_by_str
();
if
(
has_default_opt
())
{
rc
=
_signal_job_by_str
();
return
rc
;
}
_load_job_records
();
rc
=
_verify_job_ids
();
...
...
@@ -172,7 +175,9 @@ _proc_cluster(void)
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
_load_job_records
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
src/scancel/scancel.h
+
2
−
2
View file @
07e657ed
...
...
@@ -78,6 +78,6 @@ opt_t opt;
* 3. update options with commandline args
* 4. perform some verification that options are reasonable
*/
int
initialize_and_process_args
(
int
argc
,
char
*
argv
[]);
extern
int
initialize_and_process_args
(
int
argc
,
char
*
argv
[]);
extern
bool
has_default_opt
(
void
);
#endif
/* _HAVE_SCANCEL_H */
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