[CMake] MPI wrappers vs FindMPI

Zaak Beekman zbeekman at gmail.com
Mon Dec 7 09:40:59 EST 2015


Thanks for the insight Brad.

Another advantage may be that the FindMPI module knows about what `mpirun`
or `mpiexec` is called, as well as some common flags, like number of ranks
to execute. Since OpenCoarrays writes an MPI compiler wrapper script and a
script to run the executable, `caf` and `cafrun`, using FindMPI could also
help reduce the overhead of knowing about different MPI implementations and
their peculiarities; this task would effectively be delighted to FindMPI...

Damian,
I'll poke around in the CMake code and we can discuss this on Friday.

Thanks again,
-Zaak

On Mon, Dec 7, 2015 at 8:56 AM Brad King <brad.king at kitware.com> wrote:

> On 12/04/2015 05:51 PM, Zaak Beekman wrote:
> > What are the pros and cons of using FindMPI over passing FC=mpif90 and
> CC=mpicc?
>
> It shouldn't matter much if all the code in the project is meant
> to be build for MPI.  Using plain FindMPI with the CC/CXX/FC set
> to the system compilers is cleaner for building only a subset of
> targets for MPI.  FindMPI will look for the MPI compilers separately
> in order to ask them for the proper flags to tell the system compiler
> how to use MPI, and then project CMake code can take responsibility
> for applying that information to the desired subset of its targets.
> Using CC=mpicc, FindMPI will recognize that the C compiler is already
> a MPI compiler and not bother to look for a separate one to query
> the settings (and similarly for C++ and Fortran).
>
> -Brad
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151207/8bf62c43/attachment-0001.html>


More information about the CMake mailing list