How to write PMPI library for wrapping MPI functions

六月ゝ 毕业季﹏ 提交于 2019-12-11 00:44:02

问题


I am trying to write a PMPI library but am not sure of the right steps (new to libraries and linking). I have written a basic file wrapping the MPI_Send function. Say it's a file called lib.c, what all steps should I do so that when I run a c code with MPI_Send, my wrapper code gets executed?


回答1:


On Linux, MPI uses weak links so that MPI_Send gets redirected to PMPI calls. So if you link with your library first and then the MPI library that you are wrapping (i.e. -lmpi is after -lmylib), you will be calling MPI through your library, because then libmpi weak links won't be used.



来源:https://stackoverflow.com/questions/55118661/how-to-write-pmpi-library-for-wrapping-mpi-functions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!