Additionally, the code for implementing the PMPI interface is done through 
#define's.

Depending on the platform, it happens either as Clement describes (with 
#defines for MPI_Foo --> PMPI_Foo) or if the platform doesn't support weak 
symbols (e.g., MacOS), the source code for the C API functions is essentially 
compiled twice:

1. once as "normal"
2. a second time with #define MPI_Foo PMPI_Foo (for all values of Foo)



> On Mar 4, 2019, at 12:33 PM, Clement Foyer <clement.fo...@gmail.com> wrote:
> 
> Hi,
> 
> The reason you cannot find it is because it actually is not define as such. 
> The PMPI interface is defined as the profiling interface. The principle is 
> you have the real symbol in your shared library that is PMPI_Send, with a 
> weak alias being MPI_Send. So, if a third party want to intercept calls to 
> MPI_Send (as an example, to count how many times this function is called), he 
> just need to provide its own library that present the MPI_Send symbol, does 
> its work (e.g., increment some counter to keep track of how many times this 
> function was called by the user), and then call the PMPI_Send function 
> provided by Open MPI. As the ompi symbol for MPI_Send is defined as weak, it 
> won’t collide with the already defined symbol and thus simply be ignored 
> instead of rising a warning at link time. 
> 
> Note: in order to have the third party library loaded in time such as its 
> MPI_Send symbol is considered and not the Open MPI one, you need to set your 
> LD_PRELOAD variable accordingly.
> 
> You would end up with user code calling MPI_Send provided by third party, 
> calling PMPI_Send provided by the Open MPI library. Without this third party 
> library, you have user code that call MPI_Send which is actually an alias for 
> PMPI_Send provided by Open MPI library.
> 
> There might be some other implications, but I may let the people more 
> proficient than myself explain them :)
> 
> Regards,
> Clément
> 
> On 04/03/2019, 16:45, "devel on behalf of vishakha patil" 
> <mailto:devel-boun...@lists.open-mpi.org on behalf of 
> mailto:pvishakha.offic...@gmail.com> wrote:
> 
> Hi,
> 
> Greetings for the day! 
> 
> I am a MTech(Computer) student of Savitribai Phule Pune University, 
> Maharashtra, India.
> For my project purpose I have downloaded nightly snapshot tarball of openmpi 
> v4.0.x series.
> It got build successfully. But while traversing the code (manually as well as 
> using cscope) I am not able to find the implementation of PMPI_* (PMPI_Send 
> etc) which is getting called from MPI_Send function of send.c file.
> I have gone through the readme and make files but not able to find it. Could 
> you please help me with the same? 
> It is required to get complete understanding of openmpi algorithms as it is 
> part of my MTech project.
> 
> Please let me know if any other details required. Thank you!
> 
> Regards,
> Vishakha
> 
> _______________________________________________ devel mailing list 
> devel@lists.open-mpi.org https://lists.open-mpi.org/mailman/listinfo/devel
> 
> 
> _______________________________________________
> devel mailing list
> devel@lists.open-mpi.org
> https://lists.open-mpi.org/mailman/listinfo/devel


-- 
Jeff Squyres
jsquy...@cisco.com

_______________________________________________
devel mailing list
devel@lists.open-mpi.org
https://lists.open-mpi.org/mailman/listinfo/devel

Reply via email to