## 依賴 sudo apt install build-essential hwloc libhwloc-dev libevent-dev gfortran ## 編譯 OpenBLAS ``` $ git clone https://github.com/xianyi/OpenBLAS.git $ cd OpenBLAS $ git checkout v0.3.21 $ make $ make PREFIX=$HOME/opt/OpenBLAS install ``` ::: warning make不了  應該是虛擬機記憶體不足造成 ::: :::success 在增加記憶體後成功  測試  ::: ## 編譯OpenMPI ``` $ wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.4.tar.gz $ tar xf openmpi-4.1.4.tar.gz $ cd openmpi-4.1.4 $ CFLAGS="-Ofast -march=native" ./configure --prefix=$HOME/opt/OpenMPI $ make -j 16 $ make install ``` ## 設定環境變數 ``` export MPI_HOME=$HOME/opt/OpenMPI export PATH=$PATH:$MPI_HOME/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MPI_HOME/lib ``` source ~/.bashrc ## 編譯HPL 下載 ``` $ wget https://netlib.org/benchmark/hpl/hpl-2.3.tar.gz $ gunzip hpl-2.3.tar.gz $ tar xvf hpl-2.3.tar $ rm hpl-2.3.tar $ mv hpl-2.3 ~/hpl ``` 編譯 ``` $ cd hpl/setup $ sh make_generic $ cp Make.UNKNOWN ../Make.linux $ cd ../ # Specify the paths to libraries $ nano Make.linux ``` 修改makefile ``` ARCH = linux MPdir = $(HOME)/opt/OpenMPI MPinc = -I$(MPdir)/include MPlib = $(MPdir)/lib/libmpi.so LAdir = $(HOME)/opt/OpenBLAS LAinc = LAlib = $(LAdir)/lib/libopenblas.a ``` $ make arch=linux ::: warning 不知道哪來的空格  ::: :::success 它偷偷藏在後面 ``` # MPdir =$(HOME)/opt/OpenMPI MPinc =-I$(MPdir)/include MPlib =$(MPdir)/lib/libmpi.so # ``` ::: 編譯成功  - 單cpu  - 多cpu ``` mpirun -np 2 ./xhpl ```    - 多節點(cluster) ``` mpirun --hostfile ./hosts.list ./xhpl ``` ::: warning 由於重新編譯HPL,openMPI版本不同 => Segmentation fault    ::: ::: danger  orted是MPI的輔助程式 ::: ::: warning  非互動式ssh讀不到環境變數 In a non-interactive shell, `.bashrc` and `.profile` files do not get executed. This is because these files usually contain setup commands that are meant to be run when a user logs in, such as setting environment variables or defining aliases. Since a non-interactive shell doesn’t have a user to log in, these files aren’t needed. => `.bashrc` 前面有一段是遇到非互動式ssh會直接return,所以要在這段前面改環境變數。  ::: =>可以直接指定  ::: success   ::: ### 編譯intel MKL ### To do MPI的參數編譯 可以更換OpenBLAS(MKL) HPL.dat的參數測試 用更好的CPU(更多核心)測試 嘗試module file、腳本 ### 參數調校 ``` ================================================================================ T/V N NB P Q Time Gflops -------------------------------------------------------------------------------- WR11R2R4 18000 512 1 4 196.45 1.9794e+01 HPL_pdgesv() start time Sat May 24 15:54:34 2025 HPL_pdgesv() end time Sat May 24 15:57:51 2025 -------------------------------------------------------------------------------- ||Ax-b||_oo/(eps*(||A||_oo*||x||_oo+||b||_oo)*N)= 2.08450229e-03 ...... PASSED ================================================================================ ``` ### 參考連結 -[(https://www.mgaillard.fr/2022/08/27/benchmark-with-hpl.html)](https://www.mgaillard.fr/2022/08/27/benchmark-with-hpl.html)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up