Using Xeon Phi prefixes and extensions for Intel MPI jobs in NFS shared environment

By Gergana S. Slavova, Published: 12/12/2012, Last Updated: 12/12/2012

Overview

With the added support for the Intel® Xeon Phi™ coprocessor in the lntel® MPI Library product, we've introduced a few new environment variables to help ease running MPI jobs on the new architecture. For full details on how to launch an Intel MPI Library job on a cluster containing Intel Xeon Phi coprocessor cards, check out this article.

Here, we discuss two specific methods that help in cases of an NFS-shared environment across the Xeon host and the Xeon Phi coprocessor card.

For the examples below, we assume a couple of things:

  • The $HOME directory of each user (e.g. /home/user) is NFS-shared on the host and coprocessor. This will work for any other NFS-shared location where the executables are built
  • We're using the Intel MPI wrapper scripts for the Intel® C Compilers (mpiicc). Feel free to replace with desired compiler (e.g. mpiifort for the Intel® Fortran Compiler).
  • Finally, we've created an MPI hosts file that contains the hostnames of the Xeon Phi coprocessor cards:
    [user@host] $ cat mpi_hosts
    node0
    node0-mic0
    node1
    node1-mic0

Saving all Intel Xeon Phi coprocessor executables in a sub-directory

1. First create your executables which will be run on the Xeon hosts:

[user@host] $ mpiicc test.c –o test.exe

2. Now create a special directory where all Xeon Phi executables will live and populate it:

[user@host] $ mkdir MIC
[user@host] $ mpiicc –mmic test.c –o ./MIC/test.exe

3. Finally, launch your application. The trick here is to set the I_MPI_MIC_PREFIX environment variable. This will automatically add a prefix (e.g. ./MIC) to the executable when the mpirun script runs the MPI job on the Xeon Phi coprocessor cards.

[user@ host] $ export I_MPI_MIC=enable
[user@host] $ export I_MPI_MIC_PREFIX=./MIC/
[user@host] $ mpirun –f mpi_hosts –perhost 1 –n 2 test.exe
Hello world: rank 0 of 2 running on node0
Hello world: rank 1 of 2 running on node0-mic0

Using a Xeon Phi-specific extension for your Xeon Phi-specific executables

Step 1. is the same as the previous case.

2. Instead of creating a new directory, attach an extension to the Xeon Phi coprocessor executables during creation:

[user@host] $ mpiicc –mmic test.c –o test.exe.mic

3. Again, simply launch your application. The trick here is to set the I_MPI_MIC_POSTFIX environment variable. This will automatically attach the specified postfix (e.g. .mic) to the executable when the mpirun script runs the MPI job on the Xeon Phi coprocessor cards.

[user@ host] $ export I_MPI_MIC=enable
[user@host] $ export I_MPI_MIC_POSTFIX=.mic
[user@host] $ mpirun –f mpi_hosts –perhost 1 –n 2 test.exe
Hello world: rank 0 of 2 running on node0
Hello world: rank 1 of 2 running on node0-mic0

More details on these and other Xeon Phi coprocessor-specific environment variables are available in the Release Notes Addendum for MIC Architecture document available in the <intelmpi_install_dir>/doc directory, or online at our Release Notes page.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804