]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Reduce header inclusions of index_set.h in evaluation_kernels 14022/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 20 Jun 2022 07:28:15 +0000 (09:28 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 20 Jun 2022 12:40:36 +0000 (14:40 +0200)
include/deal.II/base/mpi.h
include/deal.II/matrix_free/dof_info.h
include/deal.II/matrix_free/fe_evaluation_data.h
include/deal.II/matrix_free/task_info.h
include/deal.II/matrix_free/vector_data_exchange.h
source/base/mpi.cc
source/matrix_free/vector_data_exchange.cc

index f2961e2784f7aa6e20307bb7572ed69089617dd1..f89e80b42ddf8915179c6a4542e56ac12b07841d 100644 (file)
 #include <deal.II/base/config.h>
 
 #include <deal.II/base/array_view.h>
-#include <deal.II/base/index_set.h>
 #include <deal.II/base/mpi_tags.h>
 #include <deal.II/base/numbers.h>
 #include <deal.II/base/template_constraints.h>
+#include <deal.II/base/utilities.h>
 
 #include <boost/signals2.hpp>
 
@@ -116,9 +116,10 @@ namespace Utilities
    * return the @p my_partition_id 's IndexSet.
    */
   IndexSet
-  create_evenly_distributed_partitioning(const unsigned int my_partition_id,
-                                         const unsigned int n_partitions,
-                                         const IndexSet::size_type total_size);
+  create_evenly_distributed_partitioning(
+    const unsigned int            my_partition_id,
+    const unsigned int            n_partitions,
+    const types::global_dof_index total_size);
 
   /**
    * A namespace for utility functions that abstract certain operations using
@@ -485,8 +486,9 @@ namespace Utilities
      * starts at the index one larger than the last one stored on process p.
      */
     std::vector<IndexSet>
-    create_ascending_partitioning(const MPI_Comm &          comm,
-                                  const IndexSet::size_type locally_owned_size);
+    create_ascending_partitioning(
+      const MPI_Comm &              comm,
+      const types::global_dof_index locally_owned_size);
 
     /**
      * Given the total number of elements @p total_size, create an evenly
@@ -497,8 +499,8 @@ namespace Utilities
      */
     IndexSet
     create_evenly_distributed_partitioning(
-      const MPI_Comm &          comm,
-      const IndexSet::size_type total_size);
+      const MPI_Comm &              comm,
+      const types::global_dof_index total_size);
 
 #ifdef DEAL_II_WITH_MPI
     /**
index 9efe87266f01bd1e63a22e0c3fe5379da62d4230..52f40f307167fa0f78520830c3c4ea6d913791ab 100644 (file)
 #include <deal.II/base/config.h>
 
 #include <deal.II/base/exceptions.h>
-#include <deal.II/base/partitioner.h>
 #include <deal.II/base/vectorization.h>
 
 #include <deal.II/matrix_free/face_info.h>
 #include <deal.II/matrix_free/shape_info.h>
-#include <deal.II/matrix_free/task_info.h>
 #include <deal.II/matrix_free/vector_data_exchange.h>
 
 #include <array>
@@ -48,6 +46,8 @@ namespace internal
 
     template <typename, typename>
     struct FPArrayComparator;
+
+    struct TaskInfo;
   } // namespace MatrixFreeFunctions
 } // namespace internal
 
@@ -62,6 +62,14 @@ class TriaIterator;
 template <int, int, bool>
 class DoFCellAccessor;
 
+namespace Utilities
+{
+  namespace MPI
+  {
+    class Partitioner;
+  }
+} // namespace Utilities
+
 #endif
 
 namespace internal
index f4cbf4fdc21d6c6943be4dbf2528c695050f95c9..abd3f0e70c156b758ecbbc8cf9ac078b3f05c61b 100644 (file)
@@ -33,7 +33,6 @@
 #include <deal.II/matrix_free/dof_info.h>
 #include <deal.II/matrix_free/mapping_info_storage.h>
 #include <deal.II/matrix_free/shape_info.h>
-#include <deal.II/matrix_free/type_traits.h>
 
 
 DEAL_II_NAMESPACE_OPEN
index bb0851818e22655fd63233fd28eea03fadc7f33c..4cf51472566cb4880b83b5bee2fa724fe1fba1fa 100644 (file)
@@ -21,8 +21,8 @@
 #include <deal.II/base/config.h>
 
 #include <deal.II/base/exceptions.h>
-#include <deal.II/base/index_set.h>
 #include <deal.II/base/memory_consumption.h>
+#include <deal.II/base/mpi.h>
 #include <deal.II/base/tensor.h>
 #include <deal.II/base/thread_management.h>
 #include <deal.II/base/utilities.h>
index 1ce25e4507356bcbf293c158d19734ed63de7158..6a2e349740e5b9cbcf501da19f590601e316d943 100644 (file)
 
 #include <deal.II/base/config.h>
 
-#include <deal.II/base/partitioner.h>
+#include <deal.II/base/array_view.h>
+#include <deal.II/base/mpi.h>
+
+#include <deal.II/lac/vector_operation.h>
 
 
 DEAL_II_NAMESPACE_OPEN
 
+#ifndef DOXYGEN
+
+// forward declaration
+namespace Utilities
+{
+  namespace MPI
+  {
+    class Partitioner;
+  }
+} // namespace Utilities
+
+#endif
+
+
 namespace internal
 {
   namespace MatrixFreeFunctions
index 6678a8cc1059b8a30bc375698066cb35c4cf2600..9c7eec0362d124356838d0b56acc3aa8c95be772 100644 (file)
@@ -71,10 +71,15 @@ DEAL_II_NAMESPACE_OPEN
 namespace Utilities
 {
   IndexSet
-  create_evenly_distributed_partitioning(const unsigned int my_partition_id,
-                                         const unsigned int n_partitions,
-                                         const IndexSet::size_type total_size)
+  create_evenly_distributed_partitioning(
+    const unsigned int            my_partition_id,
+    const unsigned int            n_partitions,
+    const types::global_dof_index total_size)
   {
+    static_assert(
+      std::is_same<types::global_dof_index, IndexSet::size_type>::value,
+      "IndexSet::size_type must match types::global_dof_index for "
+      "using this function");
     const unsigned int remain = total_size % n_partitions;
 
     const IndexSet::size_type min_size = total_size / n_partitions;
@@ -214,9 +219,14 @@ namespace Utilities
 
 
     std::vector<IndexSet>
-    create_ascending_partitioning(const MPI_Comm &          comm,
-                                  const IndexSet::size_type locally_owned_size)
+    create_ascending_partitioning(
+      const MPI_Comm &              comm,
+      const types::global_dof_index locally_owned_size)
     {
+      static_assert(
+        std::is_same<types::global_dof_index, IndexSet::size_type>::value,
+        "IndexSet::size_type must match types::global_dof_index for "
+        "using this function");
       const unsigned int                     n_proc = n_mpi_processes(comm);
       const std::vector<IndexSet::size_type> sizes =
         all_gather(comm, locally_owned_size);
@@ -238,8 +248,9 @@ namespace Utilities
 
 
     IndexSet
-    create_evenly_distributed_partitioning(const MPI_Comm &          comm,
-                                           const IndexSet::size_type total_size)
+    create_evenly_distributed_partitioning(
+      const MPI_Comm &              comm,
+      const types::global_dof_index total_size)
     {
       const unsigned int this_proc = this_mpi_process(comm);
       const unsigned int n_proc    = n_mpi_processes(comm);
@@ -663,15 +674,17 @@ namespace Utilities
 
 
     std::vector<IndexSet>
-    create_ascending_partitioning(const MPI_Comm & /*comm*/,
-                                  const IndexSet::size_type locally_owned_size)
+    create_ascending_partitioning(
+      const MPI_Comm & /*comm*/,
+      const types::global_dof_index locally_owned_size)
     {
       return std::vector<IndexSet>(1, complete_index_set(locally_owned_size));
     }
 
     IndexSet
-    create_evenly_distributed_partitioning(const MPI_Comm & /*comm*/,
-                                           const IndexSet::size_type total_size)
+    create_evenly_distributed_partitioning(
+      const MPI_Comm & /*comm*/,
+      const types::global_dof_index total_size)
     {
       return complete_index_set(total_size);
     }
index 4c9745516d49bdff47b8edc2b3de5dbcaa5b3b33..12f6661f34b24f68891eea1d872a150b8221f823 100644 (file)
@@ -18,6 +18,7 @@
 #include <deal.II/base/mpi.templates.h>
 #include <deal.II/base/mpi_compute_index_owner_internal.h>
 #include <deal.II/base/mpi_consensus_algorithms.h>
+#include <deal.II/base/partitioner.h>
 #include <deal.II/base/timer.h>
 
 #include <deal.II/matrix_free/vector_data_exchange.h>

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.