MPI is a standard library for performing parallel processing using a distributed-memory model.
MPI is available without restriction to all OSC users.
The following versions of MVAPICH2 are available on OSC systems. To see which compilers a particular version of MVAPICH2 is available for, use, for example,
module spider mvapich2/2.2.
To set up your environment for using the MPI libraries, you must load the appropriate module:
module load mvapich2
You will get the default version for the compiler you have loaded.
To build a program that uses MPI, you should use the compiler wrappers provided on the system. They accept the same options as the underlying compiler. The commands are shown in the following table.
For example, to build the code my_prog.c using the -O2 option, you would use:
mpicc -o my_prog -O2 my_prog.c
In rare cases you may be unable to use the wrappers. In that case you should use the environment variables set by the module.
||Use during your compilation step for C programs.|
||Use during your compilation step for C++ programs.|
||Use during your compilation step for Fortran 77 programs.|
||Use during your compilation step for Fortran 90 programs.|
||Use when linking your program to the MPI libraries.|
For example, to build the code my_prog.c without using the wrappers you would use:
mpicc -c $MPI_CFLAGS my_prog.c
mpicc -o my_prog my_prog.o $MPI_LIBS
Programs built with MPI can only be run in the batch environment at OSC. For information on starting MPI programs using the
mpiexec command, see Batch Processing at OSC.
Be sure to load the same compiler and mvapich modules at execution time as at build time.