31
The libraries and files associated with using MPICH and the Ammasso 1100 are located in a
directory within the Ammasso installation environment:
<install_dir>/mpich-1.2.5
If you chose to install a 32b version of MPICH on a 64b system, there will be an additional
directory:
<install_dir>/mpich-1.2.5-32
Additionally, the standard MPICH examples directory is located in:
<install_dir>/mpich-1.2.5/examples
For the example used below, the cpi.c program is found in this directory. The cpi
program will calculate the value of Pi.
4.4 Compiling and Linking Applications
The directory <install_dir>/mpich-1.2.5/bin contains a number of scripts used
for compiling and linking user applications. For example, C applications can be built using
the “mpicc” command script. These scripts set up and use all the correct settings for the
standard Ammasso version of MPICH.
As an example, to compile and link the cpi.c program, the following steps need to be
performed on each system that will be used for running the program. Since it is important
that the path to the application is the same on all machines, most sites use a distributed file
system such as NFS, Lustre etc. to provide a single file name space for all files used by MPI.
Create an object file using the Ammasso MPICH compilation script "mpicc" provided in
the MPICH bin directory listed above by using the following command, note that this
assumes that the MPICH bin directory is in the user’s path , i.e. the user already added the
following to a .cshrc, .profile, or .bashrc file:
C Shell users should add the following command line to .cshrc file:
# set path = ( <install_dir>/mpich-1.2.5/bin $path )
Bourne/Korn shell or bash users should add the following command lines to .profile
or .bashrc file respectively:
# PATH=<install_dir>/mpich-1.2.5/bin:$PATH
# export PATH
Compile the program by using the following command:
# mpicc -c cpi.c
Comentários a estes Manuais