<div dir="ltr">HI Eric,<div><br></div><div>As to the first question, do we have any evidence that the information we get from FindMPI.cmake is insufficient for our purposes? My default position would be that we should change our cmake to be more in line with standard usage rather than try to warp the standard usage to fit our legacy approach. </div><div><br></div><div>Since MPI_COMM_WORLD is no longer directly exposed, it might be the case that the answer to your second question involves making utility module an OBJECT so that MPI can be linked privately. Then we could just expose an API call that gives the MPI version/compiler info for the utility module. I am a bit out of my depth here, so let me know if this solution is way off base.</div><div><br></div><div>Joe</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 17, 2022 at 2:03 PM Eric Irrgang &lt;<a href="mailto:ericirrgang@gmail.com">ericirrgang@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Devs.<br>
<br>
I&#39;m writing to ask for input on improving support for integrating gromacs libraries into external MPI-aware code.<br>
<br>
Background: I&#39;m trying to finish up the Python bindings to allow an MPI communicator to be passed to libgromacs (to be used instead of MPI_COMM_WORLD).<br>
<br>
Here are some questions that need to be answered. If you have any input, please let me know.<br>
<br>
If you prefer to log your responses in the issue tracking system, please see <a href="https://gitlab.com/gromacs/gromacs/-/issues/3777" rel="noreferrer" target="_blank">https://gitlab.com/gromacs/gromacs/-/issues/3777</a> and <a href="https://gitlab.com/gromacs/gromacs/-/issues/4447" rel="noreferrer" target="_blank">https://gitlab.com/gromacs/gromacs/-/issues/4447</a><br>
<br>
<br>
Questions:<br>
<br>
* What should we add to <a href="https://gitlab.com/gromacs/gromacs/-/blob/main/src/gromacs/gromacs-hints.in.cmake" rel="noreferrer" target="_blank">https://gitlab.com/gromacs/gromacs/-/blob/main/src/gromacs/gromacs-hints.in.cmake</a> to help hint `find_package(MPI ...)`? (<a href="https://cmake.org/cmake/help/latest/module/FindMPI.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/latest/module/FindMPI.html</a>)<br>
<br>
* If a user of a client project has difficulty determining the actual compiler path associated with the MPI compiler wrapper they are advised to use, how might we provide better feedback from our `gromacs_check_compiler()` CMake function? <a href="https://gitlab.com/gromacs/gromacs/-/blob/main/src/gromacs/gromacs-config.cmake.cmakein#L128" rel="noreferrer" target="_blank">https://gitlab.com/gromacs/gromacs/-/blob/main/src/gromacs/gromacs-config.cmake.cmakein#L128</a><br>
<br>
<br>
Additional background:<br>
<br>
With <a href="https://gitlab.com/gromacs/gromacs/-/issues/3671" rel="noreferrer" target="_blank">https://gitlab.com/gromacs/gromacs/-/issues/3671</a>, we resolved that the appropriate way to configure CMake is to provide the non-wrapper compilers to CMAKE_CXX_COMPILER and to provide the MPI-wrapper paths only to MPI_CXX_COMPILER (if necessary).<br>
<br>
However, FindMPI only reports the compiler wrapper path by setting MPI_&lt;lang&gt;_COMPILER. It does not gain or report any additional insight on the path to the wrapped compiler, as far as I can tell. It _does_ find and use the appropriate &quot;showme&quot; option and does its best to confirm that the wrapped compiler and the CMAKE_&lt;LANG&gt;_COMPILER is that same or compatible, but it FindMPI.cmake does not return the MPI_COMPILE_CMDLINE that it calculates, and it may not have an absolute path to the compiler, anyway.<br>
<br>
Best,<br>
Eric<br>
-- <br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="https://www.gromacs.org/gmx-devel.html" rel="noreferrer" target="_blank">https://www.gromacs.org/gmx-devel.html</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="https://www.gromacs.org/gmx-devel.html" rel="noreferrer" target="_blank">https://www.gromacs.org/gmx-devel.html</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.<br>
</blockquote></div>