クラスタヘッドノードでlinpackを実行できません。

クラスタヘッドノードでlinpackを実行できません。

私は最近、独自のホームクラスター(Raspberry Pi 4個)を作成しました。しかし、Linpackを使用して4つのユニットすべてをベンチマークしようとすると問題が発生します。

ノードの1つは、wlan0インターフェイスを使用してインターネットとローカルWi-Fiネットワークに接続し、eth0を使用してクラスタの内部LANに接続するrpislave1というヘッドノードです。

他の3つのノードはrpislave2、rpislave3、およびrpislave4です。それぞれはヘッドノードであるrpislave1に接続されており、rpislave1を介してインターネットにアクセスします。簡単にするために、3つのノードはrpislave1に接続されているフラッシュドライブからネットワーク起動します。

すべてのデバイスは、MACアドレスを使用してdhcpを介して独自のIPアドレスを割り当てました。

ヘッドノードの /etc/hosts ファイルです。

127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1 cluster

192.168.50.1    rpislave1 cluster
192.168.50.11   rpislave2
192.168.50.12   rpislave3
192.168.50.13   rpislave4

すべてのデバイスはrpislave1からSSH経由でアクセスでき、パスワードは必要なく、rpislave1にマウントされたサムドライブに接続されている/sharezoneでNFSドライブを共有します。

私は学習経験に非常に満足しており、HPLまたはlinpackを使用してrpislave1、rpislave2、rpislave3、およびrpislave4クラスタの完全な処理をベンチマークすることにしました。https://www.netlib.org/benchmark/hpl/

ヘッドノードrpislave1にOpenMPIのインストールを開始しました。

独自の時計は15GFlopsで動作します。確かに誇りに思うわけではありませんが、面白いです。その後、rpislave2にlinpackとopenmpiを設定し、残りのデバイス(rpislave3とrpislave4)などに対して独立したテストを行いました。

そのため、rpislave1とrpislave2という2つのノードで実行してみることにしました。

これが私が2つのノードに使用しているHPL.datですが、私が使用しているHPL.datに問題があるようではありません。

HPLinpack benchmark input file
Innovative Computing Laboratory, University of Tennessee
HPL.out      output file name (if any) 
6            device out (6=stdout,7=stderr,file)
1            # of problems sizes (N)
40704         Ns
1            # of NBs
192           NBs
0            PMAP process mapping (0=Row-,1=Column-major)
1            # of process grids (P x Q)
2            Ps
4            Qs
16.0         threshold
1            # of panel fact
2            PFACTs (0=left, 1=Crout, 2=Right)
1            # of recursive stopping criterium
4            NBMINs (>= 1)
1            # of panels in recursion
2            NDIVs
1            # of recursive panel fact.
1            RFACTs (0=left, 1=Crout, 2=Right)
1            # of broadcast
1            BCASTs (0=1rg,1=1rM,2=2rg,3=2rM,4=Lng,5=LnM)
1            # of lookahead depth
1            DEPTHs (>=0)
2            SWAP (0=bin-exch,1=long,2=mix)
64           swapping threshold
0            L1 in (0=transposed,1=no-transposed) form
0            U  in (0=transposed,1=no-transposed) form
1            Equilibration (0=no,1=yes)
8            memory alignment in double (> 0)
##### This line (no. 32) is ignored (it serves as a separator). ######
0                               Number of additional problem sizes for PTRANS
1200 10000 30000                values of N
0                               number of additional blocking sizes for PTRANS
40 9 8 13 13 20 16 32 64        values of NB

あるいは、ホストファイルを作成して使用することもできます。

user@rpislave1:/sharezone/hpl $ cat host_file
rpislave1 slots=4
rpislave2 slots=4

これは私が使用するコマンドです:

 time mpirun -hostfile host_file -np 8 /sharezone/xhpl/bin/xhpl

しかし、私が得た結果は次のとおりです。

user@rpislave1:/sharezone/hpl $ time mpirun -hostfile host_file -np 8 /sharezone/xhpl/bin/xhpl
================================================================================
HPLinpack 2.3  --  High-Performance Linpack benchmark  --   December 2, 2018
Written by A. Petitet and R. Clint Whaley,  Innovative Computing Laboratory, UTK
Modified by Piotr Luszczek, Innovative Computing Laboratory, UTK
Modified by Julien Langou, University of Colorado Denver
================================================================================

An explanation of the input/output parameters follows:
T/V    : Wall time / encoded variant.
N      : The order of the coefficient matrix A.
NB     : The partitioning blocking factor.
P      : The number of process rows.
Q      : The number of process columns.
Time   : Time in seconds to solve the linear system.
Gflops : Rate of execution for solving the linear system.

The following parameter values will be used:

N      :   40704
NB     :     192
PMAP   : Row-major process mapping
P      :       2
Q      :       4
PFACT  :   Right
NBMIN  :       4
NDIV   :       2
RFACT  :   Crout
BCAST  :  1ringM
DEPTH  :       1
SWAP   : Mix (threshold = 64)
L1     : transposed form
U      : transposed form
EQUIL  : yes
ALIGN  : 8 double precision words

--------------------------------------------------------------------------------

- The matrix A is randomly generated for each test.
- The following scaled residual check will be computed:
      ||Ax-b||_oo / ( eps * ( || x ||_oo * || A ||_oo + || b ||_oo ) * N )
- The relative machine precision (eps) is taken to be               1.110223e-16
- Computational tests pass if scaled residuals are less than                16.0

--------------------------------------------------------------------------
Open MPI detected an inbound MPI TCP connection request from a peer
that appears to be part of this MPI job (i.e., it identified itself as
part of this Open MPI job), but it is from an IP address that is
unexpected.  This is highly unusual.

The inbound connection has been dropped, and the peer should simply
try again with a different IP interface (i.e., the job should
hopefully be able to continue).

  Local host:          rpislave2
  Local PID:           1574
  Peer hostname:       rpislave1 ([[58941,1],2])
  Source IP of socket: 192.168.50.1
  Known IPs of peer:
        169.254.131.47
--------------------------------------------------------------------------

この問題の原因は何であるかはわかりませんが、rpislave2、rpislave3、rpislave4、または2の組み合わせでlinpackテストを実行すると問題なく動作することがわかりました。

これにより、ヘッドノード rpislave1 で実行できなくなります。

数日間、さまざまな手順を試してみましたが、オープンMPIがローカルWi-Fiネットワークに接続するためにヘッドノードのwlan0にアクセスしているようで、 "--mca btl_tcp_if_exclude wlan0"または他のmcaオプションを試してみました。何の効果もありません。 Githubの問題も見つけましたが、すべて修正されたようですので、最新のパッチが必要です。これは私が持っているopenmpiのバージョンです。

user@rpislave1:/sharezone/hpl $ sudo apt install openmpi-bin openmpi-common libopenmpi3 libopenmpi-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libopenmpi-dev is already the newest version (4.1.0-10).
libopenmpi3 is already the newest version (4.1.0-10).
openmpi-bin is already the newest version (4.1.0-10).
openmpi-common is already the newest version (4.1.0-10).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
user@rpislave1:/sharezone/hpl $

「Open MPIがこのMPI操作の一部であるように見えるピアからのインバウンドMPI TCP接続要求を検出しました。」エラーの原因を知っている人はいますか?私はこれがwlan0インターフェースに関連していると思います。

 Known IPs of peer:
        169.254.131.47

Tracerouteはこの結果を示しています

user@rpislave1:/sharezone/hpl $ traceroute 169.254.131.47
traceroute to 169.254.131.47 (169.254.131.47), 30 hops max, 60 byte packets
 1  rpislave1.local (169.254.131.47)  0.192 ms  0.107 ms  0.096 ms
user@rpislave1:/sharezone/hpl $

これはrpislave1 / headノードのifconfigです。

user@rpislave1:/sharezone/hpl $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.50.1  netmask 255.255.255.0  broadcast 192.168.50.255
        inet6 fe80::d314:681c:2e82:d5bc  prefixlen 64  scopeid 0x20<link>
        ether d8:3a:dd:1d:92:15  txqueuelen 1000  (Ethernet)
        RX packets 962575  bytes 911745808 (869.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 590397  bytes 382892062 (365.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 3831  bytes 488990 (477.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3831  bytes 488990 (477.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.101.15  netmask 255.255.255.0  broadcast 192.168.101.255
        inet6 2001:f40:950:b164:806e:1571:b836:23a4  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::1636:9990:bd05:dd05  prefixlen 64  scopeid 0x20<link>
        ether d8:3a:dd:1d:92:16  txqueuelen 1000  (Ethernet)
        RX packets 44632  bytes 12764596 (12.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 74151  bytes 13143926 (12.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

user@rpislave1:/sharezone/hpl $

この問題の解決にご協力いただきありがとうございます。

ベストアンサー1

ついに問題を見つけて解決しました。

私はrpislave1 2つのIPアドレス(192.168.50.1(rpislave1に設定したDHCPサーバーから来たもの)と別の169.254.131.47)にeth0を提供していることを発見しました。これにより、Open MPIがmpirunアドレスの間に混乱しました。問題は - プロセスとは何ですか? rpislave1は、すべてのRaspberry Piの内部ネットワーク(範囲192.168.50.0/24)と外部世界への接続用のDHCPサーバーなので、net.ipv4.ip_forward = 1でiptablesだと思いました。いいえ、いくつかのテストを行いました。まったく効果がありません。

次に、ラズベリーパイが同じネットワークインターフェイスに2つのIPアドレスを持つ理由を調べ、dhcpcd.serviceを見つけました。

user@rpislave1:/etc $ sudo systemctl status  dhcpcd.service
● dhcpcd.service - DHCP Client Daemon
     Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/dhcpcd.service.d
             └─wait.conf
     Active: active (running) since Fri 2023-07-28 16:22:45 +08; 16min ago
       Docs: man:dhcpcd(8)
    Process: 473 ExecStart=/usr/sbin/dhcpcd -w -q (code=exited, status=0/SUCCESS)
      Tasks: 2 (limit: 8755)
        CPU: 685ms
     CGroup: /system.slice/dhcpcd.service
             ├─564 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0
             └─765 dhcpcd: [master] [ip4] [ip6]

Jul 28 16:22:42 rpislave1 dhcpcd[473]: eth0: probing for an IPv4LL address
Jul 28 16:22:45 rpislave1 dhcpcd[473]: forked to background, child pid 765
Jul 28 16:22:45 rpislave1 systemd[1]: Started DHCP Client Daemon.
Jul 28 16:22:45 rpislave1 dhcpcd[765]: wlan0: leased 192.168.101.15 for 259200 seconds
Jul 28 16:22:45 rpislave1 dhcpcd[765]: wlan0: adding route to 192.168.101.0/24
Jul 28 16:22:45 rpislave1 dhcpcd[765]: wlan0: adding default route via 192.168.101.1
Jul 28 16:22:47 rpislave1 dhcpcd[765]: eth0: using IPv4LL address 169.254.131.47
Jul 28 16:22:47 rpislave1 dhcpcd[765]: eth0: adding route to 169.254.0.0/16
Jul 28 16:22:50 rpislave1 dhcpcd[765]: eth0: offered 192.168.50.1 from 192.168.50.1
Jul 28 16:22:51 rpislave1 dhcpcd[765]: eth0: no IPv6 Routers available

DHCP要求を送信する前にIPv4LLを割り当てたサービスを見つけます(ただし、同じデバイスにあります)。このIPv4LLは、同じサーバー上で稼働しているDHCPサーバーからIPアドレスを取得する前に、IPアドレスとパスを設定します。しかし、169.254.0.0/16へのパスは削除されないようです(rpislave.localで再利用されると疑われますが、これは私の目的には関係ありません)。

dhcpcd.serviceを見て、このオプションが見つかりました。

Local Link configuration
If dhcpcd failed to obtain a lease, it probes for a valid IPv4LL address (aka ZeroConf, aka APIPA). Once obtained it restarts the process of looking for a DHCP server to get a proper address.

When using IPv4LL, dhcpcd nearly always succeeds and returns an exit code of 0. In the rare case it fails, it normally means that there is a reverse ARP proxy installed which always defeats IPv4LL probing. To disable this behaviour, you can use the -L, --noipv4ll option.

したがって、/etc/systemd/system/dhcpcd.service.d の wait.conf ファイルが編集されました。これらすべての詳細は、上記のステータスコードにあります。

[Service]
ExecStart=
ExecStart=/usr/sbin/dhcpcd -w -q --noipv4ll

再起動してdhcpcdをもう一度確認してください。

user@rpislave1:/etc/systemd/system/dhcpcd.service.d $ sudo systemctl status  dhcpcd.service
● dhcpcd.service - DHCP Client Daemon
     Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/dhcpcd.service.d
             └─wait.conf
     Active: active (running) since Fri 2023-07-28 16:44:15 +08; 3min 17s ago
       Docs: man:dhcpcd(8)
    Process: 472 ExecStart=/usr/sbin/dhcpcd -w -q --noipv4ll (code=exited, status=0/SUCCESS)
      Tasks: 2 (limit: 8755)
        CPU: 619ms
     CGroup: /system.slice/dhcpcd.service
             ├─568 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0
             └─775 dhcpcd: [master] [ip4] [ip6]

Jul 28 16:44:10 rpislave1 dhcpcd[472]: wlan0: adding route to 2001:f40:950:b164::/64
Jul 28 16:44:10 rpislave1 dhcpcd[472]: wlan0: requesting DHCPv6 information
Jul 28 16:44:10 rpislave1 dhcpcd[472]: wlan0: adding default route via fe80::101
Jul 28 16:44:15 rpislave1 dhcpcd[472]: wlan0: leased 192.168.101.15 for 259200 seconds
Jul 28 16:44:15 rpislave1 dhcpcd[472]: wlan0: adding route to 192.168.101.0/24
Jul 28 16:44:15 rpislave1 dhcpcd[472]: wlan0: adding default route via 192.168.101.1
Jul 28 16:44:15 rpislave1 dhcpcd[472]: forked to background, child pid 775
Jul 28 16:44:15 rpislave1 systemd[1]: Started DHCP Client Daemon.
Jul 28 16:44:19 rpislave1 dhcpcd[775]: eth0: offered 192.168.50.1 from 192.168.50.1
Jul 28 16:44:21 rpislave1 dhcpcd[775]: eth0: no IPv6 Routers available
user@rpislave1:/etc/systemd/system/dhcpcd.service.d $

そして、「eth0:IPv4LLアドレス169.254.131.47を使用」のパスはまったく設定されていません。

それで、クラスタ全体をテストし始めました。

user@rpislave1:/sharezone/ClusterProcessing/HPL $  time mpirun -hostfile ../host_file -np 16 /sharezone/xhpl/bin/xhpl |tee HPL.log
================================================================================
HPLinpack 2.3  --  High-Performance Linpack benchmark  --   December 2, 2018
Written by A. Petitet and R. Clint Whaley,  Innovative Computing Laboratory, UTK
Modified by Piotr Luszczek, Innovative Computing Laboratory, UTK
Modified by Julien Langou, University of Colorado Denver
================================================================================

An explanation of the input/output parameters follows:
T/V    : Wall time / encoded variant.
N      : The order of the coefficient matrix A.
NB     : The partitioning blocking factor.
P      : The number of process rows.
Q      : The number of process columns.
Time   : Time in seconds to solve the linear system.
Gflops : Rate of execution for solving the linear system.

The following parameter values will be used:

N      :   57600
NB     :     192
PMAP   : Row-major process mapping
P      :       4
Q      :       4
PFACT  :   Right
NBMIN  :       4
NDIV   :       2
RFACT  :   Crout
BCAST  :  1ringM
DEPTH  :       1
SWAP   : Mix (threshold = 64)
L1     : transposed form
U      : transposed form
EQUIL  : yes
ALIGN  : 8 double precision words

--------------------------------------------------------------------------------

- The matrix A is randomly generated for each test.
- The following scaled residual check will be computed:
      ||Ax-b||_oo / ( eps * ( || x ||_oo * || A ||_oo + || b ||_oo ) * N )
- The relative machine precision (eps) is taken to be               1.110223e-16
- Computational tests pass if scaled residuals are less than                16.0

================================================================================
T/V                N    NB     P     Q               Time                 Gflops
--------------------------------------------------------------------------------
WR11C2R4       57600   192     4     4            2558.14             4.9804e+01
HPL_pdgesv() start time Fri Jul 28 16:55:04 2023

HPL_pdgesv() end time   Fri Jul 28 17:37:42 2023

--------------------------------------------------------------------------------
||Ax-b||_oo/(eps*(||A||_oo*||x||_oo+||b||_oo)*N)=   3.39874554e-03 ...... PASSED
================================================================================

Finished      1 tests with the following results:
              1 tests completed and passed residual checks,
              0 tests completed and failed residual checks,
              0 tests skipped because of illegal input values.
--------------------------------------------------------------------------------

End of Tests.
================================================================================
[rpislave4:00682] PMIX ERROR: NO-PERMISSIONS in file ../../../../../../src/mca/common/dstore/dstore_base.c at line 237
[rpislave3:00688] PMIX ERROR: NO-PERMISSIONS in file ../../../../../../src/mca/common/dstore/dstore_base.c at line 237
[rpislave2:00696] PMIX ERROR: NO-PERMISSIONS in file ../../../../../../src/mca/common/dstore/dstore_base.c at line 237

real    43m33.445s
user    141m36.616s
sys     28m21.561s
user@rpislave1:/sharezone/ClusterProcessing/HPL $

そして効果がありますよ〜!これで、ヘッドを含む4つのユニットすべてに対して全体のベンチマークができるようになりました〜!

おすすめ記事