I'm looking at the mpi.h header, and I'm confused about the PMPI_Init function. It's placed right after the MPI_Init declaration, and it looks exactly the same. However, Msmpi.dll (for instance) doesn't have the MPI_Init export, only the PMPI_Init.
What are these PMPI_ functions?
You are looking at the MPI profiling interface. For each MPI function, there is also a similar PMPI function, which just differs by the prefix.
As a user, you should only call the MPI version and just ignore the PMPI version.
This is a mechanism that allows tool developers to intercept calls to the MPI functions and call the PMPI versions internally. Usually this is implemented such that all functions are implemented as PMPI functions and with MPI functions as weak symbols pointing to them. The tool can then replace the weak symbols with their own wrapper implementations and still call the PMPI functions internally.
// Normal case
user --calls--> libmpi:MPI_Init --redicrects to--> libmpi:PMPI_Init (implementation)
// Tool case
user --calls--> libtool:MPI_Init (does tool things) --calls--> libmpi:PMPI_Init (implementation)
You can find more information in Section 14.2 of the MPI standard. In general, I highly recommend to look in the standard for function signatures and such instead of the header.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With