C H A P T E R  4

Compiling MPI Programs

This chapter describes the compilers that Sun HPC ClusterTools Software supports for both the Solaris OS and Linux. In addition, it describes changes you might make in your application code to recompile and run programs developed with a previous version of Sun HPC ClusterTools software in Sun HPC ClusterTools 8.2.1c.

This chapter contains the following topics:

If you previously compiled your application with the tmcc compiler, then you must recompile your applications using the mpicc compiler if you want them to be compatible with Sun HPC ClusterTools 8.2.1c software.

 


Supported Compilers

For the Solaris OS, Sun HPC ClusterTools 8.2.1c software supports Sun Studio 10, 11, 12, and 12 U1 C, C++, and Fortran compilers.

For the Linux OS, the ClusterTools 8.2.1c software supports


Using the Compiler Wrappers

Sun HPC ClusterTools 8.2.1c supplies compiler wrappers for you to use instead of directly calling the compilers when compiling applications for use with the Sun HPC ClusterTools 8.2.1c software. These compiler wrappers do not actually perform the compilation and linking steps themselves, but they add the appropriate compiler and linker flags and call the compiler and linker.



Note - Using the compiler wrappers is strongly suggested. If you decide not to use them, the Open MPI Web site at http://www.open-mpi.org contains instructions about how to compile without using them.


The following compiler wrappers are available:


TABLE 4-1 Compiler Wrappers

Language

Compiler Wrapper

C

mpicc

C++

mpiCC, mpicxx, or mpic++ (Note: mpiCC is for use on case-sensitive file systems only)

Fortran 77

mpif77

Fortran 90

mpif90


For more information about the compiler wrappers, their use, and troubleshooting, see the Open MPI FAQ at:

http://www.open-mpi.org/faq/?category=mpi-apps#cant-use-wrappers


Using Non-Default Error Handlers

In Open MPI, the non-default error handler does not persist, and the default error handler is used. This causes any call used after MPI_Finalize to be aborted.


Compiling Fortran 90 Programs

When you are compiling MPI programs written in Fortran 90, you must use the
-xalias=actual switch. Otherwise, your program could fail.

This condition is due to a known condition in the MPI standard. The standard states that “The MPI Fortran binding is inconsistent with the Fortran 90 standard in several respects.” Specifically, the Fortran 90 compiler could break MPI programs that use non-blocking operations.

For more information about this issue, see

http://www-unix.mcs.anl.gov/mpi/mpi-standard/mpi-report-2.0/node19.htm#Node19