%export MPI_USE_LIBELAN=0

8.9.10MPI_USE_LIBELAN_SUB

The use of Elan’s native collective operations may be extended to include communicators which are smaller than MPI_COMM_WORLD by setting the MPI_USE_LIBELAN_SUB environment variable to “TRUE”. By default, this functionality is disabled due to the fact that libelan memory resources are consumed and may eventually cause run-time failures when too many sub-communicators are created. When set to TRUE, the number of sub-communicators that can be simultaneously created is limited to 10. This limit can be changed to any desirable value by setting the variable to a positive integer larger than 0.

%export MPI_USE_LIBELAN_USE=5

8.10MPICH Object Compatibility

The MPI standard specifies the function prototypes for the MPI functions, but does not specify the types of the MPI opaque objects like communicators or the values of the MPI constants. Hence an object file compiled using one vendor’s MPI will generally not function correctly if linked against another vendor’s MPI library.

There are some cases where such compatibility would be desirable. For instance a third-party tool such as Vampir might only be available using the MPICH interface.

To allow such compatibility, HP-MPI now includes a layer of MPICH wrappers which provides an interface identical to MPICH 1.2.5, and translates these calls into the corresponding HP-MPI interface. This MPICH compatibility interface is only provided for functions defined in MPICH

1.2.5and cannot be used by an application which calls functions outside the scope of MPICH

HP-MPI can be used in MPICH mode by compiling using mpicc.mpich and running with mpirun.mpich. The compiler script mpicc.mpich uses an include file which defines the interfaces the same as MPICH 1.2.5, and at link time it links against libmpich.so which is the set of wrappers defining MPICH 1.2.5 compatible entry points for the MPI functions. The mpirun.mpich takes the same arguments as the traditional HP-MPI mpirun command, but sets LD_LIBRARY_PATH so that libmpich.so is found.

An example of using a program with Vampir:

%$MPI_ROOT/bin/mpicc.mpich -o prog.x $MPI_ROOT/help /communicator.c \ -L/path/to/vampir/lib -lVT -lpthread -lm

%$MPI_ROOT/bin/mpirun.mpich -np 2 ./prog.x

Here, the program communicator.c is being compiled with MPICH compatible interfaces and is being linked against Vampir’s libVT first from the command line option, followed by HP-MPI’s libmpich.so then libmpi.so which are added by the mpicc.mpich compiler wrapper script. Thus libVT sees only the MPICH compatible interface to HP-MPI.

In general, object files built with HP-MPI’s MPICH mode can be used in an MPICH application, and conversely object files built under MPICH can be linked into an HP-MPI application using MPICH mode. However using MPICH compatibility mode to produce a single executable to run under both MPICH and HP-MPI will be more problematic and is not advised.

communicator.c could be compiled under HP-MPI MPICH compatibility mode as:

% export MPI_ROOT=/opt/hpmpi%

$MPI_ROOT/bin/mpicc.mpich -o prog.x $MPI_ROOT /help/communicator.c

8-12Using HP-MPI