Compiling

The programming environment is centered on the compiler. Minerva supports C/C++ and Fortran compilers from INTEL, and GNU Compiler Collection (GCC). Only one compiler is available at a time to avoid ambiguity. Compiling code for parallel execution on Minerva must use the proper implementation of MPI, and link against the proper libraries. The MPI implementation currently supported by Minerva is Open MPI, which is descended from LAM. In particular, note that Open MPI is not part of the MPICH family of MPI implementations.

For each supported compiler suite, a version of Open MPI that is compatible with that compiler is loaded by using the module command. For example, to use the GCC compilers with Open MPI:

module load openmpi

To use the INTEL compilers with Open MPI:

module load openmpi/1.6.5-intel-parallel-s-xe-2013-sp1-u1

When compiling non-MPI programs, modules for compilers without MPI support can be loaded instead:

module load gcc

 

Compiler Names

Compiler “wrappers” provided by Open MPI supply the correct compiler and linker flags for MPI applications. For non-MPI codes the “native” compilers may be used directly.

Language Open MPI Native GCC Native INTEL
Fortran mpif77, mpif90 gfortran ifort
C/C++ mpicc gcc icc

 

Basic Examples

Serial Code

gfortran -O2 -o test test.f

MPI

mpicc -O2 -o MPItest MPItest.c

OpenMP

icc -O2 -openmp -o OpenMPtest OpenMPtest.c

Available compiler options depend on the underlying native compiler; complete descriptions are available via the “man” command.