Use MPICH to Support Coarrays for the Intel® Fortran Compilers

ID 660421
Updated 10/20/2022
Version Latest
Public

author-image

By

Introduction

The Intel® Fortran Compiler (ifx 2022.2.0 and newer) and Intel® Fortran Compiler Classic (ifort) currently support coarrays using the Intel® MPI Library. It is possible to use other MPICH-based implementations instead, but this is unsupported.

Follow the instructions below to use MPICH in place of the Intel® MPI Library for Linux. 

This example uses MPICH 3.3.2. Refer to http://www.mpich.org for more information about the latest version of MPICH.

Get MPI Sources

Download the kit from http://www.mpich.org and unpack it to your preferred directory. In this example, the directory is mpich.dir and the kit chosen is “mpich-3.3.2”.

mkdir mpich.dir
mkdir mpich_install.dir
cd mpich.dir
gunzip -d -v mpich-3.3.2.tar.gz
tar -xvf mpich-3.3.2.tar.gz

 

Build MPICH

The MPICH build requires you to specify an installation directory. This installation directory can be shared or private. In the example below, the private installation directory mpich_install.dir is used.

There are several options available to the build described in the README file. The following two options must be set:

  • --prefix specifies the installation directory;
  • --enable-g specifies the amount of debugging support. This example uses --enable-g=none to avoid the run-time issue of messages about memory usage.
cd mpich-3.3.2
configure --prefix <your-directory-path>/mpich_install.dir \
   --enable-debuginfo --enable-g=none --enable-shared >& config_log.txt
make
make install

 

Prepare to Use

Set your environment to find the MPICH libraries and executables prior to those in the Intel® MPI Library, as outlined below.

For csh users:

setenv PATH “<your-directory-path>/mpich_install.dir/bin:${PATH}"
setenv LD_LIBRARY_PATH "<your-directory-path>/mpich_install.dir/lib:${LD_LIBRARY_PATH}"
setenv INCLUDE "<your-directory-path>/mpich_install.dir/include;${INCLUDE}"

For bash users:

export PATH=“<your-directory-path>/mpich_install.dir/bin:$PATH"
export LD_LIBRARY_PATH="<your-directory-path>/mpich_install.dir/lib:$LD_LIBRARY_PATH"
expert INCLUDE="<your-directory-path>/mpich_install.dir/include;$INCLUDE"

 

Following this setup, you can compile, link, and run your applications as usual.

Notes

Automake

The MPICH build uses a tool called automake. If you do not have automake, you can download it from http://ftp.gnu.org/gnu/automake. This example used automake-1.16.tar.gz, upacked it to mpich.dir/automake-1.16, and place that directory in the PATH environment variable.

macOS

Coarrays are not supported on macOS* systems.