| United States-English |
|
|
|
![]() |
HP-MPI User's Guide > Chapter 3 Understanding
HP-MPIMPICH object compatibility for HP-UX and Linux |
|
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 Intel trace/collector might only be available using the MPICH interface. To allow such compatibility, HP-MPI 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.5 and cannot be used by an application which calls functions outside the scope of MPICH 1.2.5. HP-MPI can be used in MPICH mode by compiling using "mpicc.mpich" and running using "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 entrypoints for the MPI functions. The mpirun.mpich takes the same arguments as the traditional HP-MPI mpirun, but sets LD_LIBRARY_PATH so that libmpich.so is found. An example of using a program with Intel Trace Collector: % export MPI_ROOT=/opt/hpmpi % $MPI_ROOT/bin/mpicc.mpich -o prog.x \ % $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 Intel's Trace Collector libVT.a 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.a 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 app using MPICH mode. However using MPICH compatibility mode to produce a single executable to run under both MPICH and HP-MPI will be 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 and run the resulting prog.x under MPICH. However, various problems will be encountered. First, the MPICH installation will need to be built to include shared libraries and a soft link would need to be created for libmpich.so, since their libraries might be named differently. Next an appropriate LD_LIBRARY_PATH setting must be added manually since MPICH expects the library path to be hard coded into the executable at link time via -rpath. Finally, while the resulting executable would run over any supported interconnect under HP-MPI, it would not under MPICH due to not being linked against libgm/libelan etc. Similar problems would be encountered if linking under MPICH and running under HP-MPI's MPICH compatibility. MPICH's use of -rpath to hard code the library path at link time would keep the executable from being able to find the HP-MPI MPICH compatibility library via HP-MPI’s LD_LIBRARY_PATH setting. C++ bindings are not supported with MPICH compatibility mode. MPICH compatibility mode is not supported on HP-MPI V1.0 for Windows. |
||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||