]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Require PETSc to be configured with MPI support 15787/head
authorDaniel Arndt <arndtd@ornl.gov>
Mon, 24 Jul 2023 12:55:06 +0000 (08:55 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 24 Jul 2023 13:24:17 +0000 (09:24 -0400)
15 files changed:
cmake/configure/configure_20_petsc.cmake
doc/news/changes/incompatibilities/20230724DanielArndt [new file with mode: 0644]
include/deal.II/base/config.h.in
include/deal.II/base/mpi_stub.h
source/lac/petsc_communication_pattern.cc
source/lac/petsc_matrix_base.cc
source/lac/petsc_parallel_vector.cc
source/lac/petsc_vector_base.cc
tests/lac/utilities_01.with_petsc=true.with_petsc_with_complex=false.output [moved from tests/lac/utilities_01.with_mpi=true.with_petsc=true.with_petsc_with_complex=false.output with 100% similarity]
tests/lac/vector_type_traits_is_serial_03.with_petsc=true.output [moved from tests/lac/vector_type_traits_is_serial_03.with_petsc=true.with_mpi=true.output with 100% similarity]
tests/petsc/different_matrix_preconditioner.with_petsc_with_hypre=true.output [moved from tests/petsc/different_matrix_preconditioner.with_mpi=true.with_petsc_with_hypre=true.output with 100% similarity]
tests/petsc/reinit_preconditioner_02.with_petsc_with_hypre=true.with_64bit_indices=off.output [moved from tests/petsc/reinit_preconditioner_02.with_petsc_with_hypre=true.with_64bit_indices=off.with_mpi=true.output with 100% similarity]
tests/petsc/solver_03_precondition_boomeramg.with_petsc_with_hypre=true.output [moved from tests/petsc/solver_03_precondition_boomeramg.with_mpi=true.with_petsc_with_hypre=true.output with 100% similarity]
tests/petsc/solver_03_precondition_boomeramg_symmetric.with_petsc_with_hypre=true.output [moved from tests/petsc/solver_03_precondition_boomeramg_symmetric.with_mpi=true.with_petsc_with_hypre=true.output with 100% similarity]
tests/petsc/solver_03_precondition_parasails.with_64bit_indices=off.with_petsc_with_hypre=true.output [moved from tests/petsc/solver_03_precondition_parasails.with_64bit_indices=off.with_petsc_with_hypre=true.with_mpi=true.output with 100% similarity]

index 850a2f6af9c47bef50c66394f0d035acbe711ff7..9998b71779cf3b6ba7e6455f0187836b0f48d8f7 100644 (file)
@@ -17,7 +17,7 @@
 # Configuration for the petsc library:
 #
 
-set(FEATURE_PETSC_AFTER MPI)
+set(FEATURE_PETSC_DEPENDS MPI)
 
 
 macro(feature_petsc_find_external var)
@@ -51,17 +51,14 @@ macro(feature_petsc_find_external var)
     # _NOT_ enabled.
     # So we check for this:
     #
-    if( (PETSC_WITH_MPIUNI AND DEAL_II_WITH_MPI)
-         OR
-         (NOT PETSC_WITH_MPIUNI AND NOT DEAL_II_WITH_MPI))
+    if(PETSC_WITH_MPIUNI)
       message(STATUS "Could not find a sufficient PETSc installation: "
-        "PETSc has to be configured with the same MPI configuration as deal.II."
+        "PETSc has to be configured with MPI support."
         )
       set(PETSC_ADDITIONAL_ERROR_STRING
         ${PETSC_ADDITIONAL_ERROR_STRING}
         "Could not find a sufficient PETSc installation:\n"
-        "PETSc has to be configured with the same MPI configuration as deal.II, but found:\n"
-        "  DEAL_II_WITH_MPI = ${DEAL_II_WITH_MPI}\n"
+        "PETSc has to be configured with the MPI support, but found:\n"
         "  PETSC_WITH_MPI   = (NOT ${PETSC_WITH_MPIUNI})\n"
         )
       set(${var} FALSE)
diff --git a/doc/news/changes/incompatibilities/20230724DanielArndt b/doc/news/changes/incompatibilities/20230724DanielArndt
new file mode 100644 (file)
index 0000000..5e7a01c
--- /dev/null
@@ -0,0 +1,3 @@
+Removed: Support for PETSc without MPI has been removed.
+<br>
+(Daniel Arndt, 2023/07/24)
index ae74303461d75c1944202f3378a94aed645f349a..9203616264fd50303c93959577c991eb7ad445f8 100644 (file)
@@ -572,7 +572,7 @@ _Pragma("GCC diagnostic pop")
  * Some systems require including mpi.h before stdio.h which happens in
  * types.h
  */
-#if defined(DEAL_II_WITH_MPI) || defined(DEAL_II_WITH_PETSC)
+#if defined(DEAL_II_WITH_MPI)
 DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
 #  include <mpi.h>
 DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
index aab8574451adf4dc7b2b54511d2830ffdac9b027..695fe40f3080610a6403ef170b2b265b6299d232 100644 (file)
@@ -22,7 +22,7 @@
 // types and global constants for the no-MPI case. This way we can still use,
 // e.g., MPI_Comm in the API.
 
-#if defined(DEAL_II_WITH_MPI) || defined(DEAL_II_WITH_PETSC)
+#if defined(DEAL_II_WITH_MPI)
 #  include <mpi.h>
 #else
 // without MPI, we would still like to use
index c2eb6c87b6601e50c505b4439363aacccdbd7963..61124d223321f3661df59f5587efcbc6e8287d8b 100644 (file)
@@ -277,23 +277,13 @@ namespace PETScWrappers
     const ArrayView<const Number> &src,
     const ArrayView<Number> &      dst) const
   {
-#  ifdef DEAL_II_WITH_MPI
     auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
 
-#    if DEAL_II_PETSC_VERSION_LT(3, 15, 0)
+#  if DEAL_II_PETSC_VERSION_LT(3, 15, 0)
     AssertPETSc(PetscSFBcastBegin(sf, datatype, src.data(), dst.data()));
-#    else
+#  else
     AssertPETSc(
       PetscSFBcastBegin(sf, datatype, src.data(), dst.data(), MPI_REPLACE));
-#    endif
-
-#  else
-
-    (void)src;
-    (void)dst;
-    Assert(false,
-           ExcMessage("This program is running without MPI. There should "
-                      "not be anything to import or export!"));
 #  endif
   }
 
@@ -305,23 +295,13 @@ namespace PETScWrappers
     const ArrayView<const Number> &src,
     const ArrayView<Number> &      dst) const
   {
-#  ifdef DEAL_II_WITH_MPI
     auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
 
-#    if DEAL_II_PETSC_VERSION_LT(3, 15, 0)
+#  if DEAL_II_PETSC_VERSION_LT(3, 15, 0)
     AssertPETSc(PetscSFBcastEnd(sf, datatype, src.data(), dst.data()));
-#    else
+#  else
     AssertPETSc(
       PetscSFBcastEnd(sf, datatype, src.data(), dst.data(), MPI_REPLACE));
-#    endif
-
-#  else
-
-    (void)src;
-    (void)dst;
-    Assert(false,
-           ExcMessage("This program is running without MPI. There should "
-                      "not be anything to import or export!"));
 #  endif
   }
 
@@ -346,22 +326,11 @@ namespace PETScWrappers
     const ArrayView<const Number> &src,
     const ArrayView<Number> &      dst) const
   {
-#  ifdef DEAL_II_WITH_MPI
     MPI_Op mpiop    = (op == VectorOperation::insert) ? MPI_REPLACE : MPI_SUM;
     auto   datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
 
     AssertPETSc(
       PetscSFReduceBegin(sf, datatype, src.data(), dst.data(), mpiop));
-
-#  else
-
-    (void)op;
-    (void)src;
-    (void)dst;
-    Assert(false,
-           ExcMessage("This program is running without MPI. There should "
-                      "not be anything to import or export!"));
-#  endif
   }
 
 
@@ -373,21 +342,10 @@ namespace PETScWrappers
     const ArrayView<const Number> &src,
     const ArrayView<Number> &      dst) const
   {
-#  ifdef DEAL_II_WITH_MPI
     MPI_Op mpiop    = (op == VectorOperation::insert) ? MPI_REPLACE : MPI_SUM;
     auto   datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
 
     AssertPETSc(PetscSFReduceEnd(sf, datatype, src.data(), dst.data(), mpiop));
-
-#  else
-
-    (void)op;
-    (void)src;
-    (void)dst;
-    Assert(false,
-           ExcMessage("This program is running without MPI. There should "
-                      "not be anything to import or export!"));
-#  endif
   }
 
 
index 2949542d663745ce7f53e34499ca2368d1a3587b..4246a864e6e51047de6572a1c9093080136b7482 100644 (file)
@@ -247,7 +247,6 @@ namespace PETScWrappers
   {
     {
 #  ifdef DEBUG
-#    ifdef DEAL_II_WITH_MPI
       // Check that all processors agree that last_action is the same (or none!)
 
       int my_int_last_action = last_action;
@@ -265,7 +264,6 @@ namespace PETScWrappers
                     (VectorOperation::add | VectorOperation::insert),
                   ExcMessage("Error: not all processors agree on the last "
                              "VectorOperation before this compress() call."));
-#    endif
 #  endif
     }
 
index 91a40a087e9acc48b78977548b81e1e3970016e2..2db8381ddd1a45374ed30b76da9d241147e845f8 100644 (file)
@@ -349,15 +349,11 @@ namespace PETScWrappers
     Vector::all_zero() const
     {
       unsigned int has_nonzero = VectorBase::all_zero() ? 0 : 1;
-#  ifdef DEAL_II_WITH_MPI
       // in parallel, check that the vector
       // is zero on _all_ processors.
       unsigned int num_nonzero =
         Utilities::MPI::sum(has_nonzero, this->get_mpi_communicator());
       return num_nonzero == 0;
-#  else
-      return has_nonzero == 0;
-#  endif
     }
 
 
index c8e0946464db6dfa1c0b9e27702ad07c55838daf..5cfc76f8788073802a8a07171a79562014ac5328 100644 (file)
@@ -542,7 +542,6 @@ namespace PETScWrappers
   {
     {
 #  ifdef DEBUG
-#    ifdef DEAL_II_WITH_MPI
       // Check that all processors agree that last_action is the same (or none!)
 
       int my_int_last_action = last_action;
@@ -560,7 +559,6 @@ namespace PETScWrappers
                     (VectorOperation::add | VectorOperation::insert),
                   ExcMessage("Error: not all processors agree on the last "
                              "VectorOperation before this compress() call."));
-#    endif
 #  endif
     }
 

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.