Skip to content

Commit

Permalink
Merge pull request #107 from mariux64/rename-option-threads-to-proces…
Browse files Browse the repository at this point in the history
…sors

Rename option --threads to --processors
  • Loading branch information
donald authored Aug 30, 2021
2 parents 5ecc4cf + 32fd00d commit 66aeeb6
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions mxqsub.c
Original file line number Diff line number Diff line change
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'),
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

0 comments on commit 66aeeb6

Please sign in to comment.