]> https://gitweb.dealii.org/ - dealii.git/commit
Fix a problem with combining MPI::LargeCount and PETSc. 13885/head
authorDavid Wells <drwells@email.unc.edu>
Wed, 1 Jun 2022 15:58:53 +0000 (11:58 -0400)
committerDavid Wells <drwells@email.unc.edu>
Wed, 1 Jun 2022 17:13:34 +0000 (13:13 -0400)
commitf5a5786a9658ef53fad926bcc8ec7f4e33138405
treec81ac7a5e68e3dab34855c61f1eeed80df63edb0
parent5cd3f86a6b80d477f1d95c1c0642da479bf4d238
Fix a problem with combining MPI::LargeCount and PETSc.

PETSc, in petsclog.h, implements logging by redefining all MPI functions as
macros, e.g.,

    #define MPI_Send_c(buf,count,datatype,dest,tag,comm) \
    ((petsc_send_ct++,0) || PetscMPITypeSize((count),(datatype),(&petsc_send_len)) || MPI_Send_c((buf),(count),(datatype),(dest),(tag),(comm)))

This only works when all MPI declarations are made before these macro
definitions. Hence this library won't work with PETSc unless we include headers
in the right order.

Work around this by removing the MPI_ prefix from these function definitions.
Since we put these functions in our own namespace there is no need for them to
have the same names as the normal MPI functions.
include/deal.II/base/mpi_large_count.h
source/base/data_out_base.cc
source/base/mpi.cc
source/distributed/tria_base.cc

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.