Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Test to verify MPI discovery #33

Closed
wants to merge 3 commits into from

Conversation

fsimonis
Copy link

This PR adds a test to verify the MPI discovery by compiling the following snippet:

include<mpi.h>
int main (int argc, char* argv[]) {
  return 0;
}

Success

-- Performing Test petsc-mpi
-- Performing Test petsc-mpi - Success
-- petsc_lib_dir /.../.../petsc/x68_64/lib
-- Recognized PETSc install with single library for all packages
-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal
-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal - Success

Failure

-- Performing Test petsc-mpi
-- Performing Test petsc-mpi - Failure
CMake Error at .../cmake-modules/FindPETSc.cmake:82 (message):
  Compilation of the petsc mpi test failed.  This indicates that the compiler
  cannot find mpi.h.  Make sure to set the compiler to the compiler wrapper
  provided by your MPI version prior to calling this script.

  Logfile of the compilation:
  /.../.../build/CMakeFiles/FindPETSc/petsc-mpi.log
Call Stack (most recent call first):
  CMakeLists.txt:60 (find_package)


-- Configuring incomplete, errors occurred!

Closes #32

@jedbrown
Copy link
Owner

One quirk I forgot to mention is that PETSc can be configured without MPI, so we shouldn't insist on it here. Maybe only do this test if a PETSc compile fails?

Extend the MPI check to detect missing MPI libs.
Turned the MPI check into a function.
Added function to check the petscsys include.
Added simple diagnostics on failure.
Skip diagnostics on QUIET
Run tests, but skip diagnostics output if not REQUIRED
Refactor diagnostics into separate function
@fsimonis
Copy link
Author

@jedbrown I realised that later too.

Anyhow, I turned the mpi check into a set of diagnostics which run after the standard tests fail.
This should give the user some guidance on where to start.

@fsimonis fsimonis closed this Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FindPETSc tests fail with missing include <mpi.h>
2 participants