[mpiwg-tools] Mini example of single tool working with multiple MPI implementations
Matthew LeGendre
legendre1 at llnl.gov
Thu Oct 22 12:34:46 CDT 2015
At the end of the call, Jeff asked about a simple example that illustrates
building a tool with QMPI that works with multiple MPI implementations.
I've attached a tarball that illustrates what I was picturing.
This example builds a pair of libraries, libfakeopenmpi.so and
libfakempich.so, which each export "mpisend" functions with different
signatures as well as a pair of fake apps, app_openmpi and app_mpich, that
use each library. It also builds a single libtool.so, which contains
wrapper functions for each mpisend and dynamically chooses which one is
used.
Note that the tool library still has files built against each MPI
implementation, but produces a single library that works with either
implementation.
On the phone I speculated that you'd need the callback registration
functions to be ABI compatible across all MPI implementations, but this
didn't turn up being necessary. You can get away with only the MPI
identification function having a standard ABI. In this example I called
the function get_mpi_implementation().
It also turned up being very convenient if the MPI header exported the
return value of get_mpi_implementation() though a #define (which I called
MPI_IMPL). This allowed for an easy runtime test of whether the a tool
implementation was compiled for the running MPI.
Also, On the phone I speculated that getting per-compiler tools would be
difficult. You actually could solve part of the problem by including a
compiler name and version in the MPI_IMPL #define--most compilers have
preprocessor macros that exports that info. Though this still wouldn't
solve any tool incompatibilities with runtime libraries like libstdc++.so.
-Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fakempitool.tar
Type: application/x-tar
Size: 30720 bytes
Desc:
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-tools/attachments/20151022/26d52d0b/attachment.tar>
More information about the mpiwg-tools
mailing list