Cgroups Guide

Cgroups Overview

For a comprehensive description of Linux Control Groups (cgroups) see the cgroups documentation at kernel.org.
Linuxコントロールグループ(cgroups)の包括的な説明については、kernel.orgのcgroupsドキュメントを参照してください。
Detailed knowledge of cgroups is not required to use cgroups in Slurm, but a basic understanding of the following features of cgroups is helpful:
Slurmでcgroupを使用するために、cgroupの詳細な知識は必要ありませんが、cgroupの次の機能の基本的な理解が役立ちます。

  • Cgroup - a container for a set of processes subject to common controls or monitoring, implemented as a directory and a set of files (state objects) in the cgroup virtual filesystem.
    Cgroup-共通の制御または監視の対象となる一連のプロセスのコンテナーであり、cgroup仮想ファイルシステム内のディレクトリおよび一連のファイル(状態オブジェクト)として実装されます。
  • Subsystem - a module, typically a resource controller, that applies a set of parameters to the cgroups in a hierarchy.
    サブシステム-階層内のcgroupにパラメーターのセットを適用するモジュール(通常はリソースコントローラー)。
  • Hierarchy - a set of cgroups organized in a tree structure, with one or more associated subsystems.
    階層-1つ以上のサブシステムが関連付けられた、ツリー構造で編成されたcgroupのセット。
  • State Objects - pseudofiles that represent the state of a cgroup or apply controls to a cgroup:
    状態オブジェクト-cgroupの状態を表す、またはcgroupにコントロールを適用する疑似ファイル:
    • tasks - identifies the processes (PIDs) in the cgroup.
      タスク-cgroup内のプロセス(PID)を識別します。
    • additional state objects specific to each subsystem.
      各サブシステムに固有の追加の状態オブジェクト。

General Usage Notes

  • There can be a serious performance problem with memory cgroups on conventional multi-socket, multi-core nodes in kernels prior to 2.6.38 due to contention between processors for a spinlock.
    2.6.38より前のカーネルの従来のマルチソケット、マルチコアノードのメモリcgroupには、スピンロックのプロセッサ間の競合が原因で、深刻なパフォーマンスの問題が発生する可能性があります。
    This problem seems to have been completely fixed in the 2.6.38 kernel.
    この問題は、2.6.38カーネルで完全に修正されたようです。
  • Debian and derivatives (e.g. Ubuntu) usually exclude the memory and memsw (swap) cgroups by default.
    Debianとその派生物(Ubuntuなど)は通常、デフォルトでメモリとmemsw(スワップ)cgroupを除外します。
    To include them, add the following parameters to the kernel command line:
    それらを含めるには、カーネルコマンドラインに次のパラメータを追加します。
    cgroup_enable=memory swapaccount=1
    This can usually be placed in /etc/default/grub inside the GRUB_CMDLINE_LINUX variable.
    これは通常、GRUB_CMDLINE_LINUX変数内の/ etc / default / grubに配置できます。
    A command such as update-grub must be run after updating the file.
    ファイルを更新した後、update-grubなどのコマンドを実行する必要があります。

Use of Cgroups in Slurm

Slurm provides cgroup versions of a number of plugins.
Slurmは、多数のプラグインのcgroupバージョンを提供します。

  • proctrack (process tracking)
    proctrack(プロセス追跡)
  • task (task management)
    タスク(タスク管理)
  • jobacct_gather (job accounting statistics)
    jobacct_gather(ジョブアカウンティング統計)
  • The cgroup plugins can provide a number of benefits over the other more standard plugins, as described below.
    cgroupプラグインは、以下で説明するように、他のより標準的なプラグインに比べて多くの利点を提供できます。

Slurm also uses cgroups for resource specialization.
Slurmは、リソースの特殊化にもcgroupを使用します。

Slurm Cgroups Configuration Overview

There are several sets of configuration options for Slurm cgroups:
Slurmcgroupsにはいくつかの構成オプションのセットがあります。

  • slurm.conf provides options to enable the cgroup plugins.
    slurm.confは、cgroupプラグインを有効にするオプションを提供します。
    Each plugin may be enabled or disabled independently of the others.
    各プラグインは、他のプラグインとは独立して有効または無効にできます。
  • cgroup.conf provides general options that are common to all cgroup plugins, plus additional options that apply only to specific plugins.
    cgroup.confは、すべてのcgroupプラグインに共通の一般的なオプションに加えて、特定のプラグインにのみ適用される追加のオプションを提供します。
  • System-level resource specialization is enabled using node configuration parameters.
    システムレベルのリソースの特殊化は、ノード構成パラメーターを使用して有効になります。

Currently Available Cgroup Plugins

proctrack/cgroup plugin

The proctrack/cgroup plugin is an alternative to other proctrack plugins such as proctrack/linux for process tracking and suspend/resume capability.
proctrack / cgroupプラグインは、プロセス追跡および一時停止/再開機能のためのproctrack / linuxなどの他のproctrackプラグインの代替です。
proctrack/cgroup uses the freezer subsystem which is more reliable for tracking and control than proctrack/linux.
proctrack / cgroupは、proctrack / linuxよりも追跡と制御の信頼性が高いフリーザーサブシステムを使用します。

To enable this plugin, configure the following option in slurm.conf:
このプラグインを有効にするには、slurm.confで次のオプションを設定します。

ProctrackType=proctrack/cgroup

There are no specific options for this plugin in cgroup.conf, but the general options apply.
cgroup.confにはこのプラグインの特定のオプションはありませんが、一般的なオプションが適用されます。
See the cgroup.conf man page for details.
詳細については、cgroup.confのmanページを参照してください。

task/cgroup plugin

The task/cgroup plugin is an alternative to other task plugins such as the task/affinity plugin for task management.
task / cgroupプラグインは、タスク管理用のtask / affinityプラグインなどの他のタスクプラグインの代替です。
task/cgroup provides the following features:
task / cgroupは次の機能を提供します。

  • The ability to confine jobs and steps to their allocated cpuset.
    ジョブとステップを割り当てられたcpusetに制限する機能。
  • The ability to bind tasks to sockets, cores and threads within their step's allocated cpuset on a node.
    ノード上でステップに割り当てられたcpuset内のソケット、コア、およびスレッドにタスクをバインドする機能。
    • Supports block and cyclic distribution of allocated cpus to tasks for binding.
      バインド用のタスクへの割り当てられたCPUのブロックおよび循環配布をサポートします。
  • The ability to confine jobs and steps to specific memory resources.
    ジョブとステップを特定のメモリリソースに限定する機能。
  • The ability to confine jobs to their allocated set of generic resources (gres devices).
    割り当てられた汎用リソースのセット(gresデバイス)にジョブを制限する機能。

The task/cgroup plugin uses the cpuset, memory and devices subsystems.
task / cgroupプラグインは、cpuset、メモリ、およびデバイスのサブシステムを使用します。

To enable this plugin, configure the following option in slurm.conf:
このプラグインを有効にするには、slurm.confで次のオプションを設定します。

TaskPlugin=task/cgroup

There are many specific options for this plugin in cgroup.conf.
cgroup.confには、このプラグインに固有のオプションが多数あります。
The general options also apply.
一般的なオプションも適用されます。
See the cgroup.conf man page for details.
詳細については、cgroup.confのmanページを参照してください。

jobacct_gather/cgroup plugin

The jobacct_gather/cgroup plugin is an alternative to the jobacct_gather/linux plugin for the collection of accounting statistics for jobs, steps and tasks.
jobacct_gather / cgroupプラグインは、ジョブ、ステップ、およびタスクのアカウンティング統計を収集するためのjobacct_gather / linuxプラグインの代替です。
jobacct_gather/cgroup uses the cpuacct, memory and blkio subsystems.
jobacct_gather / cgroupは、cpuacct、memory、およびblkioサブシステムを使用します。
Note: the cpu and memory statistics collected by this plugin do not represent the same resources as the cpu and memory statistics collected by the jobacct_gather/linux plugin (sourced from /proc stat).
注:このプラグインによって収集されたCPUとメモリの統計は、jobacct_gather / linuxプラグイン(/ proc statから取得)によって収集されたCPUとメモリの統計と同じリソースを表していません。
While originally thought to be faster, in practice it has been proven to be slower than the jobacct_gather/linux plugin.
当初は高速であると考えられていましたが、実際には、jobacct_gather / linuxプラグインよりも低速であることが証明されています。

To enable this plugin, configure the following option in slurm.conf:
このプラグインを有効にするには、slurm.confで次のオプションを設定します。

JobacctGatherType=jobacct_gather/cgroup

There are no specific options for this plugin in cgroup.conf, but the general options apply.
cgroup.confにはこのプラグインの特定のオプションはありませんが、一般的なオプションが適用されます。
See the cgroup.conf man page for details.
詳細については、cgroup.confのmanページを参照してください。

Use of Cgroups for Resource Specialization

Resource Specialization may be used to reserve a subset of cores on each compute node for exclusive use.
リソーススペシャライゼーションを使用して、各計算ノードのコアのサブセットを排他的に予約することができます。
Slurm compute node daemons (slurmd, slurmstepd).
Slurm計算ノードデーモン(slurmd、slurmstepd)。
It may also be used to apply a real memory limit to the daemons.
また、デーモンに実際のメモリ制限を適用するために使用することもできます。
The daemons are confined to the reserved cores using a special system cgroup in the cpuset hierarchy.
デーモンは、cpuset階層の特別なシステムcgroupを使用して、予約済みコアに限定されます。
The memory limit is enforced using a system cgroup in the memory hierarchy.
メモリ制限は、メモリ階層のシステムcgroupを使用して適用されます。
System-level resource specialization is enabled with special node configuration parameters in slurm.conf and core specialization in core_spec.html.
システムレベルのリソーススペシャライゼーションは、slurm.confの特別なノード構成パラメーターとcore_spec.htmlのコアスペシャライゼーションで有効になります。

Organization of Slurm Cgroups

Slurm cgroups are organized as follows.
Slurmcgroupsは次のように構成されています。
A base directory (mount point) is created at /sys/fs/cgroup, or as configured by the CgroupMountpoint option in cgroup.conf.
ベースディレクトリ(マウントポイント)は、/ sys / fs / cgroupに作成されるか、cgroup.confのCgroupMountpointオプションで構成されます。
All cgroup hierarchies are created below this base directory.
すべてのcgroup階層は、このベースディレクトリの下に作成されます。
A separate hierarchy is created for each cgroup subsystem in use.
使用中のcgroupサブシステムごとに個別の階層が作成されます。
The name of the root cgroup in each hierarchy is the subsystem name.
各階層のルートcgroupの名前は、サブシステム名です。
A cgroup named slurm is created below the root cgroup in each hierarchy.
slurmという名前のcgroupは、各階層のルートcgroupの下に作成されます。
Below each slurm cgroup, cgroups for Slurm users, jobs, steps and tasks are created dynamically as needed.
各slurmcgroupの下に、Slurmユーザー、ジョブ、ステップ、およびタスクのcgroupが必要に応じて動的に作成されます。
The names of these cgroups consist of a prefix identifying the Slurm entity (user, job, step or task), followed by the relevant numeric id.
これらのcgroupの名前は、Slurmエンティティ(ユーザー、ジョブ、ステップ、またはタスク)を識別するプレフィックスと、それに続く関連する数値IDで構成されます。
The following example shows the path of the task cgroup in the cpuset hierarchy for taskid#2 of stepid#0 of jobid#123 for userid#100, using the default base directory (/sys/fs/cgroup):
次の例は、デフォルトのベースディレクトリ(/ sys / fs / cgroup)を使用して、userid#100のjobid#123のstepid#0のtaskid#2のcpuset階層内のタスクcgroupのパスを示しています。

/cgroup/cpuset/slurm/uid_100/job_123/step_0/task_2

If resource specialization is configured, a special system cgroup is created below the slurm cgroup in the cpuset and memory hierarchies:
リソースの特殊化が構成されている場合、特別なシステムcgroupがcpusetおよびメモリ階層のslurmcgroupの下に作成されます。

/sys/fs/cgroup/cpuset/slurm/system
/sys/fs/cgroup/memory/slurm/system

Note that all these structures apply to a specific compute node.
これらの構造はすべて、特定の計算ノードに適用されることに注意してください。
Jobs that use more than one node will have a cgroup structure on each node.
複数のノードを使用するジョブは、各ノードにcgroup構造を持ちます。

Last modified 7 November 2017