Always call `find_package(MPI)`.
authorM. Eric Irrgang <ericirrgang@gmail.com>
Sun, 12 Sep 2021 12:20:31 +0000 (15:20 +0300)
committerM. Eric Irrgang <ericirrgang@gmail.com>
Sun, 12 Sep 2021 12:23:38 +0000 (15:23 +0300)
commit25a7a52b0bd11e5fcd07d0ee0c282ed9171e4e4e
treec9554af4c5c9907d69fdfa92192bae007892bde2
parent550db692119cd4802cb11ed1bb6ed41f50d76019
Always call `find_package(MPI)`.

It is getting increasingly hard to coordinate MPI requirements across
the toolkit that a GROMACS or its CMake infrastructure may be involved
in.

This change allows is to call `find_package(MPI)` exactly once in the
GROMACS CMake configuration and begins to normalize infrastructure on
the modern CMake FindMPI.cmake module, which has been substantially
updated since the last major revisions to gmxManageMPI.cmake.

Also, try to decouple and compartmentalize GMX_MPI, GMX_LIB_MPI, and
the presence of MPI in the build system.

Follow-up changes can continue to refine the dependent use cases and
allow more coordination of the different MPI requirements in different
build configurations.

Refs #3672
Also refs #3776
cmake/gmxManageMPI.cmake