Control the Capacity of Taskers: Slots and Cores

The resources of a tasker include SLOTS, SLOTSTOTAL, CORES and CORESTOTAL.

For example, a machine with 8 cores is normally assigned the following resources:

CORESTOTAL#8
The physical number of cores in the machine.
CORES/8
A consumable resource to represent the number of available cores on the tasker.
SLOTSTOTAL#8
The total number of slots available. Most jobs use only 1 slot, although you can submit jobs that request more than 1 slot.
SLOTS/8
A consumable resource indicating the number of available slots in a tasker.

A simple single-threaded job consumes 1 slot and 1 core. A multi-threaded job may consume 2 or more cores, but conventionally it is assumed that each job consumes only 1 slot.

Persistent Capacity Configuration

The tasker capacity is normally configured prior to a tasker starting. Methods are shown below:
  • -capacity or -cpus option to vtk_tasker_define
  • -T or -C option to vovtasker
  • Including SLOTS/N in the tasker resource specification or the vovtasker command line, where N is a positive integer number.

Refer to Tasker Attributes for more details about these methods.

Live Capacity Configuration

The behavior of manually overriding vovtasker cores and capacity has been improved. By default, the capacity follows the core count, but it can also be manually set via the -T option or by defining the SLOTS/N consumable resource via the -r option, where N is a positive integer. In all cases, the capacity directly affects the number of slot licenses that will be requested.

On occasion, it can be useful to change the number of jobs that are allowed to run on a tasker while it is live. For example, if you have an 8-core machine and you only want to run 4 jobs on it, you can configure the tasker on the fly as shown below:
% nc cmd vovtaskermgr configure -resources SLOTS/4 lnx123
Note: For backwards compatibility, the option -capacity in vovtaskermgrconfigure is still supported. This option is a shortcut method of setting SLOTS SLOTSTOTAL CORES and CORESTOTAL all to the same amount.
% nc cmd vovtaskermgr configure -capacity 4 lnx123
is the same as
% nc cmd vovtaskermgr configure -resources "SLOTS/4 SLOTSTOTAL#4 CORES/4 CORESTOTAL#4" lnx123

Refresher: Submit Multi-threaded Jobs

A multi-threaded job consumes more than one core. In a 4-threaded job, a complete submission could look like this:
% nc run -r SLOTS/1 CORES/4 License:abc -- my_mt_job
If it is also important to count the multiple cores towards FairShare, the -fstokens 4 option can be used:
% nc run -r SLOTS/1 CORES/4 License:abc -fstokens 4my_mt_job

Stopped Tasker's Effect on a Newly Started Tasker

When a tasker has been requested to stop gracefully (allowing jobs to finish before exiting), it is suspended from scheduler consideration and its capacity is set to 0. If the same tasker is started on the same host before the stopped tasker exits, the slots consumed by the still-running jobs on the stopped tasker will be counted and deducted from the total slot capacity of the newly started tasker. This helps prevent overloading the machine on which the taskers are running.