Slurm Power Saving Guide

Slurm provides an integrated power saving mechanism for powering down idle nodes.
Slurmは、アイドル状態のノードの電源を切るための統合された省電力メカニズムを提供します。
Nodes that remain idle for a configurable period of time can be placed in a power saving mode, which can reduce power consumption or fully power down the node.
構成可能な期間アイドル状態のままであるノードは、省電力モードにすることができます。これにより、消費電力を削減したり、ノードの電源を完全に切ったりすることができます。
The nodes will be restored to normal operation once work is assigned to them.
作業が割り当てられると、ノードは通常の操作に復元されます。
For example, power saving can be accomplished using a cpufreq governor that can change CPU frequency and voltage (note that the cpufreq driver must be enabled in the Linux kernel configuration).
たとえば、省電力は、CPU周波数と電圧を変更できるcpufreqガバナーを使用して実現できます(Linuxカーネル構成でcpufreqドライバーを有効にする必要があることに注意してください)。
Of particular note, Slurm can power nodes up or down at a configurable rate to prevent rapid changes in power demands.
特に注目すべきは、Slurmは、電力需要の急激な変化を防ぐために、構成可能なレートでノードに電力を供給または電力を供給することができることです。
For example, starting a 1000 node job on an idle cluster could result in an instantaneous surge in power demand of multiple megawatts without Slurm's support to increase power demands in a gradual fashion.
たとえば、アイドル状態のクラスターで1000ノードのジョブを開始すると、Slurmが徐々に電力需要を増やすことをサポートしていなくても、数メガワットの電力需要が瞬時に急増する可能性があります。

Configuration

A great deal of flexibility is offered in terms of when and how idle nodes are put into or removed from power save mode.
アイドル状態のノードを省電力モードに切り替えたり、省電力モードから削除したりするタイミングと方法に関して、非常に柔軟性があります。
Note that the Slurm control daemon, slurmctld, must be restarted to initially enable power saving mode.
最初に省電力モードを有効にするには、Slurm制御デーモンslurmctldを再起動する必要があることに注意してください。
Changes in the configuration parameters (e.g. SuspendTime) will take effect after modifying the slurm.conf configuration file and executing "scontrol reconfig".
構成パラメーター(SuspendTimeなど)の変更は、slurm.conf構成ファイルを変更して「scontrolreconfig」を実行した後に有効になります。
The following configuration parameters are available:
次の構成パラメーターを使用できます。

  • SuspendTime: Nodes becomes eligible for power saving mode after being idle or down for this number of seconds.
    SuspendTime:ノードは、この秒数の間アイドル状態またはダウンした後、省電力モードの対象になります。
    For efficient system utilization, it is recommended that the value of SuspendTime be at least as large as the sum of SuspendTimeout plus ResumeTimeout.
    システムを効率的に使用するには、SuspendTimeの値を少なくともSuspendTimeoutとResumeTimeoutの合計と同じ大きさにすることをお勧めします。
    A negative number disables power saving mode.
    負の数は省電力モードを無効にします。
    The default value is -1 (disabled).
    デフォルト値は-1(無効)です。
  • SuspendRate: Maximum number of nodes to be placed into power saving mode per minute.
    SuspendRate:1分あたりに省電力モードにするノードの最大数。
    A value of zero results in no limits being imposed.
    値がゼロの場合、制限は課されません。
    The default value is 60.
    デフォルト値は60です。
    Use this to prevent rapid drops in power consumption.
    これを使用して、消費電力の急激な低下を防ぎます。
  • ResumeRate: Maximum number of nodes to be removed from power saving mode per minute.
    ResumeRate:1分あたりに省電力モードから削除されるノードの最大数。
    A value of zero results in no limits being imposed.
    値がゼロの場合、制限は課されません。
    The default value is 300.
    デフォルト値は300です。
    Use this to prevent rapid increases in power consumption.
    これを使用して、消費電力の急激な増加を防ぎます。
  • SuspendProgram: Program to be executed to place nodes into power saving mode.
    SuspendProgram:ノードを省電力モードにするために実行されるプログラム。
    The program executes as SlurmUser (as configured in slurm.conf).
    プログラムはSlurmUserとして実行されます(slurm.confで構成されているとおり)。
    The argument to the program will be the names of nodes to be placed into power savings mode (using Slurm's hostlist expression format).
    プログラムへの引数は、省電力モードに配置されるノードの名前になります(Slurmのホストリスト式形式を使用)。
  • ResumeProgram: Program to be executed to remove nodes from power saving mode.
    ResumeProgram:節電モードからノードを削除するために実行されるプログラム。
    The program executes as SlurmUser (as configured in slurm.conf).
    プログラムはSlurmUserとして実行されます(slurm.confで構成されているとおり)。
    The argument to the program will be the names of nodes to be removed from power savings mode (using Slurm's hostlist expression format).
    プログラムへの引数は、省電力モードから削除されるノードの名前になります(Slurmのホストリスト式形式を使用)。
    This program may use the scontrol show node command to ensure that a node has booted and the slurmd daemon started.
    このプログラムは、scontrol show nodeコマンドを使用して、ノードが起動し、slurmdデーモンが起動したことを確認できます。
    If the slurmd daemon fails to respond within the configured SlurmdTimeout value with an updated BootTime, the node will be placed in a DOWN state and the job requesting the node will be requeued.
    slurmdデーモンが構成されたSlurmdTimeout値内で更新されたBootTimeで応答しない場合、ノードはDOWN状態になり、ノードを要求しているジョブが再キューイングされます。
    If the node isn't actually rebooted (i.e. when multiple-slurmd is configured) starting slurmd with "-b" option might be useful.
    ノードが実際に再起動されない場合(つまり、multiple-slurmdが構成されている場合)、「-b」オプションを指定してslurmdを開始すると便利な場合があります。
    For reasons of reliability, ResumeProgram may execute more than once for a node when the slurmctld daemon crashes and is restarted.
    信頼性の理由から、slurmctldデーモンがクラッシュして再起動すると、ResumeProgramがノードに対して複数回実行される場合があります。
  • SuspendTimeout: Maximum time permitted (in second) between when a node suspend request is issued and when the node shutdown is complete.
    SuspendTimeout:ノードの一時停止要求が発行されてからノードのシャットダウンが完了するまでに許可される最大時間(秒単位)。
    At that time the node must ready for a resume request to be issued as needed for new workload.
    その時点で、ノードは、新しいワークロードの必要に応じて再開要求を発行する準備ができている必要があります。
    The default value is 30 seconds.
    デフォルト値は30秒​​です。
  • ResumeTimeout: Maximum time permitted (in seconds) between when a node resume request is issued and when the node is actually available for use.
    ResumeTimeout:ノード再開要求が発行されてからノードが実際に使用可能になるまでに許可される最大時間(秒単位)。
    Nodes which fail to respond in this time frame will be marked DOWN and the jobs scheduled on the node requeued.
    この時間枠内に応答しなかったノードはDOWNとマークされ、ノードでスケジュールされたジョブが再キューイングされます。
    Nodes which reboot after this time frame will be marked DOWN with a reason of "Node unexpectedly rebooted."
    この時間枠の後に再起動するノードは、「ノードが予期せず再起動されました」という理由でDOWNとマークされます。
    The default value is 60 seconds.
    デフォルト値は60秒です。
  • SuspendExcNodes: List of nodes to never place in power saving mode.
    SuspendExcNodes:省電力モードにしないノードのリスト。
    Use Slurm's hostlist expression format.
    Slurmのホストリスト式形式を使用します。
    By default, no nodes are excluded.
    デフォルトでは、除外されるノードはありません。
  • SuspendExcParts: List of partitions with nodes to never place in power saving mode.
    SuspendExcParts:節電モードにしないノードを含むパーティションのリスト。
    Multiple partitions may be specified using a comma separator.
    カンマ区切り文字を使用して、複数のパーティションを指定できます。
    By default, no nodes are excluded.
    デフォルトでは、除外されるノードはありません。
  • BatchStartTimeout: Specifies how long to wait after a batch job start request is issued before we expect the batch job to be running on the compute node.
    BatchStartTimeout:バッチジョブの開始要求が発行されてから、バッチジョブが計算ノードで実行されると予想されるまでの待機時間を指定します。
    Depending upon how nodes are returned to service, this value may need to be increased above its default value of 10 seconds.
    ノードをサービスに戻す方法によっては、この値をデフォルト値の10秒よりも大きくする必要がある場合があります。

Note that SuspendProgram and ResumeProgram execute as SlurmUser on the node where the slurmctld daemon runs (primary and backup server nodes).
SuspendProgramとResumeProgramは、slurmctldデーモンが実行されるノード(プライマリサーバーノードとバックアップサーバーノード)でSlurmUserとして実行されることに注意してください。
Use of sudo may be required for SlurmUserto power down and restart nodes.
SlurmUserがノードの電源を切って再起動するには、sudoの使用が必要になる場合があります。
If you need to convert Slurm's hostlist expression into individual node names, the scontrol show hostnames command may prove useful.
Slurmのホストリスト式を個々のノード名に変換する必要がある場合は、scontrol showhostnamesコマンドが役立つ場合があります。
The commands used to boot or shut down nodes will depend upon your cluster management tools.
ノードの起動またはシャットダウンに使用されるコマンドは、クラスター管理ツールによって異なります。

Note that SuspendProgram and ResumeProgram are not subject to any time limits.
SuspendProgramとResumeProgramには時間制限がないことに注意してください。
They should perform the required action, ideally verify the action (e.g. node boot and start the slurmd daemon, thus the node is no longer non-responsive to slurmctld) and terminate.
彼らは必要なアクションを実行し、理想的にはアクションを検証し(たとえば、ノードの起動とslurmdデーモンの開始、したがってノードはslurmctldに応答しなくなります)、終了する必要があります。
Long running programs will be logged by slurmctld, but not aborted.
長時間実行されているプログラムはslurmctldによってログに記録されますが、中止されません。

Also note that the stderr/out of the suspend and resume programs are not logged.
また、サスペンドおよびレジュームプログラムのstderr / outはログに記録されないことに注意してください。
If logging is desired it should be added to the scripts.
ロギングが必要な場合は、スクリプトに追加する必要があります。

#!/bin/bash
# Example SuspendProgram
echo "`date` Suspend invoked $0 $*" >>/var/log/power_save.log
hosts=`scontrol show hostnames $1`
for host in $hosts
do
   sudo node_shutdown $host
done

#!/bin/bash
# Example ResumeProgram
echo "`date` Resume invoked $0 $*" >>/var/log/power_save.log
hosts=`scontrol show hostnames $1`
for host in $hosts
do
   sudo node_startup $host
done

Subject to the various rates, limits and exclusions, the power save code follows this logic:
さまざまなレート、制限、および除外を条件として、省電力コードは次のロジックに従います。

  1. Identify nodes which have been idle for at least SuspendTime.
    少なくともSuspendTimeの間アイドル状態になっているノードを特定します。
  2. Execute SuspendProgram with an argument of the idle node names.
    アイドルノード名の引数を指定してSuspendProgramを実行します。
  3. Identify the nodes which are in power save mode (a flag in the node's state field), but have been allocated to jobs.
    省電力モード(ノードの状態フィールドのフラグ)にあるが、ジョブに割り当てられているノードを識別します。
  4. Execute ResumeProgram with an argument of the allocated node names.
    割り当てられたノード名の引数を指定してResumeProgramを実行します。
  5. Once the slurmd responds, initiate the job and/or job steps allocated to it.
    slurmdが応答したら、それに割り当てられたジョブまたはジョブステップ、あるいはその両方を開始します。
  6. If the slurmd fails to respond within the value configured for SlurmdTimeout, the node will be marked DOWN and the job requeued if possible.
    slurmdがSlurmdTimeoutに設定された値内で応答しない場合、ノードはDOWNとマークされ、可能であればジョブは再キューイングされます。
  7. Repeat indefinitely.
    無期限に繰り返します。

The slurmctld daemon will periodically (every 10 minutes) log how many nodes are in power save mode using messages of this sort:
slurmctldデーモンは、次の種類のメッセージを使用して、省電力モードになっているノードの数を定期的に(10分ごとに)ログに記録します。

[May 02 15:31:25] Power save mode 0 nodes
...
[May 02 15:41:26] Power save mode 10 nodes
...
[May 02 15:51:28] Power save mode 22 nodes

Using these logs you can easily see the effect of Slurm's power saving support.
これらのログを使用すると、Slurmの省電力サポートの効果を簡単に確認できます。
You can also configure Slurm with programs that perform no action as SuspendProgram and ResumeProgram to assess the potential impact of power saving mode before enabling it.
また、SuspendProgramおよびResumeProgramとしてアクションを実行しないプログラムを使用してSlurmを構成し、省電力モードを有効にする前にその潜在的な影響を評価することもできます。

Use of Allocations

A resource allocation request will be granted as soon as resources are selected for use, possibly before the nodes are all available for use.
リソース割り当て要求は、リソースが使用可能になるとすぐに、場合によってはノードがすべて使用可能になる前に許可されます。
The launching of job steps will be delayed until the required nodes have been restored to service (it prints a warning about waiting for nodes to become available and periodically retries until they are available).
ジョブステップの起動は、必要なノードがサービスに復元されるまで遅延されます(ノードが使用可能になるのを待つことに関する警告を出力し、使用可能になるまで定期的に再試行します)。

In the case of an sbatch command, the batch program will start when node zero of the allocation is ready for use and pre-processing can be performed as needed before using srun to launch job steps.
sbatchコマンドの場合、割り当てのノード0を使用する準備ができたときにバッチ・プログラムが開始され、srunを使用してジョブ・ステップを開始する前に、必要に応じて前処理を実行できます。
The sbatch --wait-all-nodes=<value> command can be used to override this behavior on a per-job basis and a system-wide default can be set with the SchedulerParameters=sbatch_wait_nodes option.
sbatch --wait-all-nodes = <value>コマンドを使用して、ジョブごとにこの動作をオーバーライドできます。システム全体のデフォルトは、SchedulerParameters = sbatch_wait_nodesオプションで設定できます。

In the case of the salloc command, once the allocation is made a new shell will be created on the login node.
sallocコマンドの場合、割り当てが行われると、ログインノードに新しいシェルが作成されます。
The salloc --wait-all-nodes=<value> command can be used to override this behavior on a per-job basis and a system-wide default can be set with the SchedulerParameters=salloc_wait_nodes option.
salloc --wait-all-nodes = <value>コマンドを使用して、ジョブごとにこの動作をオーバーライドできます。システム全体のデフォルトは、SchedulerParameters = salloc_wait_nodesオプションで設定できます。

Fault Tolerance

If the slurmctld daemon is terminated gracefully, it will wait up to SuspendTimeout or ResumeTimeout (whichever is larger) for any spawned SuspendProgram or ResumeProgram to terminate before the daemon terminates.
slurmctldデーモンが正常に終了すると、デーモンが終了する前に、生成されたSuspendProgramまたはResumeProgramが終了するまでSuspendTimeoutまたはResumeTimeout(どちらか大きい方)まで待機します。
If the spawned program does not terminate within that time period, the event will be logged and slurmctld will exit in order to permit another slurmctld daemon to be initiated.
生成されたプログラムがその期間内に終了しない場合、イベントはログに記録され、別のslurmctldデーモンの開始を許可するためにslurmctldが終了します。
Synchronization problems could also occur when the slurmctld daemon crashes (a rare event) and is restarted.
同期の問題は、slurmctldデーモンがクラッシュして(まれなイベント)、再起動したときにも発生する可能性があります。

In either event, the newly initiated slurmctld daemon (or the backup server) will recover saved node state information that may not accurately describe the actual node state.
いずれの場合も、新しく開始されたslurmctldデーモン(またはバックアップサーバー)は、実際のノード状態を正確に記述していない可能性のある保存されたノード状態情報を回復します。
In the case of a failed SuspendProgram, the negative impact is limited to increased power consumption, so no special action is currently taken to execute SuspendProgram multiple times in order to ensure the node is in a reduced power mode.
SuspendProgramに障害が発生した場合、悪影響は消費電力の増加に限定されるため、ノードが低電力モードであることを確認するために、SuspendProgramを複数回実行するための特別なアクションは現在実行されていません。
The case of a failed ResumeProgram is more serious in that the node could be placed into a DOWN state and/or jobs could fail.
ResumeProgramが失敗した場合は、ノードがDOWN状態になるか、ジョブが失敗する可能性があるという点で、より深刻です。
In order to minimize this risk, when the slurmctld daemon is started and node which should be allocated to a job fails to respond, the ResumeProgram will be executed (possibly for a second time).
このリスクを最小限に抑えるために、slurmctldデーモンが開始され、ジョブに割り当てられるべきノードが応答しない場合、ResumeProgramが実行されます(おそらく2回目)。

Booting Different Images

Slurm's PrologSlurmctld configuration parameter can identify a program to boot different operating system images for each job based upon its constraint field (or possibly comment).
SlurmのPrologSlurmctld構成パラメーターは、制約フィールド(または場合によってはコメント)に基づいて、ジョブごとに異なるオペレーティングシステムイメージを起動するプログラムを識別できます。
If you want ResumeProgram to boot a various images according to job specifications, it will need to be a fairly sophisticated program and perform the following actions:
ResumeProgramでジョブの仕様に従ってさまざまなイメージを起動する場合は、かなり洗練されたプログラムであり、次のアクションを実行する必要があります。

  1. Determine which jobs are associated with the nodes to be booted
    起動するノードに関連付けられているジョブを決定します
  2. Determine which image is required for each job and
    各ジョブに必要な画像を決定し、
  3. Boot the appropriate image for each node
    各ノードに適切なイメージを起動します

Last modified 11 November 2019