]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Merge pull request #15086 from luca-heltai/stefanozampini/get_mpi_comm_nonref
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 20 Apr 2023 20:13:23 +0000 (14:13 -0600)
committerGitHub <noreply@github.com>
Thu, 20 Apr 2023 20:13:23 +0000 (14:13 -0600)
All get_mpi_communicator methods now return MPI_Comm by value

1  2 
include/deal.II/lac/petsc_block_sparse_matrix.h
include/deal.II/lac/petsc_block_vector.h
include/deal.II/lac/petsc_communication_pattern.h
source/lac/petsc_parallel_block_sparse_matrix.cc

index 1036745888d10f901b958b9456f023f9c1247523,3935a0f2c7efb7e13f39091eb7e5f20e85acac10..9bec0c860dc309414b2bae3484bff98c8a13f488
@@@ -570,19 -515,12 +569,14 @@@ namespace PETScWrapper
  
  
  
-     inline const MPI_Comm &
+     inline MPI_Comm
      BlockVector::get_mpi_communicator() const
      {
-       static MPI_Comm comm = PETSC_COMM_SELF;
-       MPI_Comm        pcomm =
-         PetscObjectComm(reinterpret_cast<PetscObject>(petsc_nest_vector));
-       if (pcomm != MPI_COMM_NULL)
-         comm = pcomm;
-       return comm;
+       return PetscObjectComm(reinterpret_cast<PetscObject>(petsc_nest_vector));
      }
  
 +
 +
      inline bool
      BlockVector::has_ghost_elements() const
      {

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.