ASCC
ADVANCED SCIENTIFIC COMPUTATION CENTER

TOOLS:
  Compilers  
  Matlab  
 
 
  GNQS  
  MPI  
  OpenMP  
 
 
  Exceed  

MPI

What is MPI?

MPI(Message Passing Interface) is a thread-safe standard library (for C or Fortran) that allow your application's multiple processes to communicate. It is good for parallel machines, especially those with distributed memory, such as the AlphaServer ES40s in use at the ASCC, which each have 4 processors.


NOTE: Currently, ASCC users are not allowed to use mpich, which distributes the program on several machines.

Do I need to use MPI?

Only if you need to coordinate a program running as multiple processes on one of the Alphaserver ES40s (such as Taurus, Aries, etc).

Compiling and Linking C Programs that use MPI

You need to use the appropriate include files and libraries in your make process in order to compile MPI programs. To compile C programs, follow these steps:

  • Include the header file in all of your source code files that use MPI functions: include <mpi.h> This include file is installed in the standard location under /usr/include and does not need additional compiler directives.

  • To make, you must include the library with -lmpi in your link command, e.g.
    cc -o myprog myprog.c -lmpi -lrt -pthread

Compiling Fortran programs that use MPI

You need to use the appropriate include files and libraries in your make process in order to compile MPI programs.

  • Include the header file in all of your source code files that use MPI functions: include <mpif.h> This include file is installed in the standard location under /usr/include and does not need additional compiler directives.

  • To make, you must include the library with -lfmpi and -lmpi in your link command, e.g.
    f77 -o myprog myprog.f -lfmpi -lmpi -lrt -pthread

Running MPI Programs

Use the command dmpirun following by the executable name, e.g.
dmpirun myprog

DMPIRUN Options

Options can be specified with command line options/arguments, or through environment variables. Note that command line options override the setting of environment variables.

OPTION ARGUMENT DESC EXAMPLE
-np number-of-processes (or tasks)
Run program using multiple processes on one host. Default of one per host.
dmpirun -np 2 myprog
       
       
       

Internal Links

External Links