Installing Hyper MPI Using Source Code
Prerequisites
- perl-Data-Dumper
- autoconf
- automake
- libtool 2.4.2
- GCC 9.3.0/BiSheng Compiler 2.3.0
Before installing GCC 9.3.0/BiSheng Compiler 2.3.0, install the following dependencies in sequence: gmp-6.2.0.tar.bz2, mpfr-4.0.2.tar.bz2, mpc-1.1.0.tar.gz, and isl-0.18.tar.bz2.
- numactl
- binutils
- systemd-devel
- valgrind
- cmake3
Checking Compilation Environment Variables
- Use PuTTY to log in to the job execution node as the Hyper MPI installation and maintenance user, for example, hmpi_master.
- Check whether GCC 9.3.0/BiSheng Compiler 2.3.0 has been installed.
- Run the following command to check whether libtool has been installed:
libtool --version
Check whether libtool 2.4.2 is displayed in the command output:
Compiling the Hyper MPI Software Package Using GCC
Hyper MPI consists of two software layers: Hyper MPI and HUCX. The Hyper MPI installation depends on HUCX. Build HUCX before building Hyper MPI.
- Building HUCX
- Use PuTTY to log in to the job execution node as the Hyper MPI installation and maintenance user, for example, hmpi_master.
- Download the HUCX source package ucx-1.10.1.tar.gz.
https://github.com/openucx/ucx/archive/refs/tags/v1.10.1.tar.gz
- Upload the source package to the installation directory of the HUCX source package on the server, for example, /path/to/download/hucx.
- Run the following command to go to the installation directory of the HUCX source package:
- Run the following command to decompress the source package:
- Run the following command to go to the directory where the autogen.sh script is stored:
cd ucx-1.10.1/
- Run the following commands to install the source package:
./contrib/configure-opt --prefix=/path/to/install/hucx --enable-mt CC=gcc CXX=g++ FC=gfortran
- If GPU-aware is required and CUDA has been installed in the environment, run the following command to specify the --with-cuda option:
./contrib/configure-opt --prefix=/path/to/install/hucx --with-cuda=/path/to/install/cuda --enable-mt CC=gcc CXX=g++ FC=gfortran
- If the numactl plugin has not been installed, run the following command to specify the --disable-numa parameter:
./contrib/configure-opt --prefix=/path/to/install/hucx --disable-numa --enable-mt CC=gcc CXX=g++ FC=gfortran
- /path/to/install/hucx indicates the HUCX installation path.
- /path/to/install/cuda indicates the CUDA installation path.
make -j32
make -j32 install
The -j parameter following make is a parallel compilation parameter, indicating the number of CPU cores involved in the compilation process. Specify this parameter based on the actual number of CPU cores.
- If GPU-aware is required and CUDA has been installed in the environment, run the following command to specify the --with-cuda option:
- Run the following command to load the HUCX library:
export LD_LIBRARY_PATH=/path/to/install/hucx/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=/path/to/install/hucx/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/path/to/install/hucx/include:$CPLUS_INCLUDE_PATH
- Building XUCG
- Download the XUCG source package xucg-v1.3.0-huawei.tar.gz.
https://gitee.com/kunpengcompute/xucg/archive/refs/tags/v1.3.0-huawei.tar.gz
- Upload the source package to the installation directory of the XUCG source package on the server, for example, /path/to/download/xucg.
- Run the following command to go to the installation directory of the XUCG source package:
- Run the following command to decompress the source package:
- Run the following command to go to the directory where CMakeLists.txt is located:
cd xucg-v1.3.0-huawei/
- Run the following commands to install the source package:
cmake3 .. -DCMAKE_INSTALL_PREFIX=/path/to/install/xucg -DCMAKE_BUILD_TYPE=Release -DUCG_BUILD_WITH_UCX=/path/to/install/hucx -DUCG_ENABLE_MT=ON -DUCG_BUILD_TESTS=OFF -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran
/path/to/install/xucg indicates the XUCG installation path.
make -j32
make -j32 install
The -j parameter following make is a parallel compilation parameter, indicating the number of CPU cores involved in the compilation process. Specify this parameter based on the actual number of CPU cores.
- Run the following command to load the XUCG library:
export LD_LIBRARY_PATH=/path/to/install/xucg/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=/path/to/install/xucg/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/path/to/install/xucg/include:$CPLUS_INCLUDE_PATH
- Download the XUCG source package xucg-v1.3.0-huawei.tar.gz.
- Building Hyper MPI
- Use PuTTY to log in to the job execution node as the Hyper MPI installation and maintenance user, for example, hmpi_master.
- Download the Hyper MPI source package hmpi-v1.3.0-huawei.tar.gz.
https://gitee.com/kunpengcompute/hmpi/archive/refs/tags/v1.3.0-huawei.tar.gz
- Upload the source package to its installation directory on the server, for example, /path/to/download/hmpi.
- Run the following command to go to the installation directory:
- Run the following command to decompress the software package:
- Run the following command to go to the directory where the autogen.pl script is stored:
cd hmpi-v1.3.0-huawei/
- Run the following commands to install the Hyper MPI source package:
./autogen.pl
./configure --prefix=/path/to/install/hmpi --with-platform=contrib/platform/mellanox/optimized --enable-mpi1-compatibility --with-ucx=/path/to/install/hucx --with-ucg=/path/to/install/xucg CC=gcc CXX=g++ FC=gfortran
make
make install
- If GPU-aware is required and CUDA has been installed in the environment, run the following command to specify the --with-cuda option:
./configure --prefix=/path/to/install/hmpi --with-platform=contrib/platform/mellanox/optimized --with-cuda=/path/to/install/cuda --enable-mpi1-compatibility --with-ucx=/path/to/install/hucx --with-ucg=/path/to/install/xucg CC=gcc CXX=g++ FC=gfortran
- /path/to/install/hmpi indicates the Hyper MPI installation path.
- /path/to/install/cuda indicates the CUDA installation path.
- /path/to/install/hucx indicates the HUCX installation path.
- /path/to/install/xucg indicates the XUCG installation path.
- If GPU-aware is required and CUDA has been installed in the environment, run the following command to specify the --with-cuda option:
Compiling the Hyper MPI Software Package Using BiSheng Compiler
Hyper MPI consists of two software layers: Hyper MPI and HUCX. The Hyper MPI installation depends on HUCX. Build HUCX before building Hyper MPI.
- Building HUCX
- Use PuTTY to log in to the job execution node as the Hyper MPI installation and maintenance user, for example, hmpi_master.
- Download the HUCX source package ucx-1.10.1.tar.gz.
https://github.com/openucx/ucx/archive/refs/tags/v1.10.1.tar.gz
- Upload the source package to the installation directory of the HUCX source package on the server, for example, /path/to/download/hucx.
- Run the following command to go to the installation directory of the HUCX source package:
- Run the following command to decompress the source package:
- Run the following command to go to the directory where the autogen.sh script is stored:
cd ucx-1.10.1/
- Run the following commands to install the source package:
./contrib/configure-opt --prefix=/path/to/install/hucx --enable-mt CC=clang CXX=clang++ FC=flang
- If GPU-aware is required and CUDA has been installed in the environment, run the following command to specify the --with-cuda option:
./contrib/configure-opt --prefix=/path/to/install/hucx --with-cuda=/path/to/install/cuda --enable-mt CC=clang CXX=clang++ FC=flang
- If the numactl plugin has not been installed, run the following command to specify the --disable-numa parameter:
./contrib/configure-opt --prefix=/path/to/install/hucx --disable-numa --enable-mt CC=clang CXX=clang++ FC=flang
- /path/to/install/hucx indicates the HUCX installation path.
- /path/to/install/cuda indicates the CUDA installation path.
make -j32
make -j32 install
The -j parameter following make is a parallel compilation parameter, indicating the number of CPU cores involved in the compilation process. Specify this parameter based on the actual number of CPU cores.
- If GPU-aware is required and CUDA has been installed in the environment, run the following command to specify the --with-cuda option:
- Run the following command to load the HUCX library:
export LD_LIBRARY_PATH=/path/to/install/hucx/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=/path/to/install/hucx/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/path/to/install/hucx/include:$CPLUS_INCLUDE_PATH
- Building XUCG
- Download the XUCG source package xucg-v1.3.0-huawei.tar.gz.
https://gitee.com/kunpengcompute/xucg/archive/refs/tags/v1.3.0-huawei.tar.gz
- Upload the source package to the installation directory of the XUCG source package on the server, for example, /path/to/download/xucg.
- Run the following command to go to the installation directory of the XUCG source package:
- Run the following command to decompress the source package:
- Run the following command to go to the directory where CMakeLists.txt is located:
cd xucg-v1.3.0-huawei/
- Run the following commands to install the source package:
cmake3 .. -DCMAKE_INSTALL_PREFIX=/path/to/install/xucg -DCMAKE_BUILD_TYPE=Release -DUCG_BUILD_WITH_UCX=/path/to/install/hucx -DUCG_ENABLE_MT=ON -DUCG_BUILD_TESTS=OFF -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_Fortran_COMPILER=flang
/path/to/install/xucg indicates the XUCG installation path.
make -j32
make -j32 install
The -j parameter following make is a parallel compilation parameter, indicating the number of CPU cores involved in the compilation process. Specify this parameter based on the actual number of CPU cores.
- Run the following command to load the XUCG library:
export LD_LIBRARY_PATH=/path/to/install/xucg/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=/path/to/install/xucg/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/path/to/install/xucg/include:$CPLUS_INCLUDE_PATH
Building Hyper MPI
- Use PuTTY to log in to the job execution node as the Hyper MPI installation and maintenance user, for example, hmpi_master.
- Download the Hyper MPI source package hmpi-v1.3.0-huawei.tar.gz.
https://gitee.com/kunpengcompute/hmpi/archive/refs/tags/v1.3.0-huawei.tar.gz
- Upload the source package to its installation directory on the server, for example, /path/to/download/hmpi.
- Run the following command to go to the installation directory:
- Run the following command to decompress the software package:
- Run the following command to go to the directory where the autogen.pl script is stored:
cd hmpi-v1.3.0-huawei/
- Run the following commands to install the Hyper MPI source package:
./autogen.pl
./configure --prefix=/path/to/install/hmpi --with-platform=contrib/platform/mellanox/optimized --enable-mpi1-compatibility --with-ucx=/path/to/install/hucx --with-ucg=/path/to/install/xucg CC=clang CXX=clang++ FC=flang
make
make install
- If GPU-aware is required and CUDA has been installed in the environment, run the following command to specify the --with-cuda option:
./configure --prefix=/path/to/install/hmpi --with-platform=contrib/platform/mellanox/optimized --with-cuda=/path/to/install/cuda --enable-mpi1-compatibility --with-ucx=/path/to/install/hucx --with-ucg=/path/to/install/xucg CC=clang CXX=clang++ FC=flang
- /path/to/install/hmpi indicates the Hyper MPI installation path.
- /path/to/install/cuda indicates the CUDA installation path.
- /path/to/install/hucx indicates the HUCX installation path.
- /path/to/install/xucg indicates the XUCG installation path.
- If GPU-aware is required and CUDA has been installed in the environment, run the following command to specify the --with-cuda option:
- Download the XUCG source package xucg-v1.3.0-huawei.tar.gz.
Configuring Environment Variables
- Use PuTTY to log in to a job execution node as a common Hyper MPI user, for example, hmpi_user.
- Run the following command to install the environment-modules tool:
- Create and edit the Hmpi_modulefiles configuration file in the environment-modules installation directory:
- Open the Hmpi_modulefiles configuration file.
vi /path/to/install/Hmpi_modulefiles
- Press i to enter the insert mode and modify the following content:
#%Module1.0 # HMPI module for use with 'environment-modules' package: conflict mpi prepend-path OPAL_PREFIX /path/to/install/hmpi/ prepend-path PATH /path/to/install/hmpi/bin:/path/to/install/hucx/bin:/path/to/install/xucg/bin prepend-path LD_LIBRARY_PATH /path/to/install/hmpi/lib:/path/to/install/hucx/lib:/path/to/install/xucg/lib prepend-path INCLUDE /path/to/install/hmpi/include:/path/to/install/hucx/include:/path/to/install/xucg/include
/path/to/install indicates the installation path of the environment-modules tool. If no installation path is specified, the default installation path /usr/share/Modules/modulefiles is used.
- Press Esc, type :wq!, and press Enter to save the settings and exit.
- Open the Hmpi_modulefiles configuration file.
- Run the following module commands to load environment variables in the tool installation path:
module use /path/to/install
module load /path/to/install/Hmpi_modulefiles
If the module command is unavailable, run the /usr/share/Modules/init/bash command for the command to take effect.
- Write the environment variables of Hyper MPI to the ~/.bashrc file.
- Open the ~/.bashrc file.
vi ~/.bashrc
- Press i to enter the insert mode and add the following content:
module use /path/to/install module load /path/to/install/Hmpi_modulefiles
- Press Esc, type :wq!, and press Enter to save the settings and exit.
The ~/.bashrc file of the default user should be in the shared directory. If the file is not in the shared directory, modify the ~/.bashrc file of each node.
- Open the ~/.bashrc file.
- Run the following command for the settings to take effect: