中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

源码安装Hyper MPI

前提条件

已完成以下依赖包的安装。
  • perl-Data-Dumper
  • autoconf
  • automake
  • libtool 2.4.2
  • GCC编译器9.3.0/毕昇编译器2.1.0

    安装GCC编译器9.3.0版本/毕昇编译器2.1.0版本前,需按如下顺序安装依赖:gmp-6.2.0.tar.bz2、mpfr-4.0.2.tar.bz2、mpc-1.1.0.tar.gz、isl-0.18.tar.bz2。

  • numactl
  • binutils
  • systemd-devel
  • valgrind

编译环境变量检查

  1. 使用PuTTY工具,以Hyper MPI安装维护用户,如“hmpi_master”登录作业执行节点。
  2. 执行以下命令,检查GCC 9.3.0/毕昇编译器2.1.0是否安装。
    • GCC 9.3.0

      gcc -v

      检查回显信息中是否包含GCC 9.3.0。

    • 毕昇编译器2.1.0

      clang -v

      检查回显信息中是否包含毕昇编译器,且版本号是否正确。

  3. 执行以下命令,检查libtool是否安装。

    libtool --version

    检查回显信息中是否包含libtool 2.4.2。

GCC编译Hyper MPI软件包

Hyper MPI包含Hyper MPI和HUCX两个软件层,其中Hyper MPI的安装依赖于HUCX,编译时应先编译HUCX。

  • HUCX编译
    1. 使用PuTTY工具,以Hyper MPI安装维护用户,如“hmpi_master”登录作业执行节点。
    2. 下载HUCX源码包“hucx-1.1.1-huawei.tar.gz”

      下载地址:https://github.com/kunpengcompute/hucx/archive/refs/tags/v1.1.1-huawei.tar.gz

    3. 下载XUCG源码包“xucg-1.1.1-huawei.tar.gz”

      下载地址:https://github.com/kunpengcompute/xucg/archive/refs/tags/v1.1.1-huawei.tar.gz

    4. 将上述两个源码包上传至服务器HUCX源码包安装目录,如“/path/to/download/hucx”。
    5. 执行以下命令,解压上述两个源码包。

      tar -zxvf hucx-1.1.1-huawei.tar.gz

      tar -zxvf xucg-1.1.1-huawei.tar.gz

    6. 执行以下命令,进入HUCX源码包安装路径。

      cd /path/to/download/hucx

    7. 执行以下命令,将XUCG源码包中的内容复制到HUCX源码包中的“src/ucg”目录下。

      cp -r xucg-1.1.1-huawei/* hucx-1.1.1-huawei/src/ucg

    8. 执行以下命令,进入“autogen.sh”脚本所在目录。

      cd hucx-1.1.1-huawei/

    9. 执行以下命令,进行源码包安装。

      ./autogen.sh

      ./contrib/configure-opt --prefix=/path/to/install/hucx

      • 环境上若没有安装numactl插件,则需要执行以下命令,指定--disable-numa参数:

        ./contrib/configure-opt --prefix=/path/to/install/hucx --disable-numa

      • /path/to/install/hucx:代表HUCX的安装路径。

      make -j32

      make -j32 install

      make后面-j参数为并行编译参数,表示有多少CPU核数参与编译过程,请根据实际CPU核数进行指定。

  • Hyper MPI编译
    1. 使用PuTTY工具,以Hyper MPI安装维护用户,如“hmpi_master”登录作业执行节点。
    2. 下载Hyper MPI源码包“hmpi-1.1.1-huawei.tar.gz”。

      下载地址: https://github.com/kunpengcompute/hmpi/archive/refs/tags/v1.1.1-huawei.tar.gz

    3. 将源码包上传至服务器Hyper MPI源码包安装目录,如“/path/to/download/hmpi”。
    4. 执行以下命令,进入源码包安装目录。

      cd /path/to/download/hmpi

    5. 执行以下命令,解压软件包。

      tar -zxvf hmpi-1.1.1-huawei.tar.gz

    6. 执行以下命令,进入“autogen.pl”脚本所在目录。

      cd hmpi-1.1.1-huawei/

    7. 执行以下命令,进行Hyper MPI源码包安装。

      ./autogen.pl

      ./configure --prefix=/path/to/install/hmpi --with-platform=contrib/platform/mellanox/optimized --enable-mpi1-compatibility --with-ucx=/path/to/install/hucx

      make

      make install

      • /path/to/install/hmpi:代表Hyper MPI的安装路径。
      • /path/to/install/hucx:代表HUCX的安装路径。

毕昇编译Hyper MPI软件包

Hyper MPI包含Hyper MPI和HUCX两个软件层,其中Hyper MPI的安装依赖于HUCX,编译时应先编译HUCX。

  • HUCX编译
    1. 使用PuTTY工具,以Hyper MPI安装维护用户,如“hmpi_master”登录作业执行节点。
    2. 下载HUCX源码包“hucx-1.1.1-huawei.tar.gz”

      下载地址:https://github.com/kunpengcompute/hucx/archive/refs/tags/v1.1.1-huawei.tar.gz

    3. 下载XUCG源码包“xucg-1.1.1-huawei.tar.gz”

      下载地址: https://github.com/kunpengcompute/xucg/archive/refs/tags/v1.1.1-huawei.tar.gz

    4. 将上述两个源码包上传至服务器HUCX源码包安装目录,如“/path/to/download/hucx”。
    5. 执行以下命令,解压上述两个源码包。

      tar -zxvf hucx-1.1.1-huawei.tar.gz

      tar -zxvf xucg-1.1.1-huawei.tar.gz

    6. 执行以下命令,进入HUCX源码包安装路径。

      cd /path/to/download/hucx

    7. 执行以下命令,将XUCG源码包中的内容复制到HUCX源码包中的“src/ucg”目录下。

      cp -r xucg-1.1.1-huawei/* hucx-1.1.1-huawei/src/ucg

    8. 执行以下命令,进入“autogen.sh”脚本所在目录。

      cd hucx-1.1.1-huawei/

    9. 执行以下命令,进行源码包安装。

      ./autogen.sh

      ./contrib/configure-opt --prefix=/path/to/install/hucx CC=clang CXX=clang++ FC=flang

      • 环境上若没有安装numactl插件,则需要执行以下命令,指定--disable-numa参数:

        ./contrib/configure-opt --prefix=/path/to/install/hucx --disable-numa CC=clang CXX=clang++ FC=flang

      • /path/to/install/hucx:代表HUCX的安装路径。

      for file in `find . -name Makefile`;do sed -i "s/-Werror//g" $file;done

      for file in `find . -name Makefile`;do sed -i "s/-implicit-function-declaration//g" $file;done

      make -j32

      make -j32 install

      make后面-j参数为并行编译参数,表示有多少CPU核数参与编译过程,请根据实际CPU核数进行指定。

  • Hyper MPI编译
    1. 使用PuTTY工具,以Hyper MPI安装维护用户,如“hmpi_master”登录作业执行节点。
    2. 下载Hyper MPI源码包“hmpi-1.1.1-huawei.tar.gz”。

      下载地址:https://github.com/kunpengcompute/hmpi/archive/refs/tags/v1.1.1-huawei.tar.gz

    3. 将源码包上传至服务器Hyper MPI源码包安装目录,如“/path/to/download/hmpi”。
    4. 执行以下命令,进入源码包安装目录。

      cd /path/to/download/hmpi

    5. 执行以下命令,解压软件包。

      tar -zxvf hmpi-1.1.1-huawei.tar.gz

    6. 执行以下命令,进入“autogen.pl”脚本所在目录。

      cd hmpi-1.1.1-huawei/

    7. 执行以下命令,进行Hyper MPI源码包安装。

      ./autogen.pl

      ./configure --prefix=/path/to/install/hmpi --with-platform=contrib/platform/mellanox/optimized --enable-mpi1-compatibility --with-ucx=/path/to/install/hucx CC=clang CXX=clang++ FC=flang

      make

      make install

      • /path/to/install/hmpi:代表Hyper MPI的安装路径。
      • /path/to/install/hucx:代表HUCX的安装路径。

配置环境变量

使用MPI的用户,需要配置环境变量,可通过environment-modules工具方式配置环境变量。
  1. 使用PuTTY工具,以Hyper MPI普通用户,如“hmpi_user”登录作业执行节点。
  2. 执行以下命令,安装environment-modules工具。

    yum install -y environment-modules

  3. 执行以下命令,在environment-modules工具安装路径下创建并编辑“Hmpi_modulefiles”配置文件。
    1. 打开“Hmpi_modulefiles”配置文件。

      vi /path/to/install/Hmpi_modulefiles

    2. 按“i”进入编辑模式,修改如下内容:
      #%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
      prepend-path  LD_LIBRARY_PATH /path/to/install/hmpi/lib:/path/to/install/hucx/lib
      prepend-path  INCLUDE /path/to/install/hmpi/include:/path/to/install/hucx/include

      /path/to/install:表示environment-modules工具的安装路径。用户若不指定安装路径,则默认安装在“/usr/share/Modules/modulefiles”路径下。

    3. 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。
  4. 执行以下命令,在工具安装路径下加载环境变量。

    module use /path/to/install

    module load /path/to/install/Hmpi_modulefiles

  5. 执行以下命令,将Hyper MPI环境变量写到用户的“~/.bashrc”文件中。
    1. 打开“~/.bashrc”文件。

      vi ~/.bashrc

    2. 按“i”进入编辑模式,添加如下内容:
      module use /path/to/install
      module load /path/to/install/Hmpi_modulefiles
    3. 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。

      默认用户的“~/.bashrc”文件在共享目录中,若不在,请修改所有节点的“~/.bashrc”

  6. 执行以下命令,使配置生效。

    source ~/.bashrc