FindMPI: Use physical cores for MPIEXEC_MAX_NUMPROCS
Since !740 (merged) in CMake 3.9 the ProcessorCount
module is being used to initialize MPIEXEC_MAX_NUMPROCS
. This however leads to the logical cores being counted rather than the physical ones, and some MPI implementations like OpenMPI will error if mpiexec
is called with that number. This MR switches it to the number of physical cores using cmake_host_system_information
.
This ensures that if MPIEXEC_MAX_NUMPROCS
is being used to set up MPI tests with CTest or similar that the tests won't spuriously fail due to OpenMPI refusing to start the application.
Edited by Brad King