Skip to content

Rename option --threads to --processors #107

Merged
merged 2 commits into from Aug 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 5 additions & 11 deletions mxqsub.c
Expand Up @@ -65,7 +65,7 @@ static void print_usage(void)
" Scheduling is done based on the resources a job needs and\n"
" on the priority given to the job.\n"
"\n"
" -j, --threads=NUMBER set number of threads (default: 1)\n"
" -j, --processors=NUMBER set number of processors (default: 1)\n"
" -m, --memory=SIZE set amount of memory (default: 2G)\n"
" --tmpdir=SIZE set size of MXQ_JOB_TMPDIR (default: 0)\n"
" --blacklist=STRING set list of blacklisted servers (default: '')\n"
Expand Down Expand Up @@ -731,9 +731,7 @@ int main(int argc, char *argv[])
MX_OPTION_NO_ARG("help", 'h'),
MX_OPTION_NO_ARG("version", 'V'),

MX_OPTION_REQUIRED_ARG("group_id", 1),
MX_OPTION_REQUIRED_ARG("group_priority", 2),
MX_OPTION_REQUIRED_ARG("group-id", 3),
MX_OPTION_REQUIRED_ARG("time", 4),

MX_OPTION_NO_ARG("debug", 5),
Expand All @@ -756,7 +754,8 @@ int main(int argc, char *argv[])
MX_OPTION_REQUIRED_ARG("umask", 'u'),
MX_OPTION_REQUIRED_ARG("priority", 'p'),

MX_OPTION_REQUIRED_ARG("threads", 'j'),
MX_OPTION_REQUIRED_ARG("threads", 1),
MX_OPTION_REQUIRED_ARG("processors", 'j'),
pmenzel marked this conversation as resolved.
Show resolved Hide resolved
MX_OPTION_REQUIRED_ARG("memory", 'm'),
MX_OPTION_REQUIRED_ARG("runtime", 't'),

Expand Down Expand Up @@ -868,12 +867,6 @@ int main(int argc, char *argv[])
}
break;

case 1:
case 3:
if (opt == 3)
mx_log_warning("option --group-id is deprecated (usage will change in next version). Using --group-name instead.");
else
mx_log_warning("option --group_id is deprecated. Using --group-name instead.");
case 'N':
if (!(*optctl.optarg)) {
mx_log_crit("--group-name '%s': String is empty.", optctl.optarg);
Expand Down Expand Up @@ -904,9 +897,10 @@ int main(int argc, char *argv[])
}
break;

case 1:
case 'j':
if (mx_strtou16(optctl.optarg, &arg_threads) < 0) {
mx_log_crit("--threads '%s': %m", optctl.optarg);
mx_log_crit("--processors '%s': %m", optctl.optarg);
exit(EX_CONFIG);
}
break;
Expand Down