Developer Guide

  • 2021.1
  • 12/04/2020
  • Public Content
Contents

Run the MPI Application with a Container

You can choose from three usage models for running your application using a Singularity* container:
  1. Everything packed into a single container
  2. The Intel MPI Library installed both inside and outside the container
  3. The Intel MPI Library outside the container
Usage model 1: Everything packed into a single container
This approach presumes that the Intel® MPI library, target application, and all its dependencies are packed into a container.
Prerequisites
Before running Intel® MPI Library in a Singularity container, make sure you have the following components installed on each machine of a cluster:
  1. Singularity (version not lower than 3.0). Refer to the official documentation for installation steps.
  2. A container including your application and Intel MPI Library.
Recipe file
BootStrap: yum OSVersion: 7 MirrorURL: http://linux-ftp.jf.intel.com/pub/mirrors/centos/7.6.1810/os/$basearch/ Include: yum %environment source /opt/intel/compilers_and_libraries_2019.5.XXX/linux/mpi/intel64/bin/mpivars.sh %post export http_proxy=http://*** yum repolist yum install -y yum-cron yum install -y yum-utils yum-config-manager --add-repo https://yum.repos.intel.com/mpi/setup/intel-mpi.repo yum install -y intel-mpi-2019.5-XXX yum install -y sudo wget vi which numactl bzip2 tar gcc hostname lscpu uptime redhat-lsb openssh-server openssh-clients
Launch
When recipe is created, execute the following command:
$ singularity exec <container_name> mpirun -n <processes_num> -ppn <processes_per_node> -hostlist <hosts> <application>
Usage model 2: The Intel MPI Library installed both inside and outside the container
In this approach,
additional dependency on hosts (for example, external mpirun) is required. Each rank is a separate Singularity container instance execution.
Prerequisites
Before running Intel MPI Library in a Singularity container, make sure you have the following components installed on each machine of a cluster:
  1. Singularity (version not lower than 3.0).
  2. A container including your application and Intel MPI Library.
  3. Intel MPI Library.
Recipe file
BootStrap: yum OSVersion: 7 MirrorURL: http://linux-ftp.jf.intel.com/pub/mirrors/centos/7.6.1810/os/$basearch/ Include: yum %environment source /opt/intel/compilers_and_libraries_2019.5.XXX/linux/mpi/intel64/bin/mpivars.sh %post export http_proxy=http://*** yum repolist yum install -y yum-cron yum install -y yum-utils yum-config-manager --add-repo https://yum.repos.intel.com/mpi/setup/intel-mpi.repo yum install -y intel-mpi-2019.5-XXX yum install -y sudo wget vi which numactl bzip2 tar gcc hostname lscpu uptime redhat-lsb
Launch
When recipe is created, execute the following command:
$ mpirun -n <processes_num> -ppn <processes_per_node> -hostlist <hosts> singularity exec <container_name> <application>
Usage model 3: The Intel MPI Library outside the container
In this approach,
additional dependency on hosts (for example, external mpirun) is required.
Each host has a single Singularity container instance executed for all ranks.
Prerequisites
Before running Intel MPI Library in a Singularity container, make sure you have the following components installed on each machine of a cluster:
  1. Singularity (version not lower than 3.0).
  2. A container including your application.
  3. Intel MPI Library.
Recipe file
BootStrap: yum OSVersion: 7 MirrorURL: http://linux-ftp.jf.intel.com/pub/mirrors/centos/7.6.1810/os/$basearch/ Include: yum %environment source /mnt/mpi/intel64/bin/mpivars.sh release %post export http_proxy=http://*** yum repolist yum install -y yum-cron yum install -y yum-utils yum-config-manager --add-repo https://yum.repos.intel.com/mpi/setup/intel-mpi.repo yum install -y intel-mpi-2019.5-XXX yum install -y sudo wget vi which numactl bzip2 tar gcc hostname lscpu uptime redhat-lsb openssh-server openssh-clients
Launch
When recipe is created, execute the following command:
$ singularity shell --bind <path_to_mpi_installation_on_hosts:/mnt> mpirun -n <processes_num> -ppn <processes_per_node> -hostlist <hosts> <application>
See Also

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.