Skip to content
Snippets Groups Projects
Commit 07e657ed authored by David Bigagli's avatar David Bigagli
Browse files

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
......@@ -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;
......
......@@ -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)
{
......
......@@ -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 */
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