3.7.1.15 Reserved Symbols and Names
The HP XC system reserves certain symbols and names for intern al use. Reserv ed symbols
and names should not be included in user cod e. If a reserved symbol or name is used, errors
could occur.
3.7.2 Building Parallel Applications
This section describes how to bu ild M PI and non-MPI parallel applications on an HP XC system.
3.7.2.1 Compiling and Linking Non-MPI Applications
If you are building n on-MPI applications, such as an OpenMP applicatio n for example, you can
compile and link them on an HP XC as you normally would, with standard header files and
switches.
3.7.2.2 Compiling and Linking HP-MPI Applications
This section provides some general information about how to build an HP-MPI application
in the HP XC environment. Refer to Chapter 8 for complete details, examples, and further
information about building HP-M PI applicat ions.
Compiling and linking an MPI application on an HP X C system is performed by invoking the
HP-MPI compiler utilities. H P- M P I compiler utilities are s cripts suppl ied by HP-MPI to make
it easier to invoke a compiler with the appropriate libraries and search paths. The HP-MPI
compiler utilities add all the necessary path locatio ns and library specifications to the compile
and link steps that are required to build a HP XC parallel application. It is highly recommended
that you use the HP- MPI c ompiler utilities to compile and link your MPI application on an HP
XC cluster, rather than invoke a compiler directly.
The mpicc, mpic++, mpif90,andmpif77 MPI compiler comm ands are used to invoke
the HP-MPI compiler utilities that compile and link an MPI application. The mpicc and
mpic++ com mands invoke the drivers of the C and C++ com pilers. The mpif77 and mpif90
commands invoke the drivers of the Fortran 77 and Fortran 90 compilers.
Before you can com pile and link an M PI program using the MPI compiler co mm and s, the M PI
compiler utilities module (mpi) must be loaded, or y ou must arrange for them to be in your
$PATH search list. The use of modules is described in Section 2.2.
3.7.2.3 Examples of Compiling and Linking HP-MPI Applications
The following examp les show how to compile and link your application code by invoking a
compiler u til ity.
If you hav e not already loaded the mpi com pil er utilities module , load it now as follows:
$ module load mpi
To compile and link a C application using the mpicc command:
$ mpicc -o mycode hello.c
To com pile and link a Fortran application using the mpif90 command:
$ mpif90 -o mycode hello.f
In the above examples, the HP-MPI comm a nds invoke compiler utilities which call the C and
Fortran compilers with appropriate libraries and search paths specified to build the parallel
application called hello.The-o specifies that output is directed to a file called mycode.
Refer to Chapter 8 for additional information about b uildin g applications with HP-MPI.
3-8 Developing Applications
Commentaires sur ces manuels