Adding options to control scheduler multi-threading
Background/motivation: We are adding multi-threading to the scheduler. To that extent, I got feedback to add a manual, admin lever to control the number of threads that the scheduler will launch.
Pull request: https://github.com/PBSPro/pbspro/pull/1228
Forum discussion: http://community.pbspro.org/t/new-sched-attribute-to-control-scheduler-multi-threading/1737
Interface changes:
- New pbs_sched option '-t':
- legal values: numeric >= 1.
- Will be the total number of threads that the scheduler will create. If value is 1, then no new threads will be created, i.e - the main thread will run everything serially.
- The scheduler will cap the number of threads at the core count value, even if the admin provides a number greater than that.
- Can be set to different values for different scheduler instances if using multi-sched
- Will be the "max" number of threads that the scheduler will create
- New pbs.conf & environment variable 'PBS_SCHED_THREADS':
- legal values: numeric >= 1.
- Will behave similarly to the pbs_sched -t option.
- When set as an environment variable, PBS_SCHED_THREADS will take precedence over the pbs.conf value
- The command line pbs_sched -t option will take precedence over PBS_SCHED_THREADS (as pbs.conf or environment variable)
- Will apply to all multi-scheds using the same pbs.conf file.
- In the absence of pbs_sched -t & PBS_SCHED_THREADS, multi-threading will be disabled by default.