Slurm Programmer's Guide

Contents

Overview
Plugins
Directory Structure
Documentation
Source Code
Source Code Management
Adding New Modules
Compiling
Configuration
Test Suite
Adding Files and Directories
Tricks of the Trade

Overview

Slurm is an open source, fault-tolerant, and highly scalable cluster management and job scheduling system for large and small Linux clusters. Components include machine status, partition management, job management, scheduling, and stream copy modules. Slurm requires no kernel modifications for it operation and is relatively self-contained.
Slurmは、オープンソースで、フォールトトレラントで、スケーラブルなクラスター管理と、大小のLinuxクラスター向けのジョブスケジューリングシステムです。コンポーネントには、マシンステータス、パーティション管理、ジョブ管理、スケジューリング、およびストリームコピーモジュールが含まれます。Slurmはその操作にカーネルの変更を必要とせず、比較的自己完結型です。

Slurm is written in the C language and uses a GNU autoconf configuration engine. While initially written for Linux, other UNIX-like operating systems should be easy porting targets. Code should adhere to the Linux kernel coding style. (Some components of Slurm have been taken from various sources. Some of these components do not conform to the Linux kernel coding style. However, new code written for Slurm should follow these standards.)
SlurmはC言語で記述され、GNU autoconf構成エンジンを使用します。最初はLinux用に書かれていましたが、他のUNIXライクなオペレーティングシステムは、簡単に移植できるはずです。コードはLinuxカーネルコーディングスタイルに準拠している必要があります。(Slurmの一部のコンポーネントはさまざまなソースから取得されています。これらのコンポーネントの一部はLinuxカーネルコーディングスタイルに準拠していません。ただし、Slurm用に作成された新しいコードはこれらの標準に従う必要があります。)

Plugins

To make the use of different infrastructures possible, Slurm uses a general purpose plugin mechanism. A Slurm plugin is a dynamically linked code object that is loaded explicitly at run time by the Slurm libraries. It provides a customized implementation of a well-defined API connected to tasks such as authentication, interconnect fabric, task scheduling, etc. A set of functions is defined for use by all of the different infrastructures of a particular variety. When a Slurm daemon is initiated, it reads the configuration file to determine which of the available plugins should be used. A plugin developer's guide is available with general information about plugins. Most plugin types also have their own documentation available, such as Slurm Authentication Plugin API and Slurm Job Completion Logging API.
さまざまなインフラストラクチャの使用を可能にするために、Slurmは汎用プラグインメカニズムを使用しています。Slurmプラグインは、Slurmライブラリによって実行時に明示的に読み込まれる動的にリンクされたコードオブジェクトです。認証、インターコネクトファブリック、タスクスケジューリングなどのタスクに接続された明確に定義されたAPIのカスタマイズされた実装を提供します。特定の種類のさまざまなインフラストラクチャのすべてで使用するための一連の関数が定義されています。Slurmデーモンが開始されると、構成ファイルを読み取り、使用可能なプラグインのどれを使用するかを決定します。プラグインに関する一般情報を記載したプラグイン開発者ガイドが利用可能です。ほとんどのプラグインタイプには、Slurm Authentication Plugin APIやSlurm Job Completion Logging APIなどの独自のドキュメントも用意されています。

Directory Structure

The contents of the Slurm directory structure will be described below in increasing detail as the structure is descended. The top level directory contains the scripts and tools required to build the entire Slurm system. It also contains a variety of subdirectories for each type of file.
Slurmディレクトリ構造の内容については、構造が下に行くにつれて以下で詳しく説明します。最上位ディレクトリには、Slurmシステム全体を構築するために必要なスクリプトとツールが含まれています。また、ファイルの種類ごとにさまざまなサブディレクトリが含まれています。

General build tools/files include: acinclude.m4, configure.ac, Makefile.am, Make-rpm.mk, META, README, slurm.spec.in, and the contents of the auxdir directory. autoconf and make commands are used to build and install Slurm in an automated fashion. NOTE: autoconf version 2.52 or higher is required to build Slurm. Execute autoconf -V to check your version number. The build process is described in the README file.
一般的なビルドツール/ファイルには、acinclude.m4、configure.ac、Makefile.am、Make-rpm.mk、META、README、slurm.spec.in、およびauxdirディレクトリの内容が含まれます。autoconfおよびmakeコマンドは、Slurmを自動化された方法でビルドおよびインストールするために使用されます。注:Slurmをビルドするには、autoconfバージョン2.52以降が必要です。autoconf -Vを実行して、バージョン番号を確認します。ビルドプロセスについては、READMEファイルで説明されています。

Copyright and disclaimer information are in the files COPYING and DISCLAIMER. All of the top-level subdirectories are described below.
著作権および免責事項の情報は、COPYINGおよびDISCLAIMERファイルにあります。最上位のすべてのサブディレクトリについて、以下で説明します。

auxdir — Used for building Slurm.
auxdir — Slurmの構築に使用されます。

contribs — Various contributed tools.
contribs —さまざまな寄付ツール。

doc — Documentation including man pages.
doc — manページを含むドキュメント。

etc — Sample configuration files.
etc —サンプル構成ファイル。

slurm — Header files for API use. These files must be installed. Placing these header files in this location makes for better code portability.
slurm — APIが使用するヘッダーファイル。これらのファイルをインストールする必要があります。これらのヘッダーファイルをこの場所に配置すると、コードの移植性が向上します。

src — Contains all source code and header files not in the "slurm" subdirectory described above.
src —上記の「slurm」サブディレクトリにないすべてのソースコードとヘッダーファイルが含まれます。

testsuite — DejaGnu and Expect are used for testing all of its files are here.
testsuite — DejaGnuとExpectがすべてのファイルのテストに使用されています。

Documentation

All of the documentation is in the subdirectory doc. Two directories are of particular interest:
すべてのドキュメントはdocサブディレクトリにあります。2つのディレクトリが特に重要です。

doc/man — contains the man pages for the APIs, configuration file, commands, and daemons.
doc / man — API、設定ファイル、コマンド、およびデーモンのmanページが含まれています。

doc/html — contains the web pages.
doc / html — Webページが含まれています。

Source Code

Functions are divided into several categories, each in its own subdirectory. The details of each directory's contents are provided below. The directories are as follows:
関数はいくつかのカテゴリに分かれており、それぞれが独自のサブディレクトリにあります。各ディレクトリの内容の詳細を以下に示します。ディレクトリは次のとおりです。

api — Application Program Interfaces into the Slurm code. Used to send and get Slurm information from the central manager. These are the functions user applications might utilize.
api — Slurmコードへのアプリケーションプログラムインターフェイス。中央マネージャーからSlurm情報を送信および取得するために使用されます。これらは、ユーザーアプリケーションが利用する可能性のある機能です。

common — General purpose functions for widespread use throughout Slurm.
common — Slurm全体で広く使用するための汎用関数。

database — Various database files that support the accounting storage plugin.
database —会計ストレージプラグインをサポートするさまざまなデータベースファイル。

plugins — Plugin functions for various infrastructures or optional behavior. A separate subdirectory is used for each plugin class:
プラグイン—さまざまなインフラストラクチャまたはオプションの動作のためのプラグイン関数。プラグインクラスごとに個別のサブディレクトリが使用されます。

  • accounting_storage for specifying the type of storage for accounting,
    アカウンティング用のストレージのタイプを指定するaccounting_storage、

  • auth for user authentication,
    ユーザー認証のためのauth、

  • cred for job credential functions,
    職務資格機能のcred、

  • jobacct_gather for job accounting,
    ジョブアカウンティングのjobacct_gather、

  • jobcomp for job completion logging,
    ジョブ完了ロギング用のjobcomp、

  • mpi for MPI support,
    MPIサポートのmpi、

  • priority calculates job priority based on a number of factors including fair-share,
    priorityは、フェアシェアを含むいくつかの要素に基づいてジョブの優先順位を計算します。

  • proctrack for process tracking,
    プロセス追跡用のproctrack、

  • sched for job scheduler,
    ジョブスケジューラのsched、

  • select for a job's node selection,
    ジョブのノード選択のために選択し、

  • switch for switch (interconnect) specific functions,
    スイッチ(相互接続)固有の機能のためのスイッチ

  • task for task affinity to processors,
    プロセッサへのタスクアフィニティのタスク、

  • topology methods for assigning nodes to jobs based on node topology.
    ノードトポロジに基づいてノードをジョブに割り当てるためのトポロジメソッド。

sacct — User command to view accounting information about jobs.
sacct —ジョブに関するアカウンティング情報を表示するユーザーコマンド。

sacctmgr — User and administrator tool to manage accounting.
sacctmgr —アカウンティングを管理するためのユーザーおよび管理者ツール。

salloc — User command to allocate resources for a job.
salloc —ジョブにリソースを割り当てるためのユーザーコマンド。

sattach — User command to attach standard input, output and error files to a running job or job step.
sattach —標準入力、出力、およびエラーファイルを実行中のジョブまたはジョブステップに添付するユーザーコマンド。

sbatch — User command to submit a batch job (script for later execution).
sbatch —バッチジョブを送信するユーザーコマンド(後で実行するためのスクリプト)。

sbcast — User command to broadcast a file to all nodes associated with an existing Slurm job.
sbcast —既存のSlurmジョブに関連付けられているすべてのノードにファイルをブロードキャストするユーザーコマンド。

scancel — User command to cancel (or signal) a job or job step.
scancel —ジョブまたはジョブステップをキャンセル(または通知)するユーザーコマンド。

scontrol — Administrator tool to manage Slurm.
scontrol — Slurmを管理するための管理者ツール。

sinfo — User command to get information on Slurm nodes and partitions.
sinfo — Slurmノードとパーティションに関する情報を取得するユーザーコマンド。

slurmctld — Slurm central manager daemon code.
slurmctld — Slurmセントラルマネージャーデーモンコード。

slurmd — Slurm daemon code to manage the compute server nodes including the execution of user applications.
slurmd —ユーザーアプリケーションの実行を含む計算サーバーノードを管理するためのSlurmデーモンコード。

slurmdbd — Slurm database daemon managing access to the accounting storage database.
slurmdbd —会計ストレージデータベースへのアクセスを管理するSlurmデータベースデーモン。

sprio — User command to see the breakdown of a job's priority calculation when the Multifactor Job Priority plugin is installed.
sprio — Multifactor Job Priorityプラグインがインストールされているときにジョブの優先度計算の詳細を確認するユーザーコマンド。

squeue — User command to get information on Slurm jobs and job steps.
squeue — Slurmジョブとジョブステップに関する情報を取得するユーザーコマンド。

sreport — User command to view various reports about past usage across the enterprise.
sreport —企業全体の過去の使用状況に関するさまざまなレポートを表示するユーザーコマンド。

srun — User command to submit a job, get an allocation, and/or initiation a parallel job step.
srun —ジョブを送信し、割り当てを取得し、並列ジョブステップを開始するユーザーコマンド。

sshare — User command to view shares and usage when the Multifactor Job Priority plugin is installed.
sshare — Multifactor Job Priorityプラグインがインストールされているときに共有と使用状況を表示するユーザーコマンド。

sstat — User command to view detailed statistics about running jobs when a Job Accounting Gather plugin is installed.
sstat — Job Accounting Gatherプラグインがインストールされているときに実行中のジョブに関する詳細な統計を表示するユーザーコマンド。

strigger — User and administrator tool to manage event triggers.
strigger —イベントトリガーを管理するためのユーザーおよび管理者ツール。

sview — User command to view and update node, partition, and job state information.
sview —ノード、パーティション、およびジョブの状態情報を表示および更新するためのユーザーコマンド。

Source Code Management

The latest code is in github: https://github.com/SchedMD/slurm.
最新のコードはgithubにあります:https://github.com/SchedMD/slurm。
Creating your own branch will make it easier to keep it synchronized with our work.
独自のブランチを作成すると、作業との同期を維持しやすくなります。

Adding New Modules

Add the new file name to the Makefile.am file in the appropriate directory. Then execute autoreconf (at the top level of the Slurm source directory). Note that a relatively current version of auotmake is required. The autoreconf program will build Makefile.in files from the Makefile.am files. If any new files need to be installed, update the slurm.spec file to identify the RPM in which the new files should be placed
新しいファイル名を適切なディレクトリのMakefile.amファイルに追加します。次に、autoreconfを実行します(Slurmソースディレクトリの最上位)。auotmakeの比較的現在のバージョンが必要であることに注意してください。autoreconfプログラムはMakefile.amファイルからMakefile.inファイルを構築します。新しいファイルをインストールする必要がある場合は、slurm.specファイルを更新して、新しいファイルを配置するRPMを特定します。

If new directories need to be added, add to the configure.ac file the path to the Makefile to be built in the new directory. In summary:
新しいディレクトリを追加する必要がある場合は、configure.acファイルに、新しいディレクトリに構築するMakefileへのパスを追加します。要約すれば:

autoreconf translates .am files into .in files
autoreconfは.amファイルを.inファイルに変換します

configure tranlates .in files, adding paths and version numbers.
configureは.inファイルを変換し、パスとバージョン番号を追加します。

Compiling

Sending the standard output of "make" to a file makes it easier to see any warning or error messages:
「make」の標準出力をファイルに送信すると、警告メッセージやエラーメッセージが見やすくなります。

"make -j install >make.out"

Configuration

Sample configuration files are included in the etc subdirectory. The slurm.conf can be built using a configuration tool. See doc/man/man5/slurm.conf.5 and the man pages for other configuration files for more details. init.d.slurm is a script that determines which Slurm daemon(s) should execute on any node based upon the configuration file contents. It will also manage these daemons: starting, signaling, restarting, and stopping them.
サンプル設定ファイルは、etcサブディレクトリに含まれています。slurm.confは、構成ツールを使用して構築できます。詳細については、doc / man / man5 / slurm.conf.5およびその他の構成ファイルのマニュアルページを参照してください。init.d.slurmは、構成ファイルの内容に基づいて、任意のノードで実行する必要があるSlurmデーモンを決定するスクリプトです。また、これらのデーモン(開始、シグナリング、再起動、停止)も管理します。

Test Suite

The testsuite files use a DejaGnu framework for testing. These tests are very limited in scope.
testsuiteファイルは、テストにDejaGnuフレームワークを使用します。これらのテストの範囲は非常に限られています。

We also have a set of Expect Slurm tests available under the testsuite/expect directory. These tests are executed after Slurm has been installed and the daemons initiated. About 400 test scripts exercise all Slurm commands and options including stress tests. The file testsuite/expect/globals contains default paths and procedures for all of the individual tests. At the very least, you will need to set the slurm_dir variable to the correct value. To avoid conflicts with other developers, you can override variable settings in a separate file named testsuite/expect/globals.local.
また、testsuite / expectディレクトリの下にあるExpect Slurmテストのセットも利用できます。これらのテストは、Slurmがインストールされ、デーモンが開始された後に実行されます。約400のテストスクリプトは、ストレステストを含むすべてのSlurmコマンドとオプションを実行します。testsuite / expect / globalsファイルには、個々のテストすべてのデフォルトのパスと手順が含まれています。少なくとも、slurm_dir変数を正しい値に設定する必要があります。他の開発者との競合を回避するために、testsuite / expect / globals.localという名前の別のファイルの変数設定をオーバーライドできます。

Set your working directory to testsuite/expect before starting these tests. Tests may be executed individually by name (e.g. test1.1) or the full test suite may be executed with the single command regression.
これらのテストを開始する前に、作業ディレクトリをtestsuite / expectに設定してください。テストは名前で個別に実行できます(例:test1.1)または完全なテストスイートは単一のコマンド回帰で実行できます。
See testsuite/expect/README for more information.
詳細については、testsuite / expect / READMEを参照してください。

Adding Files and Directories

If you are adding files and directories to Slurm, it will be necessary to re-build configuration files before executing the configure command. Update Makefile.am files as needed then execute autoreconf before executing configure.
Slurmにファイルとディレクトリを追加する場合は、configureコマンドを実行する前に構成ファイルを再構築する必要があります。Makefile.amファイルを必要に応じて更新してから、configureを実行する前にautoreconfを実行します。

Tricks of the Trade

HAVE_FRONT_END

You can make a single node appear to Slurm as a Linux cluster by running configure with the --enable-front-end option. This defines HAVE_FRONT_END with a non-zero value in the file config.h. All (fake) nodes should be defined in the slurm.conf file. These nodes should be configured with a single NodeAddr value indicating the node on which single slurmd daemon executes. Initiate one slurmd and one slurmctld daemon. Do not initiate too many simultaneous job steps to avoid overloading the slurmd daemon executing them all.
--enable-front-endオプションを指定してconfigureを実行することにより、単一ノードをLinuxクラスターとしてSlurmに表示させることができます。これは、config.hファイル内のゼロ以外の値でHAVE_FRONT_ENDを定義します。すべての(偽の)ノードは、slurm.confファイルで定義する必要があります。これらのノードは、単一のslurmdデーモンが実行されるノードを示す単一のNodeAddr値で構成する必要があります。1つのslurmdと1つのslurmctldデーモンを開始します。それらをすべて実行するslurmdデーモンの過負荷を回避するために、多くの同時ジョブステップを開始しないでください。

Multiple slurmd support

It is possible to run multiple slurmd daemons on a single node, each using a different port number and NodeName alias. This is very useful for testing networking and protocol changes, or anytime you want to simulate a larger cluster than you really have. The author uses this on his desktop to simulate multiple nodes. However, it is important to note that not all slurm functions will work with multiple slurmd support enabled (e.g. many switch plugins will not work, it is best to use switch/none).
それぞれが異なるポート番号とNodeNameエイリアスを使用して、単一のノードで複数のslurmdデーモンを実行することが可能です。これは、ネットワークとプロトコルの変更をテストする場合、または実際よりも大きなクラスターをシミュレートする場合に非常に役立ちます。著者はこれをデスクトップで使用して、複数のノードをシミュレートします。ただし、すべてのslurm関数が複数のslurmdサポートを有効にしても機能するわけではないことに注意することが重要です(たとえば、多くのスイッチプラグインは機能しないため、switch / noneを使用するのが最適です)。

Multiple support is enabled at configure-time with the "--enable-multiple-slurmd" parameter. This enables a new parameter in the slurm.conf file on the NodeName line, "Port=", and adds a new command line parameter to slurmd, "-N".
「--enable-multiple-slurmd」パラメーターを使用すると、構成時に複数のサポートが有効になります。これにより、NodeName行の "Port ="でslurm.confファイルの新しいパラメーターが有効になり、slurmdに新しいコマンド行パラメーター "-N"が追加されます。

Each slurmd needs to have its own NodeName, and its own TCP port number. Here is an example of the NodeName lines for running three slurmd daemons on each of ten nodes:
各slurmdには、独自のNodeNameと独自のTCPポート番号が必要です。以下は、10個のノードのそれぞれで3つのslurmdデーモンを実行するためのNodeName行の例です。

NodeName=foo[1-10] NodeHostname=host[1-10]  Port=17001
NodeName=foo[11-20] NodeHostname=host[1-10] Port=17002
NodeName=foo[21-30] NodeHostname=host[1-10] Port=17003

It is likely that you will also want to use the "%n" symbol in any slurmd related paths in the slurm.conf file, for instance SlurmdLogFile, SlurmdPidFile, and especially SlurmdSpoolDir. Each slurmd replaces the "%n" with its own NodeName. Here is an example:
slurm.confファイル内のslurmd関連パス、たとえばSlurmdLogFile、SlurmdPidFile、特にSlurmdSpoolDirで「%n」記号を使用することもできます。各slurmdは、「%n」を独自のNodeNameに置き換えます。次に例を示します。

SlurmdLogFile=/var/log/slurm/slurmd.%n.log
SlurmdPidFile=/var/run/slurmd.%n.pid
SlurmdSpoolDir=/var/spool/slurmd.%n

You can manually start each slurmd daemon with the proper NodeName. For example, to start the slurmd daemons for host1 from the above slurm.conf example:
適切なNodeNameを使用して、各slurmdデーモンを手動で開始できます。たとえば、上記のslurm.confの例からhost1のslurmdデーモンを起動するには、次のように入力します。

host1> slurmd -N foo1
host1> slurmd -N foo11
host1> slurmd -N foo21

If you have SysV init scripts, slurmd daemons will automatically be started by whenever MULTIPLE_SLURMD is set to yes in /etc/sysconfig/slurm. If your distribution uses systemd, you may want to use templating feature to define one slurmd.service file and registering each of your virtual nodes within it, for example:
SysV initスクリプトがある場合、/ etc / sysconfig / slurmでMULTIPLE_SLURMDがyesに設定されているときは常にslurmdデーモンが自動的に開始されます。ディストリビューションでsystemdを使用している場合は、テンプレート機能を使用して1つのslurmd.serviceファイルを定義し、その中の各仮想ノードを登録することができます。次に例を示します。

[Unit]
Description=Slurm node daemon
After=network.target munge.service remote-fs.target
ConditionPathExists=/etc/slurm.conf

[Service]
Type=forking
EnvironmentFile=-/etc/sysconfig/slurmd
ExecStart=/usr/sbin/slurmd -N%i $SLURMD_OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
PIDFile=/var/run/slurmd-%i.pid
KillMode=process
LimitNOFILE=51200
LimitMEMLOCK=infinity
LimitSTACK=infinity
Delegate=yes

[Install]
WantedBy=multi-user.target

Then, enabling/managing a service like this (what is %i in the file will be replaced by what is after the @ in the command line):
次に、このようなサービスを有効化/管理します(ファイル内の%iは、コマンドラインの@の後ろに置き換わります):

systemctl enable slurmd@nodeXYZ
systemctl start/stop/restart slurmd@nodeXYZ

Last modified 23 September 2019