Selecting MPI compiler

MPI compiler settings on the cluster can be configured to use either the GNU compiler collection (gcc, g++, gfortran) or Intel compiler suite (icc, icpc, ifort). System default is set to GNU compilers in mpi (mpicc = gcc, mpic++ = g++, mpif77 = gfortran). Use the "mpi-selector-menu" command if you wish to change your mpi compiler settings.

mpi-selector-menu

True unix people would go for "man mpi-selector-menu" to figure out the usage. An example session
is given below for those who prefer an easier way. Users need to run this only on the master node.

To begin with, check which one is your default mpi compiler. You may try, for eg:

[oldmonk@hydra ~]$ which mpif77
/usr/mpi/gcc/openmpi-1.4.3/bin/mpif77
[oldmonk@hydra ~]$

Now issue the command mpi-selector-menu

[oldmonk@hydra ~]$ mpi-selector-menu
Current system default: openmpi_gcc-1.4.3
Current user default: <none>
"u" and "s" modifiers can be added to numeric and "U"
commands to specify "user" or "system-wide".

1. mvapich2_gcc-1.6
2. mvapich2_intel-1.6
3. mvapich_gcc-1.2.0
4. mvapich_intel-1.2.0
5. openmpi_gcc-1.4.3
6. openmpi_intel-1.4.3
U. Unset default
Q. Quit

Selection (1-4[us], U[us], Q):

Select your favorite compiler for MPI. Here I chose intel (option 6) in the list.

[oldmonk@hydra ~]$ mpi-selector-menu
Current system default: openmpi_gcc-1.4.3
Current user default: <none>

"u" and "s" modifiers can be added to numeric and "U"
commands to specify "user" or "system-wide".

1. mvapich2_gcc-1.6
2. mvapich2_intel-1.6
3. mvapich_gcc-1.2.0
4. mvapich_intel-1.2.0
5. openmpi_gcc-1.4.3
6. openmpi_intel-1.4.3
U. Unset default
Q. Quit

Selection (1-4[us], U[us], Q): 6
Operator on the per-user or system-wide default (u/s)? u

Changing system-wide default will require administrative privileges, so normal users would go for per-user option ("u" in the last line).

Now you may quit the tool with a "q" at the response prompt.

Operator on the per-user or system-wide default (u/s)? u

Current system default: openmpi_gcc-1.4.3
Current user default: openmpi_intel-1.4.3

"u" and "s" modifiers can be added to numeric and "U"
commands to specify "user" or "system-wide".

1. mvapich2_gcc-1.6
2. mvapich2_intel-1.6
3. mvapich_gcc-1.2.0
4. mvapich_intel-1.2.0
5. openmpi_gcc-1.4.3
6. openmpi_intel-1.4.3
U. Unset default
Q. Quit

Selection (1-4[us], U[us], Q): q

WARNING: Changes made to mpi-selector defaults will not be visible until
you start a new shell!

Take note of the Warning message and open a new terminal. Check for your mpi compiler:

[oldmonk@hydra ~]$ which mpif77
/usr/mpi/intel/openmpi-1.4.3/bin/mpif77
[oldmonk@hydra ~]$
Last updated on: February 20, 2024