Skip to content

Commit

Permalink
Remove unimplemented restart flags
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed May 9, 2017
1 parent ebc30a7 commit e35abba
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
6 changes: 0 additions & 6 deletions mxq_job.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ struct mxq_job {
#define MXQ_JOB_STATUS_UNKNOWN 999
#define MXQ_JOB_STATUS_FINISHED 1000

#define MXQ_JOB_FLAGS_RESTART_ON_HOSTFAIL (1<<0)
#define MXQ_JOB_FLAGS_REQUEUE_ON_HOSTFAIL (1<<1)

#define MXQ_JOB_FLAGS_AUTORESTART (1<<62)
#define MXQ_JOB_FLAGS_HOSTFAIL (1<<63)

#define _to_string(s) #s
#define status_str(x) _to_string(x)

Expand Down
13 changes: 0 additions & 13 deletions mxqdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,6 @@ static int print_group(struct mxq_group *g)
g->group_name);
}

static char *restart_to_string(uint64_t flags)
{
if (flags & MXQ_JOB_FLAGS_REQUEUE_ON_HOSTFAIL)
return "always";

if (flags & MXQ_JOB_FLAGS_RESTART_ON_HOSTFAIL)
return "samehost";

return "never";
}

static int print_job(struct mxq_group *g, struct mxq_job *j)
{
time_t now;
Expand Down Expand Up @@ -228,7 +217,6 @@ static int print_job(struct mxq_group *g, struct mxq_job *j)
" slots=%u"
" status=%s(%d)"
" stats_status=%u"
" restart=%s"
" workdir=%s"
" command=%s"
"\n",
Expand All @@ -255,7 +243,6 @@ static int print_job(struct mxq_group *g, struct mxq_job *j)
mxq_job_status_to_name(j->job_status),
j->job_status,
j->stats_status,
restart_to_string(j->job_flags),
j->job_workdir,
j->job_argv_str);
}
Expand Down
24 changes: 0 additions & 24 deletions mxqsub.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,6 @@ static void print_usage(void)
" --max-jobs-per-node=NUMBER limit the number of jobs executed on each cluster node\n"
" (default: 0 [limited by the server])\n"
"\n"
"Job handling:\n"
" Define what to do if something bad happens:\n"
"\n"
" -r, --restart[=MODE] restart job on system failure (default: 'never')\n"
"\n"
" available restart [MODE]s:\n"
" 'never' do not restart. (default)\n"
" 'samehost' only restart if running on the same host.\n"
" 'always' always restart or requeue.\n"
"\n"
"Job grouping:\n"
" Grouping is done by default based on the jobs resource\n"
" and priority information, so that jobs using the same\n"
Expand Down Expand Up @@ -749,20 +739,6 @@ int main(int argc, char *argv[])
arg_groupid = 0;
break;

case 'r':
if (!optctl.optarg || mx_streq(optctl.optarg, "always")) {
arg_jobflags |= MXQ_JOB_FLAGS_RESTART_ON_HOSTFAIL;
arg_jobflags |= MXQ_JOB_FLAGS_REQUEUE_ON_HOSTFAIL;
} else if (mx_streq(optctl.optarg, "samehost")) {
arg_jobflags |= MXQ_JOB_FLAGS_RESTART_ON_HOSTFAIL;
} else if (mx_streq(optctl.optarg, "never")) {
arg_jobflags &= ~(MXQ_JOB_FLAGS_RESTART_ON_HOSTFAIL|MXQ_JOB_FLAGS_REQUEUE_ON_HOSTFAIL);
} else {
mx_log_crit("--restart '%s': restartmode unknown.", optctl.optarg);
exit(EX_CONFIG);
}
break;

case 'p':
if (mx_strtou16(optctl.optarg, &arg_priority) < 0) {
mx_log_crit("--priority '%s': %m", optctl.optarg);
Expand Down

0 comments on commit e35abba

Please sign in to comment.