CPU Management User and Administrator Guide

Overview

The purpose of this guide is to assist Slurm users and administrators in selecting configuration options and composing command lines to manage the use of CPU resources by jobs, steps and tasks. The document is divided into the following sections:
このガイドの目的は、Slurmユーザーと管理者が構成オプションを選択し、ジョブ、ステップ、タスクによるCPUリソースの使用を管理するコマンドラインを構成するのを支援することです。このドキュメントは、次のセクションに分かれています。

CPU Management through user commands is constrained by the configuration parameters chosen by the Slurm administrator. The interactions between different CPU management options are complex and often difficult to predict. Some experimentation may be required to discover the exact combination of options needed to produce a desired outcome. Users and administrators should refer to the man pages for slurm.conf, cgroup.conf, salloc, sbatch and srun for detailed explanations of each option. The following html documents may also be useful:
ユーザーコマンドによるCPU管理は、Slurm管理者が選択した構成パラメーターによって制約されます。異なるCPU管理オプション間の相互作用は複雑で、予測が難しいことがよくあります。望ましい結果を生み出すために必要なオプションの正確な組み合わせを見つけるには、いくつかの実験が必要になる場合があります。ユーザーと管理者は、各オプションの詳細な説明について、slurm.conf、cgroup.conf、salloc、sbatch、およびsrunのマニュアルページを参照してください。次のhtmlドキュメントも役立つ場合があります。

Consumable Resources in Slurm
Sharing Consumable Resources
Support for Multi-core/Multi-thread Architectures
Plane distribution

This document describes Slurm CPU management for conventional Linux clusters only. For information on Cray ALPS systems, please refer to the appropriate documents.


このドキュメントでは、従来のLinuxクラスターのみのSlurm CPU管理について説明します。Cray ALPSシステムの詳細については、該当するドキュメントを参照してください。

CPU Management Steps performed by Slurm

Slurm uses four basic steps to manage CPU resources for a job/step:
Slurmは4つの基本的なステップを使用して、ジョブ/ステップのCPUリソースを管理します。

Step 1: Selection of Nodes

In Step 1, Slurm selects the set of nodes from which CPU resources are to be allocated to a job or job step. Node selection is therefore influenced by many of the configuration and command line options that control the allocation of CPUs (Step 2 below). If SelectType=select/linear is configured, all resources on the selected nodes will be allocated to the job/step. If SelectType=select/cons_res is configured, individual sockets, cores and threads may be allocated from the selected nodes as consumable resources. The consumable resource type is defined by SelectTypeParameters.
ステップ1で、Slurmは、CPUリソースがジョブまたはジョブステップに割り当てられるノードのセットを選択します。したがって、ノードの選択は、CPUの割り当てを制御する多くの構成およびコマンドラインオプションの影響を受けます(以下のステップ2)。SelectType = select / linearが構成されている場合、選択したノードのすべてのリソースがジョブ/ステップに割り当てられます。SelectType = select / cons_resが設定されている場合、個々のソケット、コア、およびスレッドが、選択したノードから消費可能なリソースとして割り当てられます。消費可能なリソースタイプは、SelectTypeParametersによって定義されます。


Step 1 is performed by slurmctld and the select plugin.
ステップ1は、slurmctldと選択プラグインによって実行されます。

slurm.conf options that control Step 1

slurm.conf parameter

Possible values

Description

NodeName

<name of the node>

Plus additional parameters. See man page for details.
さらに追加のパラメーター。詳細については、manページを参照してください。

Defines a node. This includes the number and layout of boards, sockets, cores, threads and processors (logical CPUs) on the node.
ノードを定義します。これには、ノード上のボード、ソケット、コア、スレッド、およびプロセッサー(論理CPU)の数とレイアウトが含まれます。

PartitionName

<name of the partition>

Plus additional parameters. See man page for details.
さらに追加のパラメーター。詳細については、manページを参照してください。

Defines a partition. Several parameters of the partition definition affect the selection of nodes (e.g., Nodes, OverSubscribe, MaxNodes)
パーティションを定義します。パーティション定義のいくつかのパラメーターは、ノードの選択に影響します(例:Nodes、OverSubscribe、MaxNodes)

SlurmdParameters

config_overrides

Controls how the information in a node definition is used.
ノード定義の情報の使用方法を制御します。

SelectType

select/linear | select/cons_res

Controls whether CPU resources are allocated to jobs and job steps in units of whole nodes or as consumable resources (sockets, cores or threads).
CPUリソースをノード全体の単位でジョブとジョブステップに割り当てるか、消費可能なリソース(ソケット、コア、スレッド)として割り当てるかを制御します。

SelectTypeParameters

CR_CPU | CR_CPU_Memory | CR_Core | CR_Core_Memory | CR_Socket | CR_Socket_Memory

Plus additional options. See man page for details.

Defines the consumable resource type and controls other aspects of CPU resource allocation by the select plugin.
消費可能なリソースタイプを定義し、selectプラグインによるCPUリソース割り当ての他の側面を制御します。


srun/salloc/sbatch command line options that control Step 1

Command line option

Possible values

Description

-B, --extra-node-info

<sockets[:cores[:threads]]>

Restricts node selection to nodes with a specified layout of sockets, cores and threads.
ノードの選択を、指定されたソケット、コア、スレッドのレイアウトを持つノードに制限します。

-C, --constraint

<list>

Restricts node selection to nodes with specified attributes
ノードの選択を指定された属性のノードに制限します

--contiguous

N/A

Restricts node selection to contiguous nodes
ノードの選択を隣接ノードに制限します

--cores-per-socket

<cores>

Restricts node selection to nodes with at least the specified number of cores per socket
ノードの選択を、ソケットごとに指定されたコア数以上のノードに制限します

-c, --cpus-per-task

<ncpus>

Controls the number of CPUs allocated per task
タスクごとに割り当てられるCPUの数を制御します

--exclusive

N/A

Prevents sharing of allocated nodes with other jobs. Suballocates CPUs to job steps.
割り当てられたノードが他のジョブと共有されるのを防ぎます。CPUをジョブステップにサブ割り当てします。

-F, --nodefile

<node file>

File containing a list of specific nodes to be selected for the job (salloc and sbatch only)
ジョブ用に選択される特定のノードのリストを含むファイル(sallocおよびsbatchのみ)

--hint

compute_bound | memory_bound | [no]multithread

Additional controls on allocation of CPU resources
CPUリソースの割り当てに関する追加の制御

--mincpus

<n>

Controls the minimum number of CPUs allocated per node
ノードごとに割り当てられるCPUの最小数を制御します

-N, --nodes

<minnodes[-maxnodes]>

Controls the minimum/maximum number of nodes allocated to the job
ジョブに割り当てられるノードの最小/最大数を制御します

-n, --ntasks

<number>

Controls the number of tasks to be created for the job
ジョブに対して作成されるタスクの数を制御します

--ntasks-per-core

<number>

Controls the maximum number of tasks per allocated core
割り当てられたコアごとのタスクの最大数を制御します

--ntasks-per-socket

<number>

Controls the maximum number of tasks per allocated socket
割り当てられたソケットごとのタスクの最大数を制御します

--ntasks-per-node

<number>

Controls the maximum number of tasks per allocated node
割り当てられたノードごとのタスクの最大数を制御します

-O, --overcommit

N/A

Allows fewer CPUs to be allocated than the number of tasks
タスクの数より少ないCPUを割り当てることができます

-p, --partition

<partition_names>

Controls which partition is used for the job
ジョブに使用するパーティションを制御します

-s, --oversubscribe

N/A

Allows sharing of allocated nodes with other jobs
割り当てられたノードを他のジョブと共有できます

--sockets-per-node

<sockets>

Restricts node selection to nodes with at least the specified number of sockets
ノードの選択を、指定された数以上のソケットを持つノードに制限します

--threads-per-core

<threads>

Restricts node selection to nodes with at least the specified number of threads per core
ノードの選択を、コアあたり少なくとも指定されたスレッド数のノードに制限します

-w, --nodelist

<host1,host2,... or filename>

List of specific nodes to be allocated to the job
ジョブに割り当てられる特定のノードのリスト

-x, --exclude

<host1,host2,... or filename>

List of specific nodes to be excluded from allocation to the job
ジョブへの割り当てから除外される特定のノードのリスト

-Z, --no-allocate

N/A

Bypass normal allocation (privileged option available to users “SlurmUser” and “root” only)
通常の割り当てをバイパスします(ユーザー「SlurmUser」と「root」のみが使用できる特権オプション)


Step 2: Allocation of CPUs from the selected Nodes

In Step 2, Slurm allocates CPU resources to a job/step from the set of nodes selected in Step 1. CPU allocation is therefore influenced by the configuration and command line options that relate to node selection. If SelectType=select/linear is configured, all resources on the selected nodes will be allocated to the job/step. If SelectType=select/cons_res is configured, individual sockets, cores and threads may be allocated from the selected nodes as consumable resources. The consumable resource type is defined by SelectTypeParameters.
ステップ2では、Slurmは、ステップ1で選択されたノードのセットからジョブ/ステップにCPUリソースを割り当てます。したがって、CPU割り当ては、ノード選択に関連する構成とコマンドラインオプションの影響を受けます。SelectType = select / linearが構成されている場合、選択したノードのすべてのリソースがジョブ/ステップに割り当てられます。SelectType = select / cons_resが設定されている場合、個々のソケット、コア、およびスレッドが、選択したノードから消費可能なリソースとして割り当てられます。消費可能なリソースタイプは、SelectTypeParametersによって定義されます。

When using SelectType=select/cons_res, the default allocation method across nodes is block allocation (allocate all available CPUs in a node before using another node). The default allocation method within a node is cyclic allocation (allocate available CPUs in a round-robin fashion across the sockets within a node). Users may override the default behavior using the appropriate command line options described below. The choice of allocation methods may influence which specific CPUs are allocated to the job/step.
SelectType = select / cons_resを使用する場合、ノード間のデフォルトの割り当て方法はブロック割り当てです(ノードで使用可能なすべてのCPUを割り当ててから、別のノードを使用します)。ノード内のデフォルトの割り当て方法は循環割り当てです(ノード内のソケット間でラウンドロビン方式で使用可能なCPUを割り当てます)。ユーザーは、以下で説明する適切なコマンドラインオプションを使用してデフォルトの動作を上書きできます。割り当て方法の選択は、ジョブ/ステップに割り当てられる特定のCPUに影響を与える可能性があります。


Step 2 is performed by slurmctld and the select plugin.
ステップ2は、slurmctldと選択プラグインによって実行されます。

slurm.conf options that control Step 2

slurm.conf parameter

Possible values

Description

NodeName

<name of the node>

Plus additional parameters. See man page for details.
さらに追加のパラメーター。詳細については、manページを参照してください。

Defines a node. This includes the number and layout of boards, sockets, cores, threads and processors (logical CPUs) on the node.
ノードを定義します。これには、ノード上のボード、ソケット、コア、スレッド、およびプロセッサー(論理CPU)の数とレイアウトが含まれます。

PartitionName

<name of the partition>

Plus additional parameters. See man page for details.
さらに追加のパラメーター。詳細については、manページを参照してください。

Defines a partition. Several parameters of the partition definition affect the allocation of CPU resources to jobs (e.g., Nodes, OverSubscribe, MaxNodes)
パーティションを定義します。パーティション定義のいくつかのパラメーターは、ジョブへのCPUリソースの割り当てに影響します(例:ノード、オーバーサブスクライブ、MaxNodes)

SlurmdParameters

config_overrides

Controls how the information in a node definition is used.
ノード定義の情報の使用方法を制御します。

SelectType

select/linear | select/cons_res

Controls whether CPU resources are allocated to jobs and job steps in units of whole nodes or as consumable resources (sockets, cores or threads).
CPUリソースをノード全体の単位でジョブとジョブステップに割り当てるか、消費可能なリソース(ソケット、コア、スレッド)として割り当てるかを制御します。

SelectTypeParameters

CR_CPU | CR_CPU_Memory | CR_Core | CR_Core_Memory | CR_Socket | CR_Socket_Memory

Plus additional options. See man page for details.

Defines the consumable resource type and controls other aspects of CPU resource allocation by the select plugin.
消費可能なリソースタイプを定義し、selectプラグインによるCPUリソース割り当ての他の側面を制御します。


srun/salloc/sbatch command line options that control Step 2

Command line option

Possible values

Description

-B, --extra-node-info

<sockets[:cores[:threads]]>

Restricts node selection to nodes with a specified layout of sockets, cores and threads.
ノードの選択を、指定されたソケット、コア、スレッドのレイアウトを持つノードに制限します。

-C, --constraint

<list>

Restricts node selection to nodes with specified attributes
ノードの選択を指定された属性のノードに制限します

--contiguous

N/A

Restricts node selection to contiguous nodes
ノードの選択を隣接ノードに制限します

--cores-per-socket

<cores>

Restricts node selection to nodes with at least the specified number of cores per socket
ノードの選択を、ソケットごとに指定されたコア数以上のノードに制限します

-c, --cpus-per-task

<ncpus>

Controls the number of CPUs allocated per task
タスクごとに割り当てられるCPUの数を制御します

--distribution, -m

block|cyclic
|arbitrary|plane=<options>[:block|cyclic]

The second specified distribution (after the ":") can be used to override the default allocation method within nodes
2番目に指定された分布(「:」の後)は、ノード内のデフォルトの割り当て方法をオーバーライドするために使用できます

--exclusive

N/A

Prevents sharing of allocated nodes with other jobs
割り当てられたノードが他のジョブと共有されないようにします

-F, --nodefile

<node file>

File containing a list of specific nodes to be selected for the job (salloc and sbatch only)
ジョブ用に選択される特定のノードのリストを含むファイル(sallocおよびsbatchのみ)

--hint

compute_bound | memory_bound | [no]multithread

Additional controls on allocation of CPU resources
CPUリソースの割り当てに関する追加の制御

--mincpus

<n>

Controls the minimum number of CPUs allocated per node
ノードごとに割り当てられるCPUの最小数を制御します

-N, --nodes

<minnodes[-maxnodes]>

Controls the minimum/maximum number of nodes allocated to the job
ジョブに割り当てられるノードの最小/最大数を制御します

-n, --ntasks

<number>

Controls the number of tasks to be created for the job
ジョブに対して作成されるタスクの数を制御します

--ntasks-per-core

<number>

Controls the maximum number of tasks per allocated core
割り当てられたコアごとのタスクの最大数を制御します

--ntasks-per-socket

<number>

Controls the maximum number of tasks per allocated socket
割り当てられたソケットごとのタスクの最大数を制御します

--ntasks-per-node

<number>

Controls the maximum number of tasks per allocated node
割り当てられたノードごとのタスクの最大数を制御します

-O, --overcommit

N/A

Allows fewer CPUs to be allocated than the number of tasks
タスクの数より少ないCPUを割り当てることができます

-p, --partition

<partition_names>

Controls which partition is used for the job
ジョブに使用するパーティションを制御します

-s, --oversubscribe

N/A

Allows sharing of allocated nodes with other jobs
割り当てられたノードを他のジョブと共有できます

--sockets-per-node

<sockets>

Restricts node selection to nodes with at least the specified number of sockets
ノードの選択を、指定された数以上のソケットを持つノードに制限します

--threads-per-core

<threads>

Restricts node selection to nodes with at least the specified number of threads per core
ノードの選択を、コアあたり少なくとも指定されたスレッド数のノードに制限します

-w, --nodelist

<host1,host2,... or filename>

List of specific nodes to be allocated to the job
ジョブに割り当てられる特定のノードのリスト

-x, --exclude

<host1,host2,... or filename>

List of specific nodes to be excluded from allocation to the job
ジョブへの割り当てから除外される特定のノードのリスト

-Z, --no-allocate

N/A

Bypass normal allocation (privileged option available to users “SlurmUser” and “root” only)
通常の割り当てをバイパスします(ユーザー「SlurmUser」と「root」のみが使用できる特権オプション)


Step 3: Distribution of Tasks to the selected Nodes

In Step 3, Slurm distributes tasks to the nodes that were selected for the job/step in Step 1. Each task is distributed to only one node, but more than one task may be distributed to each node. Unless overcommitment of CPUs to tasks is specified for the job, the number of tasks distributed to a node is constrained by the number of CPUs allocated on the node and the number of CPUs per task. If consumable resources is configured, or resource sharing is allowed, tasks from more than one job/step may run on the same node concurrently.
ステップ3では、Slurmはステップ1でジョブ/ステップ用に選択されたノードにタスクを分散します。各タスクは1つのノードにのみ分散されますが、各ノードに複数のタスクが分散される場合があります。CPUのタスクへのオーバーコミットメントがジョブに指定されていない限り、ノードに分散されるタスクの数は、ノードに割り当てられたCPUの数とタスクごとのCPUの数によって制限されます。消費可能なリソースが構成されている場合、またはリソースの共有が許可されている場合、複数のジョブ/ステップのタスクが同じノードで同時に実行されることがあります。


Step 3 is performed by slurmctld.
手順3はslurmctldによって実行されます。

slurm.conf options that control Step 3

slurm.conf parameter

Possible values

Description

MaxTasksPerNode

<number>

Controls the maximum number of tasks that a job step can spawn on a single node
ジョブステップが単一のノードで生成できるタスクの最大数を制御します


srun/salloc/sbatch command line options that control Step 3

Command line option

Possible values

Description

--distribution, -m

block|cyclic
|arbitrary|plane=<options>[:block|cyclic]

The first specified distribution (before the ":") controls the sequence in which tasks are distributed to each of the selected nodes. Note that this option does not affect the number of tasks distributed to each node, but only the sequence of distribution.
最初に指定された分散(「:」の前)は、選択された各ノードにタスクが分散される順序を制御します。このオプションは、各ノードに分散されるタスクの数には影響せず、分散のシーケンスにのみ影響することに注意してください。

--ntasks-per-core

<number>

Controls the maximum number of tasks per allocated core
割り当てられたコアごとのタスクの最大数を制御します

--ntasks-per-socket

<number>

Controls the maximum number of tasks per allocated socket
割り当てられたソケットごとのタスクの最大数を制御します

--ntasks-per-node

<number>

Controls the maximum number of tasks per allocated node
割り当てられたノードごとのタスクの最大数を制御します

-r, --relative

N/A

Controls which node is used for a job step
ジョブステップに使用するノードを制御します


Step 4: Optional Distribution and Binding of Tasks to CPUs within a Node

In optional Step 4, Slurm distributes and binds each task to a specified subset of the allocated CPUs on the node to which the task was distributed in Step 3. Different tasks distributed to the same node may be bound to the same subset of CPUs or to different subsets. This step is known as task affinity or task/CPU binding.
オプションのステップ4では、Slurmは各タスクをステップ3でタスクが分散されたノードに割り当てられたCPUの指定されたサブセットに分散およびバインドします。同じノードに分散された異なるタスクは、同じCPUのサブセットまたは異なるサブセット。このステップは、タスクアフィニティまたはタスク/ CPUバインディングと呼ばれます。


Step 4 is performed by slurmd and the task plugin.
手順4はslurmdとタスクプラグインによって実行されます。

slurm.conf options that control Step 4

slurm.conf parameter

Possible values

Description

TaskPlugin

task/none | task/affinity | task/cgroup

Controls whether this step is enabled and which task plugin to use
このステップを有効にするかどうか、および使用するタスクプラグインを制御します

TaskPluginParam

See man page

For task/affinity, controls the binding unit (sockets, cores or threads) and the binding method (sched or cpusets)
タスク/アフィニティについては、バインディングユニット(ソケット、コア、またはスレッド)およびバインディングメソッド(スケジュールまたはcpusets)を制御します

cgroup.conf options that control Step 4 (task/cgroup plugin only)

cgroup.conf parameter

Possible values

Description

ConstrainCores

yes|no

Controls whether jobs are constrained to their allocated CPUs
ジョブが割り当てられたCPUに制約されるかどうかを制御します

TaskAffinity

yes|no

Controls whether task-to-CPU binding is enabled
タスクとCPUのバインドを有効にするかどうかを制御します


srun/salloc/sbatch command line options that control Step 4

Command line option

Possible values

Description

--cpu-bind

See man page

Controls binding of tasks to CPUs
CPUへのタスクのバインドを制御します

--ntasks-per-core

<number>

Controls the maximum number of tasks per allocated core
割り当てられたコアごとのタスクの最大数を制御します

--distribution, -m

block|cyclic
|arbitrary|plane=<options>[:block|cyclic]

The second specified distribution (after the ":") controls the sequence in which tasks are distributed to allocated CPUs within a node for binding of tasks to CPUs
2番目に指定された配分(「:」の後)は、タスクをCPUにバインドするためにノード内の割り当てられたCPUにタスクが配分される順序を制御します



Additional Notes on CPU Management Steps

For consumable resources, it is important for users to understand the difference between cpu allocation (Step 2) and task affinity/binding (Step 4). Exclusive (unshared) allocation of CPUs as consumable resources limits the number of jobs/steps/tasks that can use a node concurrently. But it does not limit the set of CPUs on the node that each task distributed to the node can use. Unless some form of CPU/task binding is used (e.g., a task or spank plugin), all tasks distributed to a node can use all of the CPUs on the node, including CPUs not allocated to their job/step. This may have unexpected adverse effects on performance, since it allows one job to use CPUs allocated exclusively to another job. For this reason, it may not be advisable to configure consumable resources without also configuring task affinity. Note that task affinity can also be useful when select/linear (whole node allocation) is configured, to improve performance by restricting each task to a particular socket or other subset of CPU resources on a node.
消費可能なリソースの場合、ユーザーはCPU割り当て(ステップ2)とタスクアフィニティ/バインディング(ステップ4)の違いを理解することが重要です。消費可能なリソースとしてのCPUの排他的(非共有)割り当ては、ノードを同時に使用できるジョブ/ステップ/タスクの数を制限します。ただし、ノードに分散された各タスクが使用できるノード上のCPUのセットは制限されません。何らかの形式のCPU /タスクバインディングが使用されていない限り(タスクまたはスパンクプラグインなど)、ノードに分散されたすべてのタスクは、ジョブ/ステップに割り当てられていないCPUを含め、ノード上のすべてのCPUを使用できます。これにより、1つのジョブが別のジョブに排他的に割り当てられたCPUを使用できるようになるため、パフォーマンスに予期しない悪影響を与える可能性があります。このため、タスクアフィニティも構成せずに消費可能なリソースを構成することはお勧めできません。



Getting Information about CPU usage by Jobs/Steps/Tasks

There is no easy way to generate a comprehensive set of CPU management information for a job/step (allocation, distribution and binding). However, several commands/options provide limited information about CPU usage.
ジョブ/ステップ(割り当て、配布、バインド)の包括的なCPU管理情報を生成する簡単な方法はありません。ただし、いくつかのコマンド/オプションは、CPU使用率に関する限られた情報を提供します。

Command/Option

Information

scontrol show job option: --details

This option provides a list of the nodes selected for the job and the CPU ids allocated to the job on each node. Note that the CPU ids reported by this command are Slurm abstract CPU ids, not Linux/hardware CPU ids (as reported by, for example, /proc/cpuinfo).
このオプションは、ジョブ用に選択されたノードのリストと、各ノードのジョブに割り当てられたCPU IDを提供します。このコマンドによって報告されるCPU IDは、Linux /ハードウェアのCPU IDではなく、Slurm抽象CPU IDであることに注意してください(たとえば、/ proc / cpuinfoによって報告されます)。

Linux command: env

Man. Slurm environment variables provide information related to node and CPU usage:
おとこ。Slurm環境変数は、ノードとCPUの使用状況に関する情報を提供します。


SLURM_JOB_CPUS_PER_NODE
SLURM_CPUS_PER_TASK
SLURM_CPU_BIND
SLURM_DISTRIBUTION
SLURM_JOB_NODELIST
SLURM_TASKS_PER_NODE
SLURM_STEP_NODELIST
SLURM_STEP_NUM_NODES
SLURM_STEP_NUM_TASKS
SLURM_STEP_TASKS_PER_NODE
SLURM_JOB_NODES
SLURM_NTASKS
SLURM_NPROCS
SLURM_CPUS_ON_NODE
SLURM_NODEID
SLURMD_NODENAME

srun/salloc/sbatch option: --cpu-bind=verbose

This option provides a list of the CPU masks used by task affinity to bind tasks to CPUs. Note that the CPU ids represented by these masks are Linux/hardware CPU ids, not Slurm abstract CPU ids as reported by scontrol, etc.
このオプションは、タスクをCPUにバインドするためにタスクアフィニティによって使用されるCPUマスクのリストを提供します。これらのマスクによって表されるCPU IDはLinux /ハードウェアCPU IDであり、scontrolなどによって報告されるSlurm抽象CPU IDではないことに注意してください。

srun/salloc/sbatch option: -l

This option adds the task id as a prefix to each line of output from a task sent to stdout/stderr. This can be useful for distinguishing node-related and CPU-related information by task id for multi-task jobs/steps.
このオプションは、stdout / stderrに送信されたタスクからの出力の各行にプレフィックスとしてタスクIDを追加します。これは、マルチタスクジョブ/ステップのタスクIDによってノード関連情報とCPU関連情報を区別するのに役立ちます。

Linux command:
cat /proc/<pid>/status | grep Cpus_allowed_list

Given a task's pid (or "self" if the command is executed by the task itself), this command produces a list of the CPU ids bound to the task. This is the same information that is provided by --cpu-bind=verbose, but in a more readable format.
タスクのpid(またはコマンドがタスク自体によって実行される場合は「self」)を指定すると、このコマンドは、タスクにバインドされているCPU IDのリストを生成します。これは--cpu-bind = verboseで提供される情報と同じですが、より読みやすい形式です。

A Note on CPU Numbering

The number and layout of logical CPUs known to Slurm is described in the node definitions in slurm.conf. This may differ from the physical CPU layout on the actual hardware. For this reason, Slurm generates its own internal, or "abstract", CPU numbers. These numbers may not match the physical, or "machine", CPU numbers known to Linux.
Slurmが認識している論理CPUの数とレイアウトは、slurm.confのノード定義に記述されています。これは、実際のハードウェアの物理CPUレイアウトとは異なる場合があります。このため、Slurmは独自の内部または「抽象」CPU番号を生成します。これらの数値は、Linuxで認識されている物理的な「マシン」CPU番号と一致しない場合があります。


CPU Management and Slurm Accounting

CPU management by Slurm users is subject to limits imposed by Slurm Accounting. Accounting limits may be applied on CPU usage at the level of users, groups and clusters. For details, see the sacctmgr man page.
SlurmユーザーによるCPU管理には、Slurmアカウンティングによって課せられる制限が適用されます。アカウンティング制限は、ユーザー、グループ、およびクラスターのレベルでCPU使用率に適用される場合があります。詳細については、sacctmgrのマニュアルページを参照してください。


CPU Management Examples

The following examples illustrate some scenarios for managing CPU resources using Slurm. Many additional scenarios are possible. In each example, it is assumed that all CPUs on each node are available for allocation.
次の例は、Slurmを使用してCPUリソースを管理するいくつかのシナリオを示しています。多くの追加シナリオが可能です。各例では、各ノードのすべてのCPUが割り当てに使用できると想定しています。


Example Node and Partition Configuration

For these examples, the Slurm cluster contains the following nodes:
これらの例では、Slurmクラスターには次のノードが含まれています。

Nodename

n0

n1

n2

n3

Number of Sockets

2

2

2

2

Number of Cores per Socket

4

4

4

4

Total Number of Cores

8

8

8

8

Number of Threads (CPUs) per Core

1

1

1

2

Total Number of CPUs

8

8

8

16

And the following partitions:

PartitionName

regnodes

hypernode

Nodes

n0 n1 n2

n3

Default

YES

-

These entities are defined in slurm.conf as follows:

Nodename=n0 NodeAddr=node0 Sockets=2 CoresPerSocket=4 ThreadsPerCore=1 Procs=8
Nodename=n1 NodeAddr=node1 Sockets=2 CoresPerSocket=4 ThreadsPerCore=1 Procs=8 State=IDLE
Nodename=n2 NodeAddr=node2 Sockets=2 CoresPerSocket=4 ThreadsPerCore=1 Procs=8 State=IDLE
Nodename=n3 NodeAddr=node3 Sockets=2 CoresPerSocket=4 ThreadsPerCore=2 Procs=16 State=IDLE
PartitionName=regnodes Nodes=n0,n1,n2 OverSubscribe=YES Default=YES State=UP
PartitionName=hypernode Nodes=n3 State=UP

Example 1: Allocation of whole nodes

Allocate a minimum of two whole nodes to a job.
少なくとも2つのノード全体をジョブに割り当てます。

slurm.conf options:

SelectType=select/linear

Command line:

srun --nodes=2 ...

Comments:

The SelectType=select/linear configuration option specifies allocation in units of whole nodes. The --nodes=2 srun option causes Slurm to allocate at least 2 nodes to the job.


SelectType = select / linear構成オプションは、ノード全体の単位で割り当てを指定します。--nodes = 2 srunオプションを指定すると、Slurmは少なくとも2つのノードをジョブに割り当てます。


Example 2: Simple allocation of cores as consumable resources

A job requires 6 CPUs (2 tasks and 3 CPUs per task with no overcommitment). Allocate the 6 CPUs as consumable resources from a single node in the default partition.
ジョブには6つのCPUが必要です(2つのタスク、およびタスクごとに3つのCPU)。6つのCPUを消費可能なリソースとして、デフォルトパーティションの単一ノードから割り当てます。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core

Command line:

srun --nodes=1-1 --ntasks=2 --cpus-per-task=3 ...

Comments:

The SelectType configuration options define cores as consumable resources. The --nodes=1-1 srun option restricts the job to a single node. The following table shows a possible pattern of allocation for this job.
SelectType構成オプションは、コアを消費可能なリソースとして定義します。--nodes = 1-1 srunオプションは、ジョブを単一ノードに制限します。次の表は、このジョブに割り当て可能なパターンを示しています。

Nodename

n0

n1

n2

Number of Allocated CPUs

6

0

0

Number of Tasks

2

0

0


Example 3: Consumable resources with balanced allocation across nodes

A job requires 9 CPUs (3 tasks and 3 CPUs per task with no overcommitment). Allocate 3 CPUs from each of the 3 nodes in the default partition.
ジョブには9個のCPUが必要です(3つのタスク、およびタスクごとに3つのCPU)。デフォルトパーティションの3つのノードのそれぞれから3つのCPUを割り当てます。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core

Command line:

srun --nodes=3-3 --ntasks=3 --cpus-per-task=3 ...

Comments:

The options specify the following conditions for the job: 3 tasks, 3 unique CPUs per task, using exactly 3 nodes. To satisfy these conditions, Slurm must allocate 3 CPUs from each node. The following table shows the allocation for this job.
オプションは、ジョブの次の条件を指定します。3つのタスク、タスクごとに3つの固有CPU、正確に3つのノードを使用。これらの条件を満たすために、Slurmは各ノードから3つのCPUを割り当てる必要があります。次の表は、このジョブの割り当てを示しています。

Nodename

n0

n1

n2

Number of Allocated CPUs

3

3

3

Number of Tasks

1

1

1


Example 4: Consumable resources with minimization of resource fragmentation

A job requires 12 CPUs (12 tasks and 1 CPU per task with no overcommitment). Allocate CPUs using the minimum number of nodes and the minimum number of sockets required for the job in order to minimize fragmentation of allocated/unallocated CPUs in the cluster.
ジョブには12個のCPUが必要です(12個のタスクとタスクごとに1個のCPU)。クラスター内の割り当てられた/割り当てられていないCPUの断片化を最小限に抑えるために、ジョブに必要な最小数のノードと最小数のソケットを使用してCPUを割り当てます。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core,CR_CORE_DEFAULT_DIST_BLOCK

Command line:

srun --ntasks=12 ...

Comments:

The default allocation method across nodes is block. This minimizes the number of nodes used for the job. The configuration option CR_CORE_DEFAULT_DIST_BLOCK sets the default allocation method within a node to block. This minimizes the number of sockets used for the job within a node. The combination of these two methods causes Slurm to allocate the 12 CPUs using the minimum required number of nodes (2 nodes) and sockets (3 sockets).The following table shows a possible pattern of allocation for this job.
ノード間のデフォルトの割り当て方法はブロックです。これにより、ジョブに使用されるノードの数が最小限に抑えられます。構成オプションCR_CORE_DEFAULT_DIST_BLOCKは、ブロックするノード内のデフォルトの割り当て方法を設定します。これにより、ノード内のジョブに使用されるソケットの数が最小限に抑えられます。これら2つの方法を組み合わせると、Slurmは必要な最小数のノード(2ノード)とソケット(3ソケット)を使用して12個のCPUを割り当てます。次の表は、このジョブに割り当てられる可能性のあるパターンを示しています。

Nodename

n0

n1

n2

Socket id

0

1

0

1

0

1

Number of Allocated CPUs

4

4

4

0

0

0

Number of Tasks

8

4

0


Example 5: Consumable resources with cyclic distribution of tasks to nodes

A job requires 12 CPUs (6 tasks and 2 CPUs per task with no overcommitment). Allocate 6 CPUs each from 2 nodes in the default partition. Distribute tasks to nodes cyclically.
ジョブには12個のCPUが必要です(6個のタスクとタスクごとに2個のCPU)。デフォルトパーティションの2つのノードからそれぞれ6つのCPUを割り当てます。タスクを周期的にノードに分散します。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core

Command line:

srun --nodes=2-2 --ntasks-per-node=3 --distribution=cyclic 
--ntasks=6 --cpus-per-task=2 ...

Comments:

The options specify the following conditions for the job: 6 tasks, 2 unique CPUs per task, using exactly 2 nodes, and with 3 tasks per node. To satisfy these conditions, Slurm must allocate 6 CPUs from each of the 2 nodes. The --distribution=cyclic option causes the tasks to be distributed to the nodes in a round-robin fashion. The following table shows a possible pattern of allocation and distribution for this job.
オプションは、ジョブの次の条件を指定します。6つのタスク、タスクごとに2つの一意のCPU、正確に2つのノードを使用、ノードごとに3つのタスク。これらの条件を満たすために、Slurmは2つのノードのそれぞれから6つのCPUを割り当てる必要があります。--distribution = cyclicオプションを使用すると、タスクがラウンドロビン方式でノードに分散されます。次の表は、このジョブの割り当てと配布の可能なパターンを示しています。

Nodename

n0

n1

n2

Number of Allocated CPUs

6

6

0

Number of Tasks

3

3

0

Distribution of Tasks to Nodes, by Task id

0
2
4

1
3
5

-


Example 6: Consumable resources with default allocation and plane distribution of tasks to nodes

A job requires 16 CPUs (8 tasks and 2 CPUs per task with no overcommitment). Use all 3 nodes in the default partition. Distribute tasks to each node in blocks of two in a round-robin fashion.
ジョブには16個のCPUが必要です(8つのタスク、およびタスクごとに2つのCPU)。デフォルトのパーティションで3つのノードすべてを使用します。ラウンドロビン方式で2つのブロックで各ノードにタスクを分散します。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core

Command line:

srun --nodes=3-3 --distribution=plane=2 --ntasks=8 --cpus-per-task=2 ...

Comments:

The options specify the following conditions for the job: 8 tasks, 2 unique CPUs per task, using all 3 nodes in the partition. To satisfy these conditions using the default allocation method across nodes (block), Slurm allocates 8 CPUs from the first node, 6 CPUs from the second node and 2 CPUs from the third node. The --distribution=plane=2 option causes Slurm to distribute tasks in blocks of two to each of the nodes in a round-robin fashion, subject to the number of CPUs allocated on each node. So, for example, only 1 task is distributed to the third node because only 2 CPUs were allocated on that node and each task requires 2 CPUs. The following table shows a possible pattern of allocation and distribution for this job.
オプションは、ジョブの次の条件を指定します。8つのタスク、タスクごとに2つの固有CPU、パーティション内の3つのノードすべてを使用。ノード全体(ブロック)のデフォルトの割り当て方法を使用してこれらの条件を満たすために、Slurmは最初のノードから8 CPU、2番目のノードから6 CPU、3番目のノードから2 CPUを割り当てます。--distribution = plane = 2オプションを指定すると、Slurmは、各ノードに割り当てられたCPUの数に応じて、ラウンドロビン方式で2つのブロックのタスクを各ノードに分散します。したがって、たとえば、3つのノードに割り当てられているCPUは2つだけであり、各タスクに2つのCPUが必要であるため、3つ目のノードには1つのタスクのみが分散されます。次の表は、このジョブの割り当てと配布の可能なパターンを示しています。

Nodename

n0

n1

n2

Number of Allocated CPUs

8

6

2

Number of Tasks

4

3

1

Distribution of Tasks to Nodes, by Task id

0 1
5 6

2 3
7

4


Example 7: Consumable resources with overcommitment of CPUs to tasks

A job has 20 tasks. Run the job in a single node.
ジョブには20のタスクがあります。単一ノードでジョブを実行します。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core

Command line:

srun --nodes=1-1 --ntasks=20 --overcommit ...

Comments:

The --overcommit option allows the job to run in only one node by overcommitting CPUs to tasks.The following table shows a possible pattern of allocation and distribution for this job.
--overcommitオプションを使用すると、CPUをタスクにオーバーコミットすることにより、ジョブを1つのノードのみで実行できます。次の表は、このジョブの割り当てと分散の可能なパターンを示しています。

Nodename

n0

n1

n2

Number of Allocated CPUs

8

0

0

Number of Tasks

20

0

0

Distribution of Tasks to Nodes, by Task id

0 - 19

-

-


Example 8: Consumable resources with resource sharing between jobs

2 jobs each require 6 CPUs (6 tasks per job with no overcommitment). Run both jobs simultaneously in a single node.
2つのジョブにはそれぞれ6つのCPUが必要です(ジョブごとに6つのタスク、オーバーコミットなし)。1つのノードで両方のジョブを同時に実行します。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core

Command line:

srun --nodes=1-1 --nodelist=n0 --ntasks=6 --oversubscribe ...
srun --nodes=1-1 --nodelist=n0 --ntasks=6 --oversubscribe ...

Comments:

The --nodes=1-1 and --nodelist=n0 srun options together restrict both jobs to node n0. The OverSubscribe=YES option in the partition definition plus the --oversubscribe srun option allows the two jobs to oversubscribe CPUs on the node.
--nodes = 1-1および--nodelist = n0 srunオプションを一緒に使用して、両方のジョブをノードn0に制限します。パーティション定義のOverSubscribe = YESオプションと--oversubscribe srunオプションを使用すると、2つのジョブでノード上のCPUをオーバーサブスクライブできます。


Example 9: Consumable resources on multithreaded node, allocating only one thread per core

A job requires 8 CPUs (8 tasks with no overcommitment). Run the job on node n3, allocating only one thread per core.
ジョブには8つのCPUが必要です(8つのタスクでオーバーコミットなし)。ノードn3でジョブを実行し、コアごとに1つのスレッドのみを割り当てます。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_CPU

Command line:

srun --partition=hypernode --ntasks=8 --hint=nomultithread ...

Comments:

The CR_CPU configuration option enables the allocation of only one thread per core. The --hint=nomultithread srun option causes Slurm to allocate only one thread from each core to this job. The following table shows a possible pattern of allocation for this job.
CR_CPU構成オプションは、コアごとに1つのスレッドのみの割り当てを有効にします。--hint = nomultithread srunオプションを使用すると、Slurmは各コアからこのジョブに1つのスレッドのみを割り当てます。次の表は、このジョブに割り当て可能なパターンを示しています。

Nodename

n3

Socket id

0

1

Core id

0

1

2

3

0

1

2

3

CPU id

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Number of Allocated CPUs

4

4

Allocated CPU ids

0 2 4 6

8 10 12 14


Example 10: Consumable resources with task affinity and core binding

A job requires 6 CPUs (6 tasks with no overcommitment). Run the job in a single node in the default partition. Apply core binding to each task.
ジョブには6つのCPUが必要です(オーバーコミットなしの6つのタスク)。デフォルトパーティションの単一ノードでジョブを実行します。各タスクにコアバインディングを適用します。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core
TaskPlugin=task/affinity
TaskPluginParam=sched

Command line:

srun --nodes=1-1 --ntasks=6 --cpu-bind=cores ...

Comments:

Using the default allocation method within nodes (cyclic), Slurm allocates 3 CPUs on each socket of 1 node. Using the default distribution method within nodes (cyclic), Slurm distributes and binds each task to an allocated core in a round-robin fashion across the sockets. The following table shows a possible pattern of allocation, distribution and binding for this job. For example, task id 2 is bound to CPU id 1.
ノード内のデフォルトの割り当て方法(周期的)を使用して、Slurmは1つのノードの各ソケットに3つのCPUを割り当てます。ノード内のデフォルトの分散方法(サイクリック)を使用して、Slurmは各タスクをソケット間でラウンドロビン方式で割り当てられたコアに分散およびバインドします。次の表は、このジョブの割り当て、配布、およびバインドの可能なパターンを示しています。たとえば、タスクID 2はCPU ID 1にバインドされています。

Nodename

n0

Socket id

0

1

Number of Allocated CPUs

3

3

Allocated CPU ids

0 1 2

4 5 6

Binding of Tasks to CPUs

CPU id

0

1

2

3

4

5

6

7

Task id

0

2

4

-

1

3

5

-


Example 11: Consumable resources with task affinity and socket binding, Case 1

A job requires 6 CPUs (6 tasks with no overcommitment). Run the job in a single node in the default partition. Apply socket binding to each task.
ジョブには6つのCPUが必要です(オーバーコミットなしの6つのタスク)。デフォルトパーティションの単一ノードでジョブを実行します。各タスクにソケットバインディングを適用します。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core
TaskPlugin=task/affinity
TaskPluginParam=sched

Command line:

srun --nodes=1-1 --ntasks=6 --cpu-bind=sockets ...

Comments:

Using the default allocation method within nodes (cyclic), Slurm allocates 3 CPUs on each socket of 1 node. Using the default distribution method within nodes (cyclic), Slurm distributes and binds each task to all of the allocated CPUs in one socket in a round-robin fashion across the sockets. The following table shows a possible pattern of allocation, distribution and binding for this job. For example, task ids 1, 3 and 5 are all bound to CPU ids 4, 5 and 6.
ノード内のデフォルトの割り当て方法(周期的)を使用して、Slurmは1つのノードの各ソケットに3つのCPUを割り当てます。ノード内のデフォルトの分散方法(サイクリック)を使用して、Slurmは各タスクを1つのソケットに割り当てられたすべてのCPUにラウンドロビン方式でソケット間で分散およびバインドします。次の表は、このジョブの割り当て、配布、およびバインドの可能なパターンを示しています。たとえば、タスクID 1、3、5はすべてCPU ID 4、5、6にバインドされています。

Nodename

n0

Socket id

0

1

Number of Allocated CPUs

3

3

Allocated CPU ids

0 1 2

4 5 6

Binding of Tasks to CPUs

CPU id

0

1

2

3

4

5

6

7

Task ids

0 2 4

-

1 3 5

-


Example 12: Consumable resources with task affinity and socket binding, Case 2

A job requires 6 CPUs (2 tasks with 3 cpus per task and no overcommitment). Run the job in a single node in the default partition. Allocate cores using the block allocation method. Distribute cores using the block distribution method. Apply socket binding to each task.
ジョブには6つのCPUが必要です(2つのタスクにタスクごとに3 CPUがあり、オーバーコミットはありません)。デフォルトパーティションの単一ノードでジョブを実行します。ブロック割り当て方法を使用してコアを割り当てます。ブロック配布方法を使用してコアを配布します。各タスクにソケットバインディングを適用します。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core,CR_CORE_DEFAULT_DIST_BLOCK
TaskPlugin=task/affinity
TaskPluginParam=sched

Command line:

srun --nodes=1-1 --ntasks=2 --cpus-per-task=3 --cpu-bind=sockets 
--distribution=block:block ...

Comments:

Using the block allocation method, Slurm allocates 4 CPUs on one socket and 2 CPUs on the other socket of one node. Using the block distribution method within nodes, Slurm distributes 3 CPUs to each task. Applying socket binding, Slurm binds each task to all allocated CPUs in all sockets in which the task has a distributed CPU. The following table shows a possible pattern of allocation, distribution and binding for this job. In this example, using the block allocation method CPU ids 0-3 are allocated on socket id 0 and CPU ids 4-5 are allocated on socket id 1. Using the block distribution method, CPU ids 0-2 were distributed to task id 0, and CPU ids 3-5 were distributed to task id 1. Applying socket binding, task id 0 is therefore bound to the allocated CPUs on socket 0, and task id 1 is bound to the allocated CPUs on both sockets.
ブロック割り当て方式を使用して、Slurmは1つのノードの4つのCPUを1つのソケットに、2つのCPUをもう1つのソケットに割り当てます。ノード内のブロック分散方式を使用して、Slurmは3つのCPUを各タスクに分散します。ソケットバインディングを適用すると、Slurmは各タスクを、そのタスクが分散CPUを持つすべてのソケットで割り当てられたすべてのCPUにバインドします。次の表は、このジョブの割り当て、配布、およびバインドの可能なパターンを示しています。この例では、ブロック割り当て方法を使用して、CPU ID 0〜3がソケットID 0に割り当てられ、CPU ID 4〜5がソケットID 1に割り当てられます。ブロック分散方法を使用して、CPU ID 0〜2がタスクID 0に割り当てられました。 、およびCPU ID 3〜5がタスクID 1に配布されました。ソケットバインディングを適用すると、タスクID 0はソケット0の割り当てられたCPUにバインドされ、タスクID 1は両方のソケットの割り当てられたCPUにバインドされます。

Nodename

n0

Socket id

0

1

Number of Allocated CPUs

4

2

Allocated CPU ids

0 1 2 3

4 5

Binding of Tasks to CPUs

CPU id

0

1

2

3

4

5

6

7

Task ids

0 1

1

-


Example 13: Consumable resources with task affinity and socket binding, Case 3

A job requires 6 CPUs (2 tasks with 3 cpus per task and no overcommitment). Run the job in a single node in the default partition. Allocate cores using the block allocation method. Distribute cores using the cyclic distribution method. Apply socket binding to each task.
ジョブには6つのCPUが必要です(2つのタスクにタスクごとに3 CPUがあり、オーバーコミットはありません)。デフォルトパーティションの単一ノードでジョブを実行します。ブロック割り当て方法を使用してコアを割り当てます。循環配布方法を使用してコアを配布します。各タスクにソケットバインディングを適用します。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core,CR_CORE_DEFAULT_DIST_BLOCK
TaskPlugin=task/affinity
TaskPluginParam=sched

Command line:

srun --nodes=1-1 --ntasks=2 --cpus-per-task=3 --cpu-bind=sockets 
--distribution=block:cyclic ...

Comments:

Using the block allocation method, Slurm allocates 4 CPUs on one socket and 2 CPUs on the other socket of one node. Using the cyclic distribution method within nodes, Slurm distributes 3 CPUs to each task. Applying socket binding, Slurm binds each task to all allocated CPUs in all sockets in which the task has a distributed CPU. The following table shows a possible pattern of allocation, distribution and binding for this job. In this example, using the block allocation method CPU ids 0-3 are allocated on socket id 0 and CPU ids 4-5 are allocated on socket id 1. Using the cyclic distribution method, CPU ids 0, 1 and 4 were distributed to task id 0, and CPU ids 2, 3 and 5 were distributed to task id 1. Applying socket binding, both tasks are therefore bound to the allocated CPUs on both sockets.
ブロック割り当て方式を使用して、Slurmは1つのノードの4つのCPUを1つのソケットに、2つのCPUをもう1つのソケットに割り当てます。ノード内の循環分散方式を使用して、Slurmは3つのCPUを各タスクに分散します。ソケットバインディングを適用すると、Slurmは各タスクを、そのタスクが分散CPUを持つすべてのソケットで割り当てられたすべてのCPUにバインドします。次の表は、このジョブの割り当て、配布、およびバインドの可能なパターンを示しています。この例では、ブロック割り当て方法を使用して、CPU ID 0〜3がソケットID 0に割り当てられ、CPU ID 4〜5がソケットID 1に割り当てられます。循環分散方式を使用して、CPU ID 0、1、4がタスクに分散されました。 id 0、およびCPU id 2、3、および5がタスクid 1に配布されました。したがって、ソケットバインディングを適用すると、両方のタスクが両方のソケットに割り当てられたCPUにバインドされます。

Nodename

n0

Socket id

0

1

Number of Allocated CPUs

4

2

Allocated CPU ids

0 1 2 3

4 5

Binding of Tasks to CPUs

CPU id

0

1

2

3

4

5

6

7

Task ids

0 1

0 1

-


Example 14: Consumable resources with task affinity and customized allocation and distribution

A job requires 18 CPUs (18 tasks with no overcommitment). Run the job in the default partition. Allocate 6 CPUs on each node using block allocation within nodes. Use cyclic distribution of tasks to nodes and block distribution of tasks for CPU binding.
ジョブには18個のCPUが必要です(オーバーコミットなしの18個のタスク)。デフォルトのパーティションでジョブを実行します。ノード内のブロック割り当てを使用して、各ノードに6つのCPUを割り当てます。ノードへのタスクの循環分散を使用し、CPUバインディングのためにタスクのブロック分散を使用します。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core,CR_CORE_DEFAULT_DIST_BLOCK
TaskPlugin=task/affinity
TaskPluginParam=sched

Command line:

srun --nodes=3-3 --ntasks=18 --ntasks-per-node=6 
--distribution=cyclic:block --cpu-bind=cores ...

Comments:

This example shows the use of task affinity with customized allocation of CPUs and distribution of tasks across nodes and within nodes for binding. The srun options specify the following conditions for the job: 18 tasks, 1 unique CPU per task, using all 3 nodes in the partition, with 6 tasks per node. The CR_CORE_DEFAULT_DIST_BLOCK configuration option specifies block allocation within nodes. To satisfy these conditions, Slurm allocates 6 CPUs on each node, with 4 CPUs allocated on one socket and 2 CPUs on the other socket. The --distribution=cyclic:block option specifies cyclic distribution of tasks to nodes and block distribution of tasks to CPUs within nodes for binding. The following table shows a possible pattern of allocation, distribution and binding for this job. For example, task id 10 is bound to CPU id 3 on node n1.
この例は、CPUのカスタマイズされた割り当てを使用したタスクアフィニティの使用と、バインドのためのノード間およびノー​​ド内のタスクの分散を示しています。srunオプションは、ジョブの次の条件を指定します。18タスク、タスクごとに1つの固有CPU、パーティション内の3つのノードすべてを使用、ノードごとに6タスク。CR_CORE_DEFAULT_DIST_BLOCK構成オプションは、ノード内のブロック割り当てを指定します。これらの条件を満たすために、Slurmは各ノードに6つのCPUを割り当て、4つのCPUを1つのソケットに割り当て、2つのCPUを他のソケットに割り当てます。--distribution = cyclic:blockオプションは、ノードへのタスクの周期的分散と、バインドのためのノード内のCPUへのタスクのブロック分散を指定します。次の表は、このジョブの割り当て、配布、およびバインドの可能なパターンを示しています。たとえば、タスクID 10はノードn1のCPU ID 3にバインドされています。

Nodename

n0

n1

n2

Socket id

0

1

0

1

0

1

Number of Allocated CPUs

4

2

4

2

4

2

Allocated CPU ids

0 1 2 3 4 5

0 1 2 3 4 5

0 1 2 3 4 5

Number of Tasks

6

6

6

Distribution of Tasks to Nodes, by Task id

0
3
6
9
12
15

1
4
7
10
13
16

2
5
8
11
14
17

Binding of Tasks to CPUs

CPU id

0

1

2

3

4

5

6

7

0

1

2

3

4

5

6

7

0

1

2

3

4

5

6

7

Task id

0

3

6

9

12

15

-

-

1

4

7

10

13

16

-

-

2

5

8

11

14

17

-

-


Example 15: Consumable resources with task affinity to optimize the performance of a multi-task, multi-thread job

A job requires 9 CPUs (3 tasks and 3 CPUs per task with no overcommitment). Run the job in the default partition, managing the CPUs to optimize the performance of the job.
ジョブには9個のCPUが必要です(3つのタスク、およびタスクごとに3つのCPU)。ジョブをデフォルトパーティションで実行し、CPUを管理してジョブのパフォーマンスを最適化します。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core,CR_CORE_DEFAULT_DIST_BLOCK
TaskPlugin=task/affinity
TaskPluginParam=sched

Command line:

srun --ntasks=3 --cpus-per-task=3 --ntasks-per-node=1 --cpu-bind=cores ...

Comments:

To optimize the performance of this job, the user wishes to allocate 3 CPUs from each of 3 sockets and bind each task to the 3 CPUs in a single socket. The SelectTypeParameters configuration option specifies a consumable resource type of cores and block allocation within nodes. The TaskPlugin and TaskPluginParam configuration options enable task affinity. The srun options specify the following conditions for the job: 3 tasks, with 3 unique CPUs per task, with 1 task per node. To satisfy these conditions, Slurm allocates 3 CPUs from one socket in each of the 3 nodes in the default partition. The --cpu-bind=cores option causes Slurm to bind each task to the 3 allocated CPUs on the node to which it is distributed. The following table shows a possible pattern of allocation, distribution and binding for this job. For example, task id 2 is bound to CPU ids 0, 1 and 2 on socket id 0 of node n2.
このジョブのパフォーマンスを最適化するために、ユーザーは3つのソケットのそれぞれから3つのCPUを割り当て、各タスクを1つのソケットの3つのCPUにバインドしたいと考えています。SelectTypeParameters構成オプションは、コアの消費可能なリソースタイプとノード内のブロック割り当てを指定します。TaskPluginおよびTaskPluginParam構成オプションは、タスクアフィニティを有効にします。srunオプションは、ジョブの次の条件を指定します。3つのタスク、タスクごとに3つの固有のCPU、ノードごとに1つのタスク。これらの条件を満たすために、Slurmはデフォルトパーティションの3つのノードのそれぞれにある1つのソケットから3つのCPUを割り当てます。--cpu-bind = coresオプションを指定すると、Slurmは各タスクを、それが配布されているノード上の3つの割り当てられたCPUにバインドします。次の表は、このジョブの割り当て、配布、およびバインドの可能なパターンを示しています。例えば、

Nodename

n0

n1

n2

Socket id

0

1

0

1

0

1

Number of Allocated CPUs

3

0

3

0

3

0

Allocated CPU ids

0 1 2

0 1 2

0 1 2

Number of Tasks

1

1

1

Distribution of Tasks to Nodes, by Task id

0

1

2

Binding of Tasks to CPUs

CPU id

0

1

2

3

4

5

6

7

0

1

2

3

4

5

6

7

0

1

2

3

4

5

6

7

Task id

0

-

1

-

2

--


Example 16: Consumable resources with task cgroup and core binding

A job requires 6 CPUs (6 tasks with no overcommitment). Run the job in a single node in the default partition. Apply core binding to each task using the task/cgroup plugin.
ジョブには6つのCPUが必要です(オーバーコミットなしの6つのタスク)。デフォルトパーティションの単一ノードでジョブを実行します。task / cgroupプラグインを使用して、各タスクにコアバインディングを適用します。

slurm.conf options:

SelectType=select/cons_res
SelectTypeParameters=CR_Core
TaskPlugin=task/cgroup

cgroup.conf options:

ConstrainCores=yes
TaskAffinity=yes

Command line:

srun --nodes=1-1 --ntasks=6 --cpu-bind=cores ...

Comments:

The task/cgroup plugin currently supports only the block method for allocating cores within nodes and distributing tasks to CPUs for binding. The following table shows a possible pattern of allocation, distribution and binding for this job. For example, task id 2 is bound to CPU id 2.
task / cgroupプラグインは現在、ノード内にコアを割り当て、バインディングのためにタスクをCPUに分散するブロックメソッドのみをサポートしています。次の表は、このジョブの割り当て、配布、およびバインドの可能なパターンを示しています。たとえば、タスクID 2はCPU ID 2にバインドされています。

Nodename

n0

Socket id

0

1

Number of Allocated CPUs

4

2

Allocated CPU ids

0 1 2 3

4 5

Binding of Tasks to CPUs

CPU id

0

1

2

3

4

5

6

7

Task id

0

1

2

3

4

5

-

-

Last modified 9 October 2019