Using MorphMPI
To use MorphMPI, first the prefix of all MPI-symbols in the application should be replaced by MorphMPI
. Prefixing all symbols with MorphMPI
avoids having multiple definitions for all MPI-symbols at link-time and allows MorphMPI to easily call the equivalent MPI-functions. To replace all MPI-symbols with their equivalent MorphMPI-symbols, either a script can be used that comes with MorphMPI or the header morphornot.h
can be included instead of including mpi.h
. The morphornot.h
header will include mpi.h
unless the preprocessor-token MORPH
is defined. If MORPH
is defined, preprocessor directives will convert all MPI-functions and constants to their MorphMPI equivalent and will include morphmpi.h
.
Next, the MorphMPI library must be compiled against an MPI-implementation of your choice. This library will than be able to translate all MorphMPI-function calls and MorphMPI-constants to the corresponding function/constant in the MPI-implementation of your choice.
Finally, the application should be linked to this MorphMPI-library and can then be launched using the launching-mechanism that comes with the MPI-implementation of your choice.
Availability
MorphMPI currently covers a large portion of the MPI-1.1 interface and a few functions of the MPI-2.0 interface.
MorphMPI has been tested using a large portion of the regression tests of MPICH2-1.0.5p4 and inside development versions of the finite element applications for (aero-)acoustics ACTRAN [3]. Since ACTRAN contains the MUMPS [4] solver, MUMPS as well as its dependency BLACS were morphed and tested.
MorphMPI is available under the LGPL and is hosted on sourceforge [5]. Actually it is essential to MorphMPI to make the source-code available because this allows users to compile and link morphed applications with any MPI-implementation.
An Extra Feature
In addition to being linked with any other MPI-implementation, MorphMPI need not necessarily be linked to another MPI implementation. In this case, MorphMPI will act as a fake MPI library. Launching an application that is linked against MorphMPI compiled in fake-mode, enables the application to call all MPI functions which will react conforming to the size of MPI_COMM_WORLD being 1.
Because MorphMPI tracks the creation and deletion of groups and communicators, it is also able to report if there were any group- or communicator-leaks when Finalize is being called. For instance, MorphMPI has detected several such leaks in the regression tests of mpich2-1.0.5p4 but (un)fortunately these leaks were already patched before being reported based on the leak-reports of MorphMPI.
Acknowledgments
This library was implemented at Free Field Technologies [2]. Thanks to Mathieu Gontier for revising the documentation and to Jeff Squyres and Tim Prins for feedback on this article.
References |
Toon Knapen can be reached at toon.knapen ( a t ) telenet.be and would like to acknowledge Free Field Technologies for their assistance int his project.