Updated on 2022-05-09 GMT+08:00

Platform MPI

Scenarios

This section describes how to install and use Platform MPI (for example, platform_mpi-09.01.04.03r-ce) on an ECS.

Prerequisites

You have configured the ECS password-free login.

Procedure

  1. Install Platform MPI.

    1. Run the following command to install the required library file:

      # yum install glibc.i686 libgcc-4.8.5-11.el7.i686

    2. Add the execution permission. For example, the installation package is stored in /root.

      # cd /root && chmod +x platform_mpi- 09.01.04.03r-ce.bin

    3. Run the following command to install Platform MPI:

      # ./platform_mpi- 09.01.04.03r-ce.bin

      Press Enter or 1 (accept the agreement) as prompted until the installation is complete.

      Figure 1 Successful Platform MPI installation

      The default installation path is /opt/ibm/platform_mpi.

  2. Configure MPI environment variables.

    1. Run the following command to obtain the pkey:

      # cat /sys/class/infiniband/mlx5_0/ports/1/pkeys/* | grep -v 0000

      Figure 2 Obtaining the pkey
    2. Add the following statements in ~/.bashrc as a common user:

      export MPI_ROOT=/opt/ibm/platform_mpi

      export PATH=$MPI_ROOT/bin:$PATH

      export LD_LIBRARY_PATH=/opt/ibm/platform_mpi/lib/linux_amd64

      export MPI_IB_PKEY=pkey obtained in 2.a

      $source ~/.bashrc

      If there are multiple pkeys, use a comma to separate them.

    3. Run the following command to check whether the environment variables have been imported:

      # which mpirun

      Figure 3 Successfully importing environment variables of Platform MPI

  3. Run Platform MPI on an ECS:

    1. Run the following command to re-compile the hello.c file:

      # mpicc hello.c -o platform_hello

    2. Run the following command to run Platform MPI on an ECS:

      # mpirun -np 2 /root/platform_hello

      Figure 4 Running Platform MPI on an ECS