gcc -v
回显信息显示如下表示GCC 7.3.0已安装:
gcc version 7.3.0(GCC);
libtool --version
回显信息显示如下表示libtool 2.4.2已安装:
libtool (GNU libtool) 2.4.2
Hyper MPI包含ompi和ucx两个软件层,其中ompi的安装依赖于ucx,编译时应先编译ucx。
git clone https://github.com/kunpengcompute/hucx。
git clone https://github.com/kunpengcompute/xucg。
tar -xzvf hucx-huawei.tar.gz
tar -xzvf xucg-huawei.tar.gz
/where/to/download/ucx:代表ucx源码包上传后的存放路径。
./contrib/configure-opt --prefix=/where/to/install/ucx
环境上若没有安装numactl插件,则需要执行如下命令,指定--disable-numa参数:
./contrib/configure-opt --prefix=/where/to/install/ucx --disable-numa
make -j32
make -j32 install
make后面-j参数是并行编译参数,指的是有多少CPU核心参与编译过程,需用户根据实际CPU核数进行指定。
git clone https://github.com/kunpengcompute/hmpi。
/where/to/download/ompi:代表ompi源码包上传后的存放路径。
./configure --prefix=/where/to/install/ompi --with-platform=contrib/platform/mellanox/optimized --enable-mpi1-compatibility --with-ucx=/where/to/install/ucx
make
make install
可通过environment-modules工具和写入~/.bashrc文件两种方式配置环境变量。
vim /path/to/install/Hmpi_modulefiles
修改内容如下:
#%Module1.0 # HMPI module for use with 'environment-modules' package: conflict mpi prepend-path OPAL_PREFIX /path/to/install/ompi/ prepend-path PATH /path/to/install/ompi/bin:/path/to/install/ucx/bin prepend-path LD_LIBRARY_PATH /path/to/install/ompi/lib:/path/to/install/ucx/lib prepend-path INCLUDE /path/to/install/ompi/include
/path/to/install:表示environment-modules工具的安装路径。用户若不指定安装路径,则默认安装在/usr/share/Modules/modulefiles路径下。
module use /usr/share/Modules/modulefiles
module load /usr/share/Modules/modulefiles/Hmpi_modulefiles
配置环境变量主要是将hucx和hmpi加入到PATH和LD_LIBRARY_PATH中:
export PATH=/where/to/install/ompi/bin:/where/to/install/ucx/bin:$PATH
export LD_LIBRARY_PATH=/where/to/install/ompi/lib:/where/to/install/ucx/lib:$LD_LIBRARY_PATH
export PATH=/where/to/install/ompi/bin:/where/to/install/ucx/bin:$PATH
export LD_LIBRARY_PATH=/where/to/install/ompi/lib:/where/to/install/ucx/lib:$LD_LIBRARY_PATH