Parallel Programming on SGI Systems Using MPI
(Message Passing Interface)
For general information on MPI, see MPI Overview.
The Message Passing Interface (MPI) provides
platform and language independent communication between nodes of
parallel computing systems.
For detailed information about the MPI standard, see
http://www.mcs.anl.gov/mpi.
For a listing of MPI commands with links to their descriptions, see:
http://www-unix.mcs.anl.gov/mpi/www/
For SGI's documentation regarding use of MPI on SGI ALTIX systems, see:
SGI Message Passing Toolkit: MPI Programmer's Manual for Linux
For examples of a simple MPI program illustrating some commonly used MPI calls, see:
Hello World in C
Hello World in Fortran
For a first exercise, it is suggested that you compile and run
the example Fortran and C programs above using the procedures listed below.
Compiling a Fortran Program:
You can compile Fortran programs containing MPI library calls using
the "ifort" command.
For example, to compile the file
my_prog.f and create the output program my_prog
containing appropriate links to the MPI libraries, enter:
ifort -o my_prog myprog.f -lmpi
Compiling a C Program:
You can compile C programs containing MPI library calls using
the "mpcc" command. For example, to compile the file
my_prog.f and create the output program my_prog
containing appropriate links to the MPI libraries, enter:
icc -o my_prog myprog.c -lmpi
The MPI command "mpirun" can be be used to submit a parallel job
for interactive execution. For example, to sumit the compiled program
my_prog to the parallel environment and use four processors,
enter:
mpirun -np 4 my_prog
Note: If you receive the message "couldn't allocate nodes for parallel
execution. Exiting...", then there are not a sufficient number of
nodes currently available to execute your parallel job in the
interactive environment.
For additional information on using the mpirun command, enter:
man mpirun
|