Compiling Mpi Programs - Cisco GEM318P User Manual

Host drivers for linux
Table of Contents

Advertisement

Compiling MPI Programs

Compiling MPI Programs
This section describes how to compile MPI programs. Compiling MPI applications from source code
requires adding several compiler and linker flags. MVAPICH MPI provides wrapper compilers that add
all appropriate compiler and linker flags to the command line and then invoke the appropriate underlying
compiler, such as the GNU or Intel compilers, to actually perform the compile and/or link. This section
also provides examples of how to use the wrapper compilers. To compile MPI programs, perform the
following steps:
Log in to your local host.
Step 1
Copy the example files to your $HOME directory.
Step 2
The example files can be copied as follows:
host1$ cp -r /usr/local/topspin/mpi/examples $HOME/mpi/mpich/src/examples/hello
The files in the /usr/local/topspin/mpi/examples directory are sample MPI applications that are provided
both as a trivial primer to MPI as well as simple tests to ensure that your MPI installation works properly.
There are two MPI examples in the directory, each in four programming languages.
The following example shows Hello world:
C
C++
F77
F90
The following example sends a trivial message around in a ring:
C
C++
F77
F90
Note
Cisco SFS InfiniBand Host Drivers User Guide for Linux
7-12
hello_c.c
hello_cxx.cc
hello_f77.f
hello_f90.f90
ring_c.c
ring_cxx.cc
ring_f77.f
ring_f90.f90
A comprehensive MPI tutorial is available at the following URL:
http://webct.ncsa.uiuc.edu:8900/public/MPI/
Chapter 7
MVAPICH MPI
OL-12309-01

Advertisement

Table of Contents
loading

This manual is also suitable for:

St373307lcSfs infiniband

Table of Contents