Gang Scheduling
Slurm supports timesliced gang scheduling in which two or more jobs are
allocated to the same resources in the same partition and these jobs are
alternately suspended to let one job at a time have dedicated access to the
resources for a configured period of time.
Slurmは、2つ以上のジョブが同じパーティションの同じリソースに割り当てられ、これらのジョブが交互に一時停止され、一度に1つのジョブが設定された期間リソースに専用アクセスできるようにする、タイムスライスギャングスケジューリングをサポートします。
Slurm also supports preemptive job scheduling that allows a job in a
higher PriorityTier partition, or in a preempting QOS, to preempt other
jobs. Preemption is related to Gang scheduling
because SUSPEND is one of the PreemptionModes, and it uses the Gang
scheduler to resume suspended jobs.
Slurmは、より高いPriorityTierパーティション内のジョブ、またはプリエンプティングQOS内のジョブが他のジョブをプリエンプトできるようにするプリエンプティブジョブスケジューリングもサポートします。SUSPENDはPreemptionModesの1つであり、中断されたジョブを再開するためにGangスケジューラを使用するため、プリエンプションはGangスケジューリングに関連しています。
A workload manager that supports timeslicing can improve responsiveness
and utilization by allowing more jobs to begin running sooner.
Shorter-running jobs no longer have to wait in a queue behind longer-running
jobs.
Instead they can be run "in parallel" with the longer-running jobs, which will
allow them to start and finish quicker.
Throughput is also improved because overcommitting the resources provides
opportunities for "local backfilling" to occur (see example below).
タイムスライシングをサポートするワークロードマネージャーは、より多くのジョブがより早く実行を開始できるようにすることで、応答性と使用率を改善できます。実行時間の短いジョブは、実行時間の長いジョブの後ろのキューで待つ必要がなくなりました。代わりに、実行時間の長いジョブと「並行して」実行できるため、開始と終了が速くなります。リソースをオーバーコミットすると、「ローカルバックフィル」が発生する機会が提供されるため、スループットも向上します(下の例を参照)。
The gang scheduling logic works on each partition independently.
If a new job has been allocated to resources in a partition that have already
been allocated to an existing job, then the plugin will suspend the new job
until the configured SchedulerTimeslice interval has elapsed.
Then it will suspend the running job and let the new job make use of the
resources for a SchedulerTimeslice interval.
This will continue until one of the jobs terminates.
ギャングスケジューリングロジックは、各パーティションで個別に機能します。既存のジョブにすでに割り当てられているパーティションのリソースに新しいジョブが割り当てられている場合、プラグインは、構成されたSchedulerTimeslice間隔が経過するまで新しいジョブを一時停止します。次に、実行中のジョブを一時停止し、新しいジョブにSchedulerTimeslice間隔のリソースを使用させます。これは、ジョブの1つが終了するまで続きます。
Configuration
There are several important configuration parameters relating to
gang scheduling:
ギャングスケジューリングに関連するいくつかの重要な構成パラメーターがあります。
-
SelectType: The Slurm gang scheduler supports
nodes allocated by the select/linear plugin,
socket/core/CPU resources allocated by the select/cons_res and
select/cons_tres plugins, or select/cray_aries for Cray XC
systems without ALPS.
SelectType:Slurmギャングスケジューラは、select / linearプラグインによって割り当てられたノード、select / cons_resおよびselect / cons_tresプラグインによって割り当てられたソケット/コア/ CPUリソース、またはALPSのないCray XCシステムのselect / cray_ariesをサポートします。
-
SelectTypeParameter: Since resources will be getting overallocated
with jobs (suspended jobs remain in memory), the resource selection plugin
should be configured to track the amount of memory used by each job to ensure
that memory page swapping does not occur.
When select/linear is chosen, we recommend setting
SelectTypeParameter=CR_Memory.
When select/cons_res or select/cons_tres are chosen, we recommend
including Memory as a resource (e.g. SelectTypeParameter=CR_Core_Memory).
SelectTypeParameter:リソースはジョブで割り当て超過になるため(中断されたジョブはメモリ内に残ります)、メモリページスワップが発生しないように、各ジョブが使用するメモリ量を追跡するようにリソース選択プラグインを構成する必要があります。select / linearを選択した場合は、SelectTypeParameter = CR_Memoryを設定することをお勧めします。select / cons_resまたはselect / cons_tresを選択する場合、リソースとしてメモリを含めることをお勧めします(例:SelectTypeParameter = CR_Core_Memory)。
-
DefMemPerCPU: Since job requests may not explicitly specify
a memory requirement, we also recommend configuring
DefMemPerCPU (default memory per allocated CPU) or
DefMemPerNode (default memory per allocated node).
It may also be desirable to configure
MaxMemPerCPU (maximum memory per allocated CPU) or
MaxMemPerNode (maximum memory per allocated node) in slurm.conf.
Users can use the --mem or --mem-per-cpu option
at job submission time to specify their memory requirements.
Note that in order to gang schedule jobs, all jobs must be able to fit into
memory at the same time.
DefMemPerCPU:ジョブリクエストでメモリ要件が明示的に指定されていない場合があるため、DefMemPerCPU(割り当てられたCPUごとのデフォルトメモリ)またはDefMemPerNode(割り当てられたノードごとのデフォルトメモリ)の構成もお勧めします。slurm.confでMaxMemPerCPU(割り当てられたCPUごとの最大メモリ)またはMaxMemPerNode(割り当てられたノードごとの最大メモリ)を構成することも望ましい場合があります。ユーザーは、ジョブの送信時に--memまたは--mem-per-cpuオプションを使用して、メモリ要件を指定できます。スケジュールジョブをギャングするには、すべてのジョブが同時にメモリに収まる必要があります。
-
JobAcctGatherType and JobAcctGatherFrequency:
If you wish to enforce memory limits, either that task/cgroup must be
configured to limit each job's memory use or accounting must be enabled
using the JobAcctGatherType and JobAcctGatherFrequency
parameters. If accounting is enabled and a job exceeds its configured
memory limits, it will be canceled in order to prevent it from
adversely affecting other jobs sharing the same resources.
JobAcctGatherTypeおよびJobAcctGatherFrequency:メモリ制限を適用する場合、そのタスク/ cgroupを構成して各ジョブのメモリ使用を制限するか、JobAcctGatherTypeおよびJobAcctGatherFrequencyパラメータを使用してアカウンティングを有効にする必要があります。アカウンティングが有効になっていて、ジョブが設定されたメモリ制限を超えると、同じリソースを共有する他のジョブに悪影響を与えないようにするためにキャンセルされます。
-
PreemptMode: set the GANG option.
See the slurm.conf manpage for other options that may be specified to
enable job preemption in addition to GANG.
PreemptMode:GANGオプションを設定します。GANGに加えてジョブのプリエンプションを有効にするために指定できるその他のオプションについては、slurm.confのマンページを参照してください。
NOTE: Gang scheduling is performed independently for each partition, so if you only want time-slicing by OverSubscribe, without any preemption, then configuring partitions with overlapping nodes is not recommended. On the other hand, if you want to use PreemptType=preempt/partition_prio to allow jobs from higher PriorityTier partitions to Suspend jobs from lower PriorityTier partitions, then you will need overlapping partitions, and PreemptMode=SUSPEND,GANG to use the Gang scheduler to resume the suspended job(s). In any case, time-slicing won't happen between jobs on different partitions.
注:ギャングスケジューリングはパーティションごとに独立して実行されるため、プリエンプションなしでOverSubscribeによるタイムスライスのみが必要な場合は、ノードが重複するパーティションを構成することはお勧めしません。一方、PreemptType = preempt / partition_prioを使用して、より高いPriorityTierパーティションからのジョブをより低いPriorityTierパーティションからの一時停止ジョブに許可する場合は、重複するパーティションと、PreemptMode = SUSPEND、GANGでGangスケジューラを使用して再開する必要があります。一時停止されたジョブ。いずれの場合も、異なるパーティションのジョブ間ではタイムスライスは発生しません。
-
SchedulerTimeSlice: The default timeslice interval is 30 seconds.
To change this duration, set SchedulerTimeSlice to the desired interval
(in seconds) in slurm.conf. For example, to set the timeslice interval
to one minute, set SchedulerTimeSlice=60. Short values can increase
the overhead of gang scheduling.
SchedulerTimeSlice:デフォルトのタイムスライス間隔は30秒です。この期間を変更するには、schedulerTimeSliceをslurm.confで目的の間隔(秒単位)に設定します。たとえば、タイムスライス間隔を1分に設定するには、SchedulerTimeSlice = 60を設定します。値が短いと、ギャングスケジューリングのオーバーヘッドが増加する可能性があります。
-
OverSubscribe: Configure the partition's OverSubscribe setting to
FORCE for all partitions in which timeslicing is to take place.
The FORCE option supports an additional parameter that controls
how many jobs can share a compute resource (FORCE[:max_share]). By default the
max_share value is 4. To allow up to 6 jobs from this partition to be
allocated to a common resource, set OverSubscribe=FORCE:6. To only let 2 jobs
timeslice on the same resources, set OverSubscribe=FORCE:2.
OverSubscribe:タイムスライシングが行われるすべてのパーティションについて、パーティションのOverSubscribe設定をFORCEに構成します。FORCEオプションは、コンピューティングリソースを共有できるジョブの数を制御する追加のパラメーター(FORCE [:max_share])をサポートします。デフォルトでは、max_share値は4です。このパーティションから最大6つのジョブを共通リソースに割り当てることができるようにするには、OverSubscribe = FORCE:6を設定します。2つのジョブのみが同じリソースでタイムスライスされるようにするには、OverSubscribe = FORCE:2を設定します。
In order to enable gang scheduling after making the configuration changes
described above, restart Slurm if it is already running. Any change to the
plugin settings in Slurm requires a full restart of the daemons. If you
just change the partition OverSubscribe setting, this can be updated with
scontrol reconfig.
上記の構成変更を行った後でギャングスケジューリングを有効にするには、Slurmがすでに実行されている場合は再起動します。Slurmでプラグイン設定を変更すると、デーモンを完全に再起動する必要があります。パーティションのOverSubscribe設定を変更するだけの場合、これはscontrol reconfigで更新できます。
Timeslicer Design and Operation
When enabled, the gang scheduler keeps track of the resources
allocated to all jobs. For each partition an "active bitmap" is maintained that
tracks all concurrently running jobs in the Slurm cluster. Each time a new
job is allocated to resources in a partition, the gang scheduler
compares these newly allocated resources with the resources already maintained
in the "active bitmap".
If these two sets of resources are disjoint then the new job is added to the "active bitmap". If these two sets of resources overlap then
the new job is suspended. All jobs are tracked in a per-partition job queue
within the gang scheduler logic.
有効にすると、ギャングスケジューラはすべてのジョブに割り当てられたリソースを追跡します。各パーティションについて、Slurmクラスターで同時に実行されているすべてのジョブを追跡する「アクティブなビットマップ」が維持されます。新しいジョブがパーティション内のリソースに割り当てられるたびに、ギャングスケジューラはこれらの新しく割り当てられたリソースを、「アクティブなビットマップ」ですでに維持されているリソースと比較します。これらの2つのリソースセットが互いに素である場合、新しいジョブは「アクティブなビットマップ」に追加されます。これらの2つのリソースセットが重複している場合、新しいジョブは中断されます。すべてのジョブは、ギャングスケジューラロジック内のパーティションごとのジョブキューで追跡されます。
A separate timeslicer thread is spawned by the gang scheduler
on startup. This thread sleeps for the configured SchedulerTimeSlice
interval. When it wakes up, it checks each partition for suspended jobs. If
suspended jobs are found then the timeslicer thread moves all running
jobs to the end of the job queue. It then reconstructs the "active bitmap" for
this partition beginning with the suspended job that has waited the longest to
run (this will be the first suspended job in the run queue). Each following job
is then compared with the new "active bitmap", and if the job can be run
concurrently with the other "active" jobs then the job is added. Once this is
complete then the timeslicer thread suspends any currently running jobs
that are no longer part of the "active bitmap", and resumes jobs that are new
to the "active bitmap".
起動時にギャングスケジューラによって別のタイムスライサースレッドが生成されます。このスレッドは、構成されたSchedulerTimeSlice間隔の間スリープします。ウェイクアップすると、中断されたジョブがないか各パーティションをチェックします。一時停止中のジョブが見つかった場合、タイムスライサースレッドは実行中のすべてのジョブをジョブキューの最後に移動します。次に、このパーティションの「アクティブなビットマップ」を、実行が最も長く待機していた中断されたジョブから開始して再構築します(これが実行キューの最初の中断されたジョブになります)。次に、後続の各ジョブが新しい「アクティブなビットマップ」と比較され、ジョブが他の「アクティブな」ジョブと同時に実行できる場合は、ジョブが追加されます。これが完了すると、タイムスライサースレッドは、「アクティブなビットマップ」の一部ではなくなった現在実行中のジョブを中断します。
This timeslicer thread algorithm for rotating jobs is designed to prevent jobs from starving (remaining in the suspended state indefinitely) and
to be as fair as possible in the distribution of runtime while still keeping
all of the resources as busy as possible.
ジョブをローテーションするためのこのタイムスライサースレッドアルゴリズムは、ジョブが不足する(無期限に中断状態のままになる)のを防ぎ、すべてのリソースを可能な限りビジーに保ちながら、ランタイムの分散において可能な限り公平になるように設計されています。
The gang scheduler suspends jobs via the same internal functions that
support scontrol suspend and scontrol resume.
A good way to observe the operation of the timeslicer is by running
squeue -i<time> in a terminal window where time is set
equal to SchedulerTimeSlice.
ギャングスケジューラは、scontrolサスペンドとscontrolレジュームをサポートする同じ内部機能を介してジョブを中断します。タイムスライサーの動作を監視する良い方法は、squeue -iを実行することです。 時間がSchedulerTimeSliceと等しく設定されている端末ウィンドウ内。
A Simple Example
The following example is configured with select/linear and OverSubscribe=FORCE.
This example takes place on a small cluster of 5 nodes:
次の例は、select / linearおよびOverSubscribe = FORCEで構成されています。この例は、5つのノードの小さなクラスターで行われます。
[user@n16 load]$ sinfo PARTITION AVAIL TIMELIMIT NODES STATE NODELIST active* up infinite 5 idle n[12-16]
Here are the Scheduler settings (excerpt of output):
スケジューラの設定は次のとおりです(出力の抜粋):
[user@n16 load]$ scontrol show config ... PreemptMode = GANG ... SchedulerTimeSlice = 30 SchedulerType = sched/builtin ...
The myload script launches a simple load-generating app that runs
for the given number of seconds. Submit myload to run on all nodes:
myloadスクリプトは、指定された秒数の間実行される単純な負荷生成アプリを起動します。myloadを送信して、すべてのノードで実行します。
[user@n16 load]$ sbatch -N5 ./myload 300 sbatch: Submitted batch job 3 [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 3 active myload user 0:05 5 n[12-16]
Submit it again and watch the gang scheduler suspend it:
再度送信して、ギャングスケジューラが一時停止するのを確認します。
[user@n16 load]$ sbatch -N5 ./myload 300 sbatch: Submitted batch job 4 [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 3 active myload user R 0:13 5 n[12-16] 4 active myload user S 0:00 5 n[12-16]
After 30 seconds the gang scheduler swaps jobs, and now job 4 is the
active one:
30秒後にギャングスケジューラがジョブをスワップし、ジョブ4がアクティブになります。
[user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 4 active myload user R 0:08 5 n[12-16] 3 active myload user S 0:41 5 n[12-16] [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 4 active myload user R 0:21 5 n[12-16] 3 active myload user S 0:41 5 n[12-16]
After another 30 seconds the gang scheduler sets job 3 running again:
さらに30秒後、ギャングスケジューラはジョブ3を再度実行するように設定します。
[user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 3 active myload user R 0:50 5 n[12-16] 4 active myload user S 0:30 5 n[12-16]
A possible side effect of timeslicing: Note that jobs that are
immediately suspended may cause their srun commands to produce the
following output:
タイムスライシングの副作用の可能性:ただちに一時停止されたジョブにより、srunコマンドが次の出力を生成する場合があることに注意してください。
[user@n16 load]$ cat slurm-4.out srun: Job step creation temporarily disabled, retrying srun: Job step creation still disabled, retrying srun: Job step creation still disabled, retrying srun: Job step creation still disabled, retrying srun: Job step created
This occurs because srun is attempting to launch a jobstep in an
allocation that has been suspended. The srun process will continue in a
retry loop to launch the jobstep until the allocation has been resumed and the
jobstep can be launched.
これは、srunが一時停止された割り当てでジョブステップを起動しようとしているために発生します。割り当てが再開され、ジョブステップを起動できるようになるまで、srunプロセスは再試行ループで続行され、ジョブステップを起動します。
When the gang scheduler is enabled, this type of output in the user
jobs should be considered benign.
ギャングスケジューラが有効になっている場合、ユーザージョブのこのタイプの出力は無害であると見なされます。
More examples
The following example shows how the timeslicer algorithm keeps the resources
busy. Job 10 runs continually, while jobs 9 and 11 are timesliced:
次の例は、タイムスライサーアルゴリズムがリソースをビジー状態に保つ方法を示しています。ジョブ10は継続的に実行されますが、ジョブ9と11はタイムスライスされます。
[user@n16 load]$ sbatch -N3 ./myload 300 sbatch: Submitted batch job 9 [user@n16 load]$ sbatch -N2 ./myload 300 sbatch: Submitted batch job 10 [user@n16 load]$ sbatch -N3 ./myload 300 sbatch: Submitted batch job 11 [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 9 active myload user R 0:11 3 n[12-14] 10 active myload user R 0:08 2 n[15-16] 11 active myload user S 0:00 3 n[12-14] [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 10 active myload user R 0:50 2 n[15-16] 11 active myload user R 0:12 3 n[12-14] 9 active myload user S 0:41 3 n[12-14] [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 10 active myload user R 1:04 2 n[15-16] 11 active myload user R 0:26 3 n[12-14] 9 active myload user S 0:41 3 n[12-14] [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 9 active myload user R 0:46 3 n[12-14] 10 active myload user R 1:13 2 n[15-16] 11 active myload user S 0:30 3 n[12-14]
The next example displays "local backfilling":
次の例は、「ローカルバックフィル」を表示します。
[user@n16 load]$ sbatch -N3 ./myload 300 sbatch: Submitted batch job 12 [user@n16 load]$ sbatch -N5 ./myload 300 sbatch: Submitted batch job 13 [user@n16 load]$ sbatch -N2 ./myload 300 sbatch: Submitted batch job 14 [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 12 active myload user R 0:14 3 n[12-14] 14 active myload user R 0:06 2 n[15-16] 13 active myload user S 0:00 5 n[12-16]
Without timeslicing and without the backfill scheduler enabled, job 14 has to
wait for job 13 to finish.
タイムスライシングがなく、バックフィルスケジューラが有効になっていない場合、ジョブ14はジョブ13が完了するまで待機する必要があります。
This is called "local" backfilling because the backfilling only occurs with
jobs close enough in the queue to get allocated by the scheduler as part of
oversubscribing the resources. Recall that the number of jobs that can
overcommit a resource is controlled by the OverSubscribe=FORCE:max_share value,
so this value effectively controls the scope of "local backfilling".
これは「ローカル」バックフィルと呼ばれます。バックフィルは、リソースのオーバーサブスクライブの一部としてスケジューラによって割り当てられるのに十分なキュー内のジョブでのみ発生するためです。リソースをオーバーコミットできるジョブの数はOverSubscribe = FORCE:max_share値によって制御されるため、この値は「ローカルバックフィル」のスコープを効果的に制御することを思い出してください。
Normal backfill algorithms check all jobs in the wait queue.
通常のバックフィルアルゴリズムは、待機キュー内のすべてのジョブをチェックします。
Consumable Resource Examples
The following two examples illustrate the primary difference between
CR_CPU and CR_Core when consumable resource selection is enabled
(select/cons_res).
次の2つの例は、消費可能なリソースの選択が有効な場合(select / cons_res)のCR_CPUとCR_Coreの主な違いを示しています。
When CR_CPU (or CR_CPU_Memory) is configured then the selector
treats the CPUs as simple, interchangeable computing resources
unless task affinity is enabled. However when task affinity is enabled
with CR_CPU or CR_Core (or CR_Core_Memory) is enabled, the
selector treats the CPUs as individual resources that are specifically
allocated to jobs.
This subtle difference is highlighted when timeslicing is enabled.
CR_CPU(またはCR_CPU_Memory)が構成されている場合、タスクアフィニティが有効になっていない限り、セレクターはCPUを単純な交換可能なコンピューティングリソースとして扱います。ただし、CR_CPUまたはCR_Core(またはCR_Core_Memory)を有効にしてタスクアフィニティを有効にすると、セレクターはCPUを、ジョブに特別に割り当てられた個別のリソースとして扱います。この微妙な違いは、タイムスライスが有効になっているときに強調表示されます。
In both examples 6 jobs are submitted. Each job requests 2 CPUs per node, and
all of the nodes contain two quad-core processors. The timeslicer will
initially let the first 4 jobs run and suspend the last 2 jobs.
The manner in which these jobs are timesliced depends upon the configured
SelectTypeParameter.
どちらの例でも、6つのジョブが送信されます。各ジョブはノードごとに2つのCPUを要求し、すべてのノードには2つのクアッドコアプロセッサが含まれています。タイムスライサーは最初に最初の4つのジョブを実行させ、最後の2つのジョブを一時停止します。これらのジョブがタイムスライスされる方法は、構成されたSelectTypeParameterによって異なります。
In the first example CR_Core_Memory is configured. Note that jobs 46
and 47 don't ever get suspended. This is because they are not sharing
their cores with any other job.
Jobs 48 and 49 were allocated to the same cores as jobs 44 and 45.
The timeslicer recognizes this and timeslices only those jobs:
最初の例では、CR_Core_Memoryが構成されています。ジョブ46と47は決して中断されないことに注意してください。これは、他の仕事とコアを共有していないためです。ジョブ48と49は、ジョブ44と45と同じコアに割り当てられました。タイムスライサーはこれを認識し、それらのジョブのみをタイムスライスします。
[user@n16 load]$ sinfo PARTITION AVAIL TIMELIMIT NODES STATE NODELIST active* up infinite 5 idle n[12-16] [user@n16 load]$ scontrol show config | grep Select SelectType = select/cons_res SelectTypeParameters = CR_CORE_MEMORY [user@n16 load]$ sinfo -o "%20N %5D %5c %5z" NODELIST NODES CPUS S:C:T n[12-16] 5 8 2:4:1 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 44 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 45 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 46 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 47 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 48 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 49 [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 44 active myload user R 0:09 5 n[12-16] 45 active myload user R 0:08 5 n[12-16] 46 active myload user R 0:08 5 n[12-16] 47 active myload user R 0:07 5 n[12-16] 48 active myload user S 0:00 5 n[12-16] 49 active myload user S 0:00 5 n[12-16] [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 46 active myload user R 0:49 5 n[12-16] 47 active myload user R 0:48 5 n[12-16] 48 active myload user R 0:06 5 n[12-16] 49 active myload user R 0:06 5 n[12-16] 44 active myload user S 0:44 5 n[12-16] 45 active myload user S 0:43 5 n[12-16] [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 44 active myload user R 1:23 5 n[12-16] 45 active myload user R 1:22 5 n[12-16] 46 active myload user R 2:22 5 n[12-16] 47 active myload user R 2:21 5 n[12-16] 48 active myload user S 1:00 5 n[12-16] 49 active myload user S 1:00 5 n[12-16]
Note the runtime of all 6 jobs in the output of the last squeue command.
Jobs 46 and 47 have been running continuously, while jobs 44 and 45 are
splitting their runtime with jobs 48 and 49.
最後のsqueueコマンドの出力の6つのジョブすべての実行時間に注意してください。ジョブ46と47は継続的に実行されていますが、ジョブ44と45はランタイムをジョブ48と49で分割しています。
The next example has CR_CPU_Memory configured and the same 6 jobs are
submitted. Here the selector and the timeslicer treat the CPUs as countable
resources which results in all 6 jobs sharing time on the CPUs:
次の例では、CR_CPU_Memoryが構成されており、同じ6つのジョブが送信されます。ここで、セレクターとタイムライサーはCPUを可算リソースとして扱い、6つのジョブすべてがCPUで時間を共有するようになります。
[user@n16 load]$ sinfo PARTITION AVAIL TIMELIMIT NODES STATE NODELIST active* up infinite 5 idle n[12-16] [user@n16 load]$ scontrol show config | grep Select SelectType = select/cons_res SelectTypeParameters = CR_CPU_MEMORY [user@n16 load]$ sinfo -o "%20N %5D %5c %5z" NODELIST NODES CPUS S:C:T n[12-16] 5 8 2:4:1 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 51 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 52 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 53 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 54 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 55 [user@n16 load]$ sbatch -n10 -N5 ./myload 300 sbatch: Submitted batch job 56 [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 51 active myload user R 0:11 5 n[12-16] 52 active myload user R 0:11 5 n[12-16] 53 active myload user R 0:10 5 n[12-16] 54 active myload user R 0:09 5 n[12-16] 55 active myload user S 0:00 5 n[12-16] 56 active myload user S 0:00 5 n[12-16] [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 51 active myload user R 1:09 5 n[12-16] 52 active myload user R 1:09 5 n[12-16] 55 active myload user R 0:23 5 n[12-16] 56 active myload user R 0:23 5 n[12-16] 53 active myload user S 0:45 5 n[12-16] 54 active myload user S 0:44 5 n[12-16] [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 53 active myload user R 0:55 5 n[12-16] 54 active myload user R 0:54 5 n[12-16] 55 active myload user R 0:40 5 n[12-16] 56 active myload user R 0:40 5 n[12-16] 51 active myload user S 1:16 5 n[12-16] 52 active myload user S 1:16 5 n[12-16] [user@n16 load]$ squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST 51 active myload user R 3:18 5 n[12-16] 52 active myload user R 3:18 5 n[12-16] 53 active myload user R 3:17 5 n[12-16] 54 active myload user R 3:16 5 n[12-16] 55 active myload user S 3:00 5 n[12-16] 56 active myload user S 3:00 5 n[12-16]
Note that the runtime of all 6 jobs is roughly equal. Jobs 51-54 ran first so
they're slightly ahead, but so far all jobs have run for at least 3 minutes.
6つのジョブすべての実行時間はほぼ同じであることに注意してください。ジョブ51〜54が最初に実行されたため、わずかに進んでいますが、これまでのところ、すべてのジョブは少なくとも3分間実行されています。
At the core level this means that Slurm relies on the Linux kernel to move
jobs around on the cores to maximize performance.
This is different than when CR_Core_Memory was configured and the jobs
would effectively remain "pinned" to their specific cores for the duration of
the job.
Note that CR_Core_Memory supports CPU binding, while
CR_CPU_Memory does not.
コアレベルでは、これはSlurmがLinuxカーネルに依存してコア上でジョブを移動し、パフォーマンスを最大化することを意味します。これは、CR_Core_Memoryが構成されたときとは異なり、ジョブの実行中、ジョブは特定のコアに効果的に「ピン留め」されたままになります。CR_Core_MemoryはCPUバインディングをサポートしていますが、CR_CPU_Memoryはサポートしていません。
Note that manually suspending a job (i.e. "scontrol suspend ...") releases
its CPUs for allocation to other jobs.
Resuming a previously suspended job may result in multiple jobs being
allocated the same CPUs, which could trigger gang scheduling of jobs.
Use of the scancel command to send SIGSTOP and SIGCONT signals would stop a
job without releasing its CPUs for allocation to other jobs and would be a
preferable mechanism in many cases.
ジョブを手動で一時停止(つまり、「scontrol suspend ...」)すると、他のジョブに割り当てるためにそのCPUが解放されることに注意してください。以前に中断されたジョブを再開すると、複数のジョブに同じCPUが割り当てられ、ジョブのギャングスケジューリングがトリガーされる可能性があります。scancelコマンドを使用してSIGSTOPおよびSIGCONTシグナルを送信すると、他のジョブに割り当てるためにCPUを解放せずにジョブを停止するため、多くの場合、望ましいメカニズムです。
Last modified 10 March 2020