Alexey Kardashevskiy <a...@ozlabs.ru> writes:

>          /* compute missing values, prefer sockets over cores over threads */
>          if (cpus == 0 || sockets == 0) {
>              sockets = sockets > 0 ? sockets : 1;
>              cores = cores > 0 ? cores : 1;
> -            threads = threads > 0 ? threads : 1;
> +            if (threads_max) {
> +                if (threads > 0) {
> +                    fprintf(stderr, "Use either threads or threads_max\n");
> +                    exit(1);

If you went ahead with the threads="max" string option you wouldn't need
to check here for mutual excusivity and the user wouldn't need to worry
about an extra command options.

> +                }
> +                threads = smp_threads > 0 ? smp_threads : 1;
> +            } else {
> +                threads = threads > 0 ? threads : 1;
> +            }
>              if (cpus == 0) {
>                  cpus = cores * threads * sockets;
>              }

-- 
Mike Day | "Endurance is a Virtue"

Reply via email to