JOB Schedulerの中でHPC環境で非常に人気のあるSlurmのインストールlと設定を行い、Intel MPIのジョブを流してみます。OSはUbuntu 20.04を使います。簡単にインストールと設定ができてすぐに使える様になります。HPC用のサーバーやワークステーションを使っているが、まだジョブスケジューラは使っていないという方は、この記事の方法で、試してみてはいかがでしょうか。

slurmのパッケージslurm-wlmをインストールします。mungeも含めて、必要なパッケージはすべて含まれていますので、これ一つをインストールするだけで大丈夫です。

root@hpc-machine:~# apt install slurm-wlm
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
状態情報を読み取っています... 完了
以下の追加パッケージがインストールされます:
  libaec0 libdbi1 libhdf5-103 libhwloc-plugins libhwloc15 libipmimonitoring6 liblua5.1-0 libmunge2 librrd8 libsz2 libxnvctrl0
  munge slurm-client slurm-wlm-basic-plugins slurmctld slurmd
提案パッケージ:
  libhwloc-contrib-plugins
以下のパッケージが新たにインストールされます:
  libaec0 libdbi1 libhdf5-103 libhwloc-plugins libhwloc15 libipmimonitoring6 liblua5.1-0 libmunge2 librrd8 libsz2 libxnvctrl0
  munge slurm-client slurm-wlm slurm-wlm-basic-plugins slurmctld slurmd
アップグレード: 0 個、新規インストール: 17 個、削除: 0 個、保留: 0 個。
4,843 kB のアーカイブを取得する必要があります。
この操作後に追加で 16.1 MB のディスク容量が消費されます。
続行しますか? [Y/n] y
以下省略
systemd (245.4-4ubuntu3.22) のトリガを処理しています ...
man-db (2.9.1-1) のトリガを処理しています ...
libc-bin (2.31-0ubuntu9.14) のトリガを処理しています ...
root@hpc-machine:~#

次に/etc/slurm-llnl/slurm.confを作成します。雛形は下記のとおりです。


# slurm.conf file generated by configurator easy.html.
# Put this file on all nodes of your cluster.
# See the slurm.conf man page for more information.
#
ControlMachine=hpc-machine
#ControlAddr=
#
#MailProg=/bin/mail
MpiDefault=none
#MpiParams=ports=#-#
ProctrackType=proctrack/pgid
ReturnToService=1
SlurmctldPidFile=/var/run/slurmctld.pid
#SlurmctldPort=6817
SlurmdPidFile=/var/run/slurmd.pid
#SlurmdPort=6818
SlurmdSpoolDir=/var/spool/slurm-llnl/slurmd
#SlurmUser=slurm
SlurmdUser=root
StateSaveLocation=/var/spool/slurm-llnl
SwitchType=switch/none
TaskPlugin=task/none
#
# GresTypes=gpu
#
#
# TIMERS
#KillWait=30
#MinJobAge=300
#SlurmctldTimeout=120
#SlurmdTimeout=300
#
#
# SCHEDULING
FastSchedule=1
SchedulerType=sched/backfill
SelectType=select/cons_res
SelectTypeParameters=CR_CPU
#
#
# LOGGING AND ACCOUNTING
AccountingStorageType=accounting_storage/none
ClusterName=cluster
#JobAcctGatherFrequency=30
JobAcctGatherType=jobacct_gather/none
#SlurmctldDebug=3
SlurmctldLogFile=/var/log/slurm-llnl/slurmctld.log
#SlurmdDebug=3
SlurmdLogFile=/var/log/slurm-llnl/slurmd.log
#
#
# COMPUTE NODES
#NodeName=hpc-machine  CPUs=20 RealMemory=257834 Gres=gpu:2 State=UNKNOWN
#NodeName=hpc-machine  CPUs=32 RealMemory=515847 Gres=gpu:a100:2,gpu:a6000:6 State=UNKNOWN
NodeName=hpc-machine  CPUs=48 RealMemory=515673 State=UNKNOWN
PartitionName=debug Nodes=hpc-machine Default=YES MaxTime=INFINITE State=UP

上記のファイル中のhpc-machineがインストールするコンピュータのhostnameですので、ご自分のコンピュータのhostnameに置き換えてください。

root@hpc-machine:~# hostname
hpc-machine
root@hpc-machine:~#

下から2行目のCPUs=のあとの数値は、コンピュータのトータルコア数です。nprocコマンドで表示される数を入れてください。

root@hpc-machine:~# nproc
48
root@hpc-machine:~# 

その右のRealMemory=の右の数はコンピュータのトータルメモリサイズのMB表記を入れます。free -mコマンドで表示されます。

root@hpc-machine:~# free -m
              total        used        free      shared  buff/cache   available
Mem:         515673        2902      511184          47        1586      509918
Swap:          2047           0        2047
root@hpc-machine:~#

ここまでで設定は終了です。ジョブ投入のslurmctldとジョブ実行のslurmdを起動します。

root@hpc-machine:~# systemctl start  slurmd slurmctld
root@hpc-machine:~#

リブートしても、上記の2つが起動されるよう、下記を実行します。

root@hpc-machine:/home/hpc/himeno# systemctl enable slurmd slurmctld
Synchronizing state of slurmd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable slurmd
Synchronizing state of slurmctld.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable slurmctld
root@hpc-machine:/home/hpc/himeno# 

正常に動作しているか確認します。

root@hpc-machine:~# sinfo
PARTITION AVAIL  TIMELIMIT  NODES  STATE NODELIST
debug*       up   infinite      1  drain hpc-machine
root@hpc-machine:~#

stateがidleでなくdrainなのでscontrolコマンドでidleに戻します。

root@hpc-machine:~# scontrol update state=idle node=hpc-machine
root@hpc-machine:~#

その後再びsinfoコマンドでidleになったか確認します。

root@hpc-machine:~# sinfo
PARTITION AVAIL  TIMELIMIT  NODES  STATE NODELIST
debug*       up   infinite      1   idle hpc-machine
root@hpc-machine:~#

idle状態になりましたので、slurmでジョブ投入が可能になりました。

それではジョブ投入するプログラムとして姫野ベンチを使ってみましょう。姫野ベンチのダウンロード方法は、こちらをご覧ください。

ここでは姫野ベンチのソースコードhimenoBMTxpr.f90を/home/hpc/himenoに置きました。Intel oneAPI (base+hpc)はすでにインストールされています(インストール方法はこちら)。

姫野ベンチのコンパイルは

hpc@hpc-machine:~/himeno$ mpiifx -O3 -ipo -xHost -fast himenoBMTxpr.f90 -o himeno
hpc@hpc-machine:~/himeno$

最初にマニュアルで実行してみます。himenoベンチを実行する場合並列数、グリッドのサイズ、グリッドを3方向それぞれ何分割するかを入力する必要があります。最初ですので、並列数は48、グリッドサイズはxl、分割数は1 48 1にすることにします。

hpc@hpc-machine:~/himeno$ mpirun -np 48 ./himeno <<.
> xl
> 1 48 1
> .
 For example:
 Grid-size= 
            XS  (64x32x32)
            S   (128x64x64)
            M   (256x128x128)
            L   (512x256x256)
            XL  (1024x512x512)
  Grid-size = 
 
 For example: 
 DDM pattern= 
      1 1 2
      i-direction partitioning : 1
      j-direction partitioning : 1
      k-direction partitioning : 2
  DDM pattern = 
 
 Sequential version array size
  mimax=        1025  mjmax=         513  mkmax=         513
 Parallel version  array size
  mimax=        1025  mjmax=          13  mkmax=         513
  imax=        1024  jmax=          12  kmax=         512
  I-decomp=            1  J-decomp=           48  K-decomp=            1
 
  Start rehearsal measurement process.
  Measure the performance in 3 times.
   MFLOPS:   152595.297156194        time(s):  0.177684802358272     
  4.3909566E-04
 Now, start the actual measurement process.
 The loop will be excuted in        1013  times.
 This will take about one minute.
 Wait for a while.
  Loop executed for         1013  times
  Gosa :  3.6584929E-04
  MFLOPS:   166910.878121555        time(s):   54.8523175419905     
  Score based on Pentium III 600MHz :   2014.859    
hpc@hpc-machine:~/himeno

メモリがddr5-4800に高速化されたので、姫野ベンチとしては高速な結果になっている様です。ちなみに、このマシンは

hpc@hpc-machine:~/himeno$ nproc
48
hpc@hpc-machine:~/himeno$ head /proc/cpuinfo 
processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 143
model name    : Intel(R) Xeon(R) Gold 5418Y
stepping    : 8
microcode    : 0x2b0004d0
cpu MHz        : 800.000
cache size    : 46080 KB
physical id    : 0
hpc@hpc-machine:~/himeno$ free -m
              total        used        free      shared  buff/cache   available
Mem:         515673        2883      510799          47        1990      509935
Swap:          2047           0        2047
hpc@hpc-machine:~/himeno$

の構成です。

いよいよ、slurmでジョブ投入して実行してみます。その為には、ジョブを記述したファイルを作り、それをsbatchコマンドでジョブ投入するという流れになります。上記のマニュアル実行と同じことをslurmに投入する為のファイルjob_himeno.shの記述は

hpc@hpc-machine:~/himeno$ cat job_himeno.sh
#!/bin/bash

#SBATCH --job-name=himeno_benchmark
#SBATCH --output=himeno_output.txt
#SBATCH --ntasks=48
#SBATCH --nodes=1
mpirun -np $SLURM_NTASKS ./himeno <<.
xl
1 48 1
.

このジョブを投入するには

hpc@hpc-machine:~/himeno$ sbatch job_himeno.sh 
Submitted batch job 4
hpc@hpc-machine:~/himeno$

ジョブのキューを確認するには

hpc@hpc-machine:~/himeno$ squeue
             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
                 4     debug himeno_b      hpc  R       0:04      1 hpc-machine
hpc@hpc-machine:~/himeno$ 

しばらくしてから(1分で姫野ベンチの実行が終わる)、再度キューを確認すると

hpc@hpc-machine:~/himeno$ squeue
             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
hpc@hpc-machine:~/himeno$

キューにはジョブは残っていません。ジョブの出力は記述ファイルの中でhimeno_output.txtとしていましたので、そのファイルを見てみます。

hpc@hpc-machine:~/himeno$ cat himeno_output.txt 
 For example:
 Grid-size= 
            XS  (64x32x32)
            S   (128x64x64)
            M   (256x128x128)
            L   (512x256x256)
            XL  (1024x512x512)
  Grid-size = 
 
 For example: 
 DDM pattern= 
      1 1 2
      i-direction partitioning : 1
      j-direction partitioning : 1
      k-direction partitioning : 2
  DDM pattern = 
 
 Sequential version array size
  mimax=        1025  mjmax=         513  mkmax=         513
 Parallel version  array size
  mimax=        1025  mjmax=          13  mkmax=         513
  imax=        1024  jmax=          12  kmax=         512
  I-decomp=            1  J-decomp=           48  K-decomp=            1
 
  Start rehearsal measurement process.
  Measure the performance in 3 times.
   MFLOPS:   142284.161020305        time(s):  0.190561373954552     
  4.3909566E-04
 Now, start the actual measurement process.
 The loop will be excuted in         944  times.
 This will take about one minute.
 Wait for a while.
  Loop executed for          944  times
  Gosa :  3.6778196E-04
  MFLOPS:   163972.787692517        time(s):   52.0319847459505     
  Score based on Pentium III 600MHz :   1979.391    
hpc@hpc-machine:~/himeno$ 

正常に実行されています。この記述ファイルでは、並列数、3方向のグリッドの分割数はハードコードされていて、ファイルを修正しない限り変更できません。これでは不便なので、並列数と3つの分割数をパラメータとして与えて、ジョブを投入するスクリプトを作成します。このスクリプト名をsbatch_himeno.shとするとその内容は、

hpc@hpc-machine:~/himeno$ cat sbatch_himeno.sh
#!/bin/bash
sbatch <<.
#!/bin/bash

#SBATCH --job-name=himeno_$1_$2_$3_$4
#SBATCH --output=logdir/himeno_$1_$2_$3_$4.log
#SBATCH --ntasks=$1
#SBATCH --nodes=1

mpirun -np $1 ./himeno <<..
xl
$2 $3 $4
..
.
hpc@hpc-machine:~/himeno$

となります。これを使って例えば、32並列、分割数4x4x2のジョブを投入するには

hpc@hpc-machine:~/himeno$ ./sbatch_himeno.sh 32 4 4 2
Submitted batch job 6
hpc@hpc-machine:~/himeno$ 

の様にします。キューを見ると

hpc@hpc-machine:~/himeno$ squeue
             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
                 6     debug himeno_3      hpc  R       0:05      1 hpc-machine
hpc@hpc-machine:~/himeno$

の様に投入され、1分経つと終わります。ジョブの出力ファイルは、

hpc@hpc-machine:~/himeno$ ls -l logdir/
total 4
-rw-rw-r-- 1 hpc hpc 1167 Dec 16 16:58 himeno_32_4_4_2.log

内容は

hpc@hpc-machine:~/himeno$ cat logdir/himeno_32_4_4_2.log 
 For example:
 Grid-size= 
            XS  (64x32x32)
            S   (128x64x64)
            M   (256x128x128)
            L   (512x256x256)
            XL  (1024x512x512)
  Grid-size = 
 
 For example: 
 DDM pattern= 
      1 1 2
      i-direction partitioning : 1
      j-direction partitioning : 1
      k-direction partitioning : 2
  DDM pattern = 
 
 Sequential version array size
  mimax=        1025  mjmax=         513  mkmax=         513
 Parallel version  array size
  mimax=         258  mjmax=         130  mkmax=         258
  imax=         257  jmax=         129  kmax=         257
  I-decomp=            4  J-decomp=            4  K-decomp=            2
 
  Start rehearsal measurement process.
  Measure the performance in 3 times.
   MFLOPS:   160090.302779007        time(s):  0.169366068683303     
  4.3910590E-04
 Now, start the actual measurement process.
 The loop will be excuted in        1062  times.
 This will take about one minute.
 Wait for a while.
  Loop executed for         1062  times
  Gosa :  3.6330652E-04
  MFLOPS:   167482.014530106        time(s):   57.3094867135042     
  Score based on Pentium III 600MHz :   2021.753    
hpc@hpc-machine:~/himeno$

となり正しく動作していることがわかります。

これだけではジョブスケジューラを使う意味がないので、グリッドの分割をどの値にすると最高性能が出るのか、ジョブスケジューラであらゆる可能性のジョブを投入してみましょう。

その為の準備として、並列数を与えて、3つの整数の積に分解するスクリプトを作ります。このスクリプト名を3_products.shとすると、

hpc@hpc-machine:~/himeno$ cat 3_products.sh 
#!/bin/bash
np=$1
nl=1
for i in `seq 1 $np`
do
    if [ $(( $np % i )) -eq 0 ]
    then
        jj=$(( $np / $i ))
        for j in `seq 1 $jj`
        do
            if [ $(( $jj % $j )) -eq 0 ]
            then 
                k=$(( $jj / $j ))
                echo $nl:$np=$i*$j*$k
                nl=$((nl + 1))
            fi
        done
    fi
done
hpc@hpc-machine:~/himeno$ 

となります。並列数48の場合の、グリッドの分割の仕方は

hpc@hpc-machine:~/himeno$ ./3_products.sh 48
1:48=1*1*48
2:48=1*2*24
3:48=1*3*16
4:48=1*4*12
5:48=1*6*8
6:48=1*8*6
7:48=1*12*4
8:48=1*16*3
9:48=1*24*2
10:48=1*48*1
11:48=2*1*24
12:48=2*2*12
13:48=2*3*8
14:48=2*4*6
15:48=2*6*4
16:48=2*8*3
17:48=2*12*2
18:48=2*24*1
19:48=3*1*16
20:48=3*2*8
21:48=3*4*4
22:48=3*8*2
23:48=3*16*1
24:48=4*1*12
25:48=4*2*6
26:48=4*3*4
27:48=4*4*3
28:48=4*6*2
29:48=4*12*1
30:48=6*1*8
31:48=6*2*4
32:48=6*4*2
33:48=6*8*1
34:48=8*1*6
35:48=8*2*3
36:48=8*3*2
37:48=8*6*1
38:48=12*1*4
39:48=12*2*2
40:48=12*4*1
41:48=16*1*3
42:48=16*3*1
43:48=24*1*2
44:48=24*2*1
45:48=48*1*1
hpc@hpc-machine:~/himeno$ 

45通りあることがわかります。それではこのスックリプトを少し修正して姫野ベンチのグリッド分割の全ての場合をジョブ投入するスクリプトをsbatch_himeno_all.shという名前で作成します。

hpc@hpc-machine:~/himeno$ cat sbatch_himeno_all.sh 
#!/bin/bash
np=$1
nl=1
for i in `seq 1 $np`
do
    if [ $(( $np % i )) -eq 0 ]
    then
        jj=$(( $np / $i ))
        for j in `seq 1 $jj`
        do
            if [ $(( $jj % $j )) -eq 0 ]
            then 
                k=$(( $jj / $j ))
                echo $nl:$np=$i*$j*$k
                ./sbatch_himeno.sh $np $i $j $k
                nl=$((nl + 1))
            fi
        done
    fi
done
hpc@hpc-machine:~/himeno$ 

並列数48で実行すると

hpc@hpc-machine:~/himeno$ ./sbatch_himeno_all.sh 48
1:48=1*1*48
Submitted batch job 7
2:48=1*2*24
Submitted batch job 8
3:48=1*3*16
Submitted batch job 9
4:48=1*4*12
Submitted batch job 10
5:48=1*6*8
Submitted batch job 11
6:48=1*8*6
Submitted batch job 12
7:48=1*12*4
Submitted batch job 13
8:48=1*16*3
Submitted batch job 14
9:48=1*24*2
Submitted batch job 15
10:48=1*48*1
Submitted batch job 16
11:48=2*1*24
Submitted batch job 17
12:48=2*2*12
Submitted batch job 18
13:48=2*3*8
Submitted batch job 19
14:48=2*4*6
Submitted batch job 20
15:48=2*6*4
Submitted batch job 21
16:48=2*8*3
Submitted batch job 22
17:48=2*12*2
Submitted batch job 23
18:48=2*24*1
Submitted batch job 24
19:48=3*1*16
Submitted batch job 25
20:48=3*2*8
Submitted batch job 26
21:48=3*4*4
Submitted batch job 27
22:48=3*8*2
Submitted batch job 28
23:48=3*16*1
Submitted batch job 29
24:48=4*1*12
Submitted batch job 30
25:48=4*2*6
Submitted batch job 31
26:48=4*3*4
Submitted batch job 32
27:48=4*4*3
Submitted batch job 33
28:48=4*6*2
Submitted batch job 34
29:48=4*12*1
Submitted batch job 35
30:48=6*1*8
Submitted batch job 36
31:48=6*2*4
Submitted batch job 37
32:48=6*4*2
Submitted batch job 38
33:48=6*8*1
Submitted batch job 39
34:48=8*1*6
Submitted batch job 40
35:48=8*2*3
Submitted batch job 41
36:48=8*3*2
Submitted batch job 42
37:48=8*6*1
Submitted batch job 43
38:48=12*1*4
Submitted batch job 44
39:48=12*2*2
Submitted batch job 45
40:48=12*4*1
Submitted batch job 46
41:48=16*1*3
Submitted batch job 47
42:48=16*3*1
Submitted batch job 48
43:48=24*1*2
Submitted batch job 49
44:48=24*2*1
Submitted batch job 50
45:48=48*1*1
Submitted batch job 51
hpc@hpc-machine:~/himeno$

の様にジョブが投入されます。キューを見てみると、

hpc@hpc-machine:~/himeno$ squeue
             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
                 8     debug himeno_4      hpc PD       0:00      1 (Resources)
                 9     debug himeno_4      hpc PD       0:00      1 (Priority)
                10     debug himeno_4      hpc PD       0:00      1 (Priority)
                11     debug himeno_4      hpc PD       0:00      1 (Priority)
                12     debug himeno_4      hpc PD       0:00      1 (Priority)
                13     debug himeno_4      hpc PD       0:00      1 (Priority)
                14     debug himeno_4      hpc PD       0:00      1 (Priority)
                15     debug himeno_4      hpc PD       0:00      1 (Priority)
                16     debug himeno_4      hpc PD       0:00      1 (Priority)
                17     debug himeno_4      hpc PD       0:00      1 (Priority)
                18     debug himeno_4      hpc PD       0:00      1 (Priority)
                19     debug himeno_4      hpc PD       0:00      1 (Priority)
                20     debug himeno_4      hpc PD       0:00      1 (Priority)
                21     debug himeno_4      hpc PD       0:00      1 (Priority)
                22     debug himeno_4      hpc PD       0:00      1 (Priority)
                23     debug himeno_4      hpc PD       0:00      1 (Priority)
                24     debug himeno_4      hpc PD       0:00      1 (Priority)
                25     debug himeno_4      hpc PD       0:00      1 (Priority)
                26     debug himeno_4      hpc PD       0:00      1 (Priority)
                27     debug himeno_4      hpc PD       0:00      1 (Priority)
                28     debug himeno_4      hpc PD       0:00      1 (Priority)
                29     debug himeno_4      hpc PD       0:00      1 (Priority)
                30     debug himeno_4      hpc PD       0:00      1 (Priority)
                31     debug himeno_4      hpc PD       0:00      1 (Priority)
                32     debug himeno_4      hpc PD       0:00      1 (Priority)
                33     debug himeno_4      hpc PD       0:00      1 (Priority)
                34     debug himeno_4      hpc PD       0:00      1 (Priority)
                35     debug himeno_4      hpc PD       0:00      1 (Priority)
                36     debug himeno_4      hpc PD       0:00      1 (Priority)
                37     debug himeno_4      hpc PD       0:00      1 (Priority)
                38     debug himeno_4      hpc PD       0:00      1 (Priority)
                39     debug himeno_4      hpc PD       0:00      1 (Priority)
                40     debug himeno_4      hpc PD       0:00      1 (Priority)
                41     debug himeno_4      hpc PD       0:00      1 (Priority)
                42     debug himeno_4      hpc PD       0:00      1 (Priority)
                43     debug himeno_4      hpc PD       0:00      1 (Priority)
                44     debug himeno_4      hpc PD       0:00      1 (Priority)
                45     debug himeno_4      hpc PD       0:00      1 (Priority)
                46     debug himeno_4      hpc PD       0:00      1 (Priority)
                47     debug himeno_4      hpc PD       0:00      1 (Priority)
                48     debug himeno_4      hpc PD       0:00      1 (Priority)
                49     debug himeno_4      hpc PD       0:00      1 (Priority)
                50     debug himeno_4      hpc PD       0:00      1 (Priority)
                51     debug himeno_4      hpc PD       0:00      1 (Priority)
                 7     debug himeno_4      hpc  R       0:04      1 hpc-machine
hpc@hpc-machine:~/himeno$

の様に表示されますが、ジョブ名が全部表示されませんので、どこまで実行が終わっているのかがわかりません。わかるようq.shを作ります。

hpc@hpc-machine:~/himeno$ cat q.sh 
#!/bin/bash
squeue -o  "%.8i %5P %30j %5u %.2t %.10M %.6D %R"
hpc@hpc-machine:~/himeno$ 

こちらでキューを表示すると

hpc@hpc-machine:~/himeno$ ./q.sh 
   JOBID PARTI NAME                           USER  ST       TIME  NODES NODELIST(REASON)
      13 debug himeno_48_1_12_4               hpc   PD       0:00      1 (Resources)
      14 debug himeno_48_1_16_3               hpc   PD       0:00      1 (Priority)
      15 debug himeno_48_1_24_2               hpc   PD       0:00      1 (Priority)
      16 debug himeno_48_1_48_1               hpc   PD       0:00      1 (Priority)
      17 debug himeno_48_2_1_24               hpc   PD       0:00      1 (Priority)
      18 debug himeno_48_2_2_12               hpc   PD       0:00      1 (Priority)
      19 debug himeno_48_2_3_8                hpc   PD       0:00      1 (Priority)
      20 debug himeno_48_2_4_6                hpc   PD       0:00      1 (Priority)
      21 debug himeno_48_2_6_4                hpc   PD       0:00      1 (Priority)
      22 debug himeno_48_2_8_3                hpc   PD       0:00      1 (Priority)
      23 debug himeno_48_2_12_2               hpc   PD       0:00      1 (Priority)
      24 debug himeno_48_2_24_1               hpc   PD       0:00      1 (Priority)
      25 debug himeno_48_3_1_16               hpc   PD       0:00      1 (Priority)
      26 debug himeno_48_3_2_8                hpc   PD       0:00      1 (Priority)
      27 debug himeno_48_3_4_4                hpc   PD       0:00      1 (Priority)
      28 debug himeno_48_3_8_2                hpc   PD       0:00      1 (Priority)
      29 debug himeno_48_3_16_1               hpc   PD       0:00      1 (Priority)
      30 debug himeno_48_4_1_12               hpc   PD       0:00      1 (Priority)
      31 debug himeno_48_4_2_6                hpc   PD       0:00      1 (Priority)
      32 debug himeno_48_4_3_4                hpc   PD       0:00      1 (Priority)
      33 debug himeno_48_4_4_3                hpc   PD       0:00      1 (Priority)
      34 debug himeno_48_4_6_2                hpc   PD       0:00      1 (Priority)
      35 debug himeno_48_4_12_1               hpc   PD       0:00      1 (Priority)
      36 debug himeno_48_6_1_8                hpc   PD       0:00      1 (Priority)
      37 debug himeno_48_6_2_4                hpc   PD       0:00      1 (Priority)
      38 debug himeno_48_6_4_2                hpc   PD       0:00      1 (Priority)
      39 debug himeno_48_6_8_1                hpc   PD       0:00      1 (Priority)
      40 debug himeno_48_8_1_6                hpc   PD       0:00      1 (Priority)
      41 debug himeno_48_8_2_3                hpc   PD       0:00      1 (Priority)
      42 debug himeno_48_8_3_2                hpc   PD       0:00      1 (Priority)
      43 debug himeno_48_8_6_1                hpc   PD       0:00      1 (Priority)
      44 debug himeno_48_12_1_4               hpc   PD       0:00      1 (Priority)
      45 debug himeno_48_12_2_2               hpc   PD       0:00      1 (Priority)
      46 debug himeno_48_12_4_1               hpc   PD       0:00      1 (Priority)
      47 debug himeno_48_16_1_3               hpc   PD       0:00      1 (Priority)
      48 debug himeno_48_16_3_1               hpc   PD       0:00      1 (Priority)
      49 debug himeno_48_24_1_2               hpc   PD       0:00      1 (Priority)
      50 debug himeno_48_24_2_1               hpc   PD       0:00      1 (Priority)
      51 debug himeno_48_48_1_1               hpc   PD       0:00      1 (Priority)
      12 debug himeno_48_1_8_6                hpc    R       0:44      1 hpc-machine
hpc@hpc-machine:~/himeno$

と表示されて、実行中の様子がよくわかります。1つのジョブの実行に約1分かかりますので、終わるまで約45分かかります。実行結果は./logdirの中に

hpc@hpc-machine:~/himeno$ ls -lt logdir/
total 112
-rw-rw-r-- 1 hpc hpc  981 Dec 17 10:33 himeno_48_4_6_2.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:33 himeno_48_4_4_3.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:32 himeno_48_4_3_4.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:31 himeno_48_4_2_6.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:30 himeno_48_4_1_12.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:29 himeno_48_3_16_1.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:28 himeno_48_3_8_2.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:27 himeno_48_3_4_4.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:26 himeno_48_3_2_8.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:25 himeno_48_3_1_16.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:24 himeno_48_2_24_1.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:23 himeno_48_2_12_2.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:22 himeno_48_2_8_3.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:21 himeno_48_2_6_4.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:20 himeno_48_2_4_6.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:19 himeno_48_2_3_8.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:18 himeno_48_2_2_12.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:17 himeno_48_2_1_24.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:16 himeno_48_1_48_1.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:15 himeno_48_1_24_2.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:14 himeno_48_1_16_3.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:13 himeno_48_1_12_4.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:12 himeno_48_1_8_6.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:11 himeno_48_1_6_8.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:10 himeno_48_1_4_12.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:09 himeno_48_1_3_16.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:08 himeno_48_1_2_24.log
-rw-rw-r-- 1 hpc hpc 1167 Dec 17 10:07 himeno_48_1_1_48.log
hpc@hpc-machine:~/himeno$ 

の様に書き込まれます。

上記の結果から、最後のMFLOPS値とdecompの行だけを取り出すスクリプトexresを作ります。

hpc@hpc-machine:~/himeno$ cat exres.sh 
#!/bin/bash
param_count=$#
if [ $param_count -eq 0 ]; then
  echo "パラメータが指定されていません。"
  exit 1
fi
for param in "$@"; do
  tail -n 2 $param|grep MFLOPS|cut -c 13-30|tr '\n' ' '
  grep decomp $param
done
hpc@hpc-machine:~/himeno$ 

このスクリプトを使って、各ファイルの速度とグリッド分割数を取り出すと

hpc@hpc-machine:~/himeno$ ./exres.sh logdir/*
168468.826536138     I-decomp=            1  J-decomp=           12  K-decomp=            4
154723.793917601     I-decomp=            1  J-decomp=            1  K-decomp=           48
169956.715985419     I-decomp=            1  J-decomp=           16  K-decomp=            3
138511.610268301     I-decomp=           12  J-decomp=            1  K-decomp=            4
146283.686337229     I-decomp=           12  J-decomp=            2  K-decomp=            2
157037.523314861     I-decomp=            1  J-decomp=            2  K-decomp=           24
146283.140513876     I-decomp=           12  J-decomp=            4  K-decomp=            1
171365.142157409     I-decomp=            1  J-decomp=           24  K-decomp=            2
158012.017018905     I-decomp=            1  J-decomp=            3  K-decomp=           16
158853.208604912     I-decomp=            1  J-decomp=            4  K-decomp=           12
157992.998183273     I-decomp=            1  J-decomp=           48  K-decomp=            1
137087.059257926     I-decomp=           16  J-decomp=            1  K-decomp=            3
141422.018978759     I-decomp=           16  J-decomp=            3  K-decomp=            1
161862.200533065     I-decomp=            1  J-decomp=            6  K-decomp=            8
167080.150327140     I-decomp=            1  J-decomp=            8  K-decomp=            6
170859.547714754     I-decomp=            2  J-decomp=           12  K-decomp=            2
154276.344988048     I-decomp=            2  J-decomp=            1  K-decomp=           24
155720.970322314     I-decomp=            2  J-decomp=            2  K-decomp=           12
165127.491795655     I-decomp=            2  J-decomp=           24  K-decomp=            1
157364.400504571     I-decomp=            2  J-decomp=            3  K-decomp=            8
130373.490005853     I-decomp=           24  J-decomp=            1  K-decomp=            2
130055.295142343     I-decomp=           24  J-decomp=            2  K-decomp=            1
161606.378029029     I-decomp=            2  J-decomp=            4  K-decomp=            6
164950.223238516     I-decomp=            2  J-decomp=            6  K-decomp=            4
167077.181685984     I-decomp=            2  J-decomp=            8  K-decomp=            3
153666.259947256     I-decomp=            3  J-decomp=            1  K-decomp=           16
164819.998530470     I-decomp=            3  J-decomp=           16  K-decomp=            1
155036.372239202     I-decomp=            3  J-decomp=            2  K-decomp=            8
158174.230801513     I-decomp=            3  J-decomp=            4  K-decomp=            4
167730.196103885     I-decomp=            3  J-decomp=            8  K-decomp=            2
153512.287912255     I-decomp=            4  J-decomp=            1  K-decomp=           12
167339.601364427     I-decomp=            4  J-decomp=           12  K-decomp=            1
156017.933398773     I-decomp=            4  J-decomp=            2  K-decomp=            6
157875.068332871     I-decomp=            4  J-decomp=            3  K-decomp=            4
162614.200892208     I-decomp=            4  J-decomp=            4  K-decomp=            3
168178.723498849     I-decomp=            4  J-decomp=            6  K-decomp=            2
110751.192433060     I-decomp=           48  J-decomp=            1  K-decomp=            1
149699.950102608     I-decomp=            6  J-decomp=            1  K-decomp=            8
153138.613824420     I-decomp=            6  J-decomp=            2  K-decomp=            4
163121.758382322     I-decomp=            6  J-decomp=            4  K-decomp=            2
161695.427157914     I-decomp=            6  J-decomp=            8  K-decomp=            1
146504.033741900     I-decomp=            8  J-decomp=            1  K-decomp=            6
153169.780464314     I-decomp=            8  J-decomp=            2  K-decomp=            3
160842.083021756     I-decomp=            8  J-decomp=            3  K-decomp=            2
159667.969823147     I-decomp=            8  J-decomp=            6  K-decomp=            1
hpc@hpc-machine:~/himeno$ 

となります。ソートしてわかりやすくしましょう。

hpc@hpc-machine:~/himeno$ ./exres.sh logdir/*|sort -r
171365.142157409     I-decomp=            1  J-decomp=           24  K-decomp=            2
170859.547714754     I-decomp=            2  J-decomp=           12  K-decomp=            2
169956.715985419     I-decomp=            1  J-decomp=           16  K-decomp=            3
168468.826536138     I-decomp=            1  J-decomp=           12  K-decomp=            4
168178.723498849     I-decomp=            4  J-decomp=            6  K-decomp=            2
167730.196103885     I-decomp=            3  J-decomp=            8  K-decomp=            2
167339.601364427     I-decomp=            4  J-decomp=           12  K-decomp=            1
167080.150327140     I-decomp=            1  J-decomp=            8  K-decomp=            6
167077.181685984     I-decomp=            2  J-decomp=            8  K-decomp=            3
165127.491795655     I-decomp=            2  J-decomp=           24  K-decomp=            1
164950.223238516     I-decomp=            2  J-decomp=            6  K-decomp=            4
164819.998530470     I-decomp=            3  J-decomp=           16  K-decomp=            1
163121.758382322     I-decomp=            6  J-decomp=            4  K-decomp=            2
162614.200892208     I-decomp=            4  J-decomp=            4  K-decomp=            3
161862.200533065     I-decomp=            1  J-decomp=            6  K-decomp=            8
161695.427157914     I-decomp=            6  J-decomp=            8  K-decomp=            1
161606.378029029     I-decomp=            2  J-decomp=            4  K-decomp=            6
160842.083021756     I-decomp=            8  J-decomp=            3  K-decomp=            2
159667.969823147     I-decomp=            8  J-decomp=            6  K-decomp=            1
158853.208604912     I-decomp=            1  J-decomp=            4  K-decomp=           12
158174.230801513     I-decomp=            3  J-decomp=            4  K-decomp=            4
158012.017018905     I-decomp=            1  J-decomp=            3  K-decomp=           16
157992.998183273     I-decomp=            1  J-decomp=           48  K-decomp=            1
157875.068332871     I-decomp=            4  J-decomp=            3  K-decomp=            4
157364.400504571     I-decomp=            2  J-decomp=            3  K-decomp=            8
157037.523314861     I-decomp=            1  J-decomp=            2  K-decomp=           24
156017.933398773     I-decomp=            4  J-decomp=            2  K-decomp=            6
155720.970322314     I-decomp=            2  J-decomp=            2  K-decomp=           12
155036.372239202     I-decomp=            3  J-decomp=            2  K-decomp=            8
154723.793917601     I-decomp=            1  J-decomp=            1  K-decomp=           48
154276.344988048     I-decomp=            2  J-decomp=            1  K-decomp=           24
153666.259947256     I-decomp=            3  J-decomp=            1  K-decomp=           16
153512.287912255     I-decomp=            4  J-decomp=            1  K-decomp=           12
153169.780464314     I-decomp=            8  J-decomp=            2  K-decomp=            3
153138.613824420     I-decomp=            6  J-decomp=            2  K-decomp=            4
149699.950102608     I-decomp=            6  J-decomp=            1  K-decomp=            8
146504.033741900     I-decomp=            8  J-decomp=            1  K-decomp=            6
146283.686337229     I-decomp=           12  J-decomp=            2  K-decomp=            2
146283.140513876     I-decomp=           12  J-decomp=            4  K-decomp=            1
141422.018978759     I-decomp=           16  J-decomp=            3  K-decomp=            1
138511.610268301     I-decomp=           12  J-decomp=            1  K-decomp=            4
137087.059257926     I-decomp=           16  J-decomp=            1  K-decomp=            3
130373.490005853     I-decomp=           24  J-decomp=            1  K-decomp=            2
130055.295142343     I-decomp=           24  J-decomp=            2  K-decomp=            1
110751.192433060     I-decomp=           48  J-decomp=            1  K-decomp=            1
hpc@hpc-machine:~/himeno$ 

となりグリッドの分割方法によって、性能が大きく変わることがわかります。