|
Compilers
GNU Compilers
| C |
cc or gcc |
| C++ |
g++ |
| Fortran 77 |
g77 |
| Profiler |
gprof |
MPI Compilers
MPI programs are compiled using "wrapper scripts",
which one you use depends on the language being compiled.
| |
C Wrapper |
C++ Wrapper |
Fortran 77 Wrapper |
GNU Compiler |
mpicc |
mpicxx or mpiCC |
mpif77 |
Compiling linking and running MPI programs
The MPICH implementation provides those commands
for compiling and linking programs:
$ mpicc -c foo.c
$ mpif77 -c foo.f
$ mpiCC -c foo.cc
and
$ mpicc -o foo foo.o
$ mpif77 -o foo foo.o
$ mpiCC -o foo foo.o
Commands for the linker may include additional libraries.
For example, to use routines from the C math library, use:
$ mpicc -o foo foo.o -lm
Combining compilation and linking in a single command, as shown here:
$ mpicc -o foo foo.c
$ mpif77 -o foo foo.f
$ mpiCC -o foo foo.cc
To run a MPI program, use the "mpirun" command:
$ mpirun -np 4 a.out
To run the program 'a.out' on four processors.
The command "mpirun -help" gives you a
complete list of options.
For more details on MPICH go to:
http://www-unix.mcs.anl.gov/mpi/mpich1/docs/mpichman-globus2.pdf
|