Cores, Slots and CPUs

The History of Cores, Slots and CPUs

In the beginning, Accelerator only had CPUs, the number of central processing units in a system that are known as "processors" in Linux systems. Initially, each single-threaded job required one CPU. A machine with two CPUs could run two single-threaded jobs.

CPU = Processor = 1 single threaded job, which is illustrated below.


Figure 1.

Today, because multi-threaded jobs are now commonly used, Accelerator now distinguishes between slots and cores. The terminology has been updated accordingly.

A CPU may contain many cores; the number of single-threaded jobs that can be run on a machine is related to the number of cores not the number of CPUs. The term "CPU" now indicates the "physical package that contains the cores", which is also known as a "socket".

CPUs become Cores and Slots

In version 2013.03, Accelerator separated cores from slots. Cores refers to the processors in the chip (CPU), while slots refers to the number of jobs running on a machine. For most purposes, there is a 1-to-1 correspondence between slots and cores. A typical single-threaded job requires one slot and one core.


Figure 2.
The following submissions are equivalent:
% nc run sleep 10                                ;# Implicit 
 % nc run -r CORES/1 SLOTS/1 -- sleep 10          ;# Explicit 

For backwards compatibility, the request for CPUs/1 maps directly to cores/1.

The following submissions are equivalent:
% nc run -r CPUS/2 -- myjob             ;# Backwards compatibility
 % nc run -r CORES/2 -- myjob            ;# Correct submission
Slots refers to the number of jobs running on a machine. Two slots are on the machine illustrated below. One slot has three cores (blue): multi-threaded job. One slot has one core (pink): single-threaded job.


Figure 3.

A multi-threaded job takes advantage of multiple cores. To avoid overloading a machine, it is good practice to request the correct number of cores when submitting a job.

Example of good practice:
% nc run -r CORES/4 RAM/8000 License:abc --  my_4_threaded_job

Because each core can run one job and each job takes one "slot", it is also considered good practice to request the same number of slots as cores. However, this is not critical, as this normally does not impact the scheduling of jobs.

Example of better practice:
% nc run -r CORES/4 SLOTS/4 RAM/8000 License:abc -- my_4_threaded_job

Alternative Way to Configure Taskers

An administrator can configure a tasker with any number of cores and slots; jobs can be submitted that request a number of slots that is different from the requested number of cores. This method is recommended only for advanced, experienced users.

Example of starting a tasker with different numbers of slots and cores:
% vovtasker -r "CORES/22 SLOTS/13" -a my_atypical_tasker