Skip to content

Make compatible with PETSc when it is built with SLATE #3473

Description

@cmacmackin

I have found that installing PETSc with both STRUMPACK and SLATE support means that BOUT++ will fail if trying to use the STRUMPACK solver. If STRUMPACK is installed without SLATE then there is no issue. The error message is

[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: No support for this operation on this system
[0]PETSC ERROR: SLATE requires MPI_THREAD_MULTIPLE

PETSc provides a function PetscSetMPIThreadRequiredType which can be used to set MPI_THREAD_MULTIPLE. According to its documentation, "Packages such as SLATE may require MPI_THREAD_MULTIPLE." Therefore, it appears that we should invoke this function before PetscInitialize if PETSc has been installed with SLATE.

I think this can be done by adding the following lines to PetscLib::PetscLib:

#if PetscDefined(HAVE_STRUMPACK) && PetscDefined(HAVE_SLATE)
PetscSetMPIThreadRequiredType(MPI_THREAD_MULTIPLE)
#endif

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions