]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename the new variable.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 26 Feb 2022 00:13:53 +0000 (17:13 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 3 Mar 2022 21:42:52 +0000 (14:42 -0700)
include/deal.II/base/mpi.h
include/deal.II/base/mpi.templates.h
include/deal.II/base/mpi_noncontiguous_partitioner.templates.h
include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h
source/base/mpi.cc
source/base/partitioner.cc
source/base/process_grid.cc
source/distributed/repartitioning_policy_tools.cc
source/distributed/tria_base.cc
source/lac/scalapack.cc
source/matrix_free/vector_data_exchange.cc

index ef19e0a0249e3da334c2cc12bf99986b6486083a..61bb98aab23125e568de1f583420ebc1fea4bdef 100644 (file)
@@ -1450,16 +1450,16 @@ namespace Utilities
      * template argument to the corresponding
      * `MPI_Datatype` to be used for MPI communication.
      *
-     * As an example, the value of `mpi_type_id<int>` is `MPI_INT`. A
+     * As an example, the value of `mpi_type_id_for_type<int>` is `MPI_INT`. A
      * common way to use this variable is when sending an object `obj`
      * via MPI functions to another process, and using
-     * `mpi_type_id<decltype(obj)>` to infer the correct MPI type to
+     * `mpi_type_id_for_type<decltype(obj)>` to infer the correct MPI type to
      * use for the communication.
      */
     template <typename T>
-    const MPI_Datatype mpi_type_id = internal::MPIDataTypes::mpi_type_id(
-      static_cast<std::remove_cv_t<
-        std::remove_reference_t<std::remove_all_extents_t<T>>> *>(nullptr));
+    const MPI_Datatype
+      mpi_type_id_for_type = internal::MPIDataTypes::mpi_type_id(
+        static_cast<std::remove_cv_t<std::remove_reference_t<T>> *>(nullptr));
 #endif
 
 #ifndef DOXYGEN
@@ -1820,7 +1820,7 @@ namespace Utilities
 
           const int ierr = MPI_Bcast(buffer + total_sent_count,
                                      current_count,
-                                     mpi_type_id<decltype(*buffer)>,
+                                     mpi_type_id_for_type<decltype(*buffer)>,
                                      root,
                                      comm);
           AssertThrowMPI(ierr);
@@ -1860,7 +1860,7 @@ namespace Utilities
       // Exchange the size of buffer
       int ierr = MPI_Bcast(&buffer_size,
                            1,
-                           mpi_type_id<decltype(buffer_size)>,
+                           mpi_type_id_for_type<decltype(buffer_size)>,
                            root_process,
                            comm);
       AssertThrowMPI(ierr);
index 0af2709a1c7c609abd08a1373ab53d039ac96f9f..ccccc91c1bd07b4a0b247cb25187512462baab39 100644 (file)
@@ -85,7 +85,7 @@ namespace Utilities
                               MPI_IN_PLACE,
                             static_cast<void *>(output.data()),
                             static_cast<int>(values.size()),
-                            mpi_type_id<decltype(*values.data())>,
+                            mpi_type_id_for_type<decltype(*values.data())>,
                             mpi_op,
                             mpi_communicator);
             AssertThrowMPI(ierr);
@@ -125,7 +125,7 @@ namespace Utilities
                               MPI_IN_PLACE,
                             static_cast<void *>(output.data()),
                             static_cast<int>(values.size() * 2),
-                            mpi_type_id<T>,
+                            mpi_type_id_for_type<T>,
                             mpi_op,
                             mpi_communicator);
             AssertThrowMPI(ierr);
index e342968988b4c70cb90bc9a59362cddf9822668f..e0bb07313790afcd46ec439383b138bc81a343c4 100644 (file)
@@ -106,13 +106,14 @@ namespace Utilities
       AssertIndexRange(recv_ranks.size(), recv_ptr.size());
       for (types::global_dof_index i = 0; i < recv_ranks.size(); ++i)
         {
-          const int ierr = MPI_Irecv(buffers.data() + recv_ptr[i],
-                                     recv_ptr[i + 1] - recv_ptr[i],
-                                     Utilities::MPI::mpi_type_id<Number>,
-                                     recv_ranks[i],
-                                     tag,
-                                     communicator,
-                                     &requests[i + send_ranks.size()]);
+          const int ierr =
+            MPI_Irecv(buffers.data() + recv_ptr[i],
+                      recv_ptr[i + 1] - recv_ptr[i],
+                      Utilities::MPI::mpi_type_id_for_type<Number>,
+                      recv_ranks[i],
+                      tag,
+                      communicator,
+                      &requests[i + send_ranks.size()]);
           AssertThrowMPI(ierr);
         }
 
@@ -134,13 +135,14 @@ namespace Utilities
                    (send_ptr[i] == buffers.size() &&
                     send_ptr[i + 1] == send_ptr[i]),
                  ExcMessage("The input buffer doesn't contain enough entries"));
-          const int ierr = MPI_Isend(buffers.data() + send_ptr[i],
-                                     send_ptr[i + 1] - send_ptr[i],
-                                     Utilities::MPI::mpi_type_id<Number>,
-                                     send_ranks[i],
-                                     tag,
-                                     communicator,
-                                     &requests[i]);
+          const int ierr =
+            MPI_Isend(buffers.data() + send_ptr[i],
+                      send_ptr[i + 1] - send_ptr[i],
+                      Utilities::MPI::mpi_type_id_for_type<Number>,
+                      send_ranks[i],
+                      tag,
+                      communicator,
+                      &requests[i]);
           AssertThrowMPI(ierr);
         }
 #endif
index 742f8bc05af046d06aa15bed4a4741f42d4ebd6b..4e4e88db049df33100a863f60643b833a0721855 100644 (file)
@@ -571,7 +571,7 @@ namespace internal
             const auto ierr_1 = MPI_Isend(
               buffer.data(),
               buffer.size(),
-              Utilities::MPI::mpi_type_id<decltype(*buffer.data())>,
+              Utilities::MPI::mpi_type_id_for_type<decltype(*buffer.data())>,
               i.first,
               Utilities::MPI::internal::Tags::fine_dof_handler_view_reinit,
               communicator,
@@ -640,7 +640,7 @@ namespace internal
             int       message_length;
             const int ierr_2 = MPI_Get_count(
               &status,
-              Utilities::MPI::mpi_type_id<decltype(*buffer.data())>,
+              Utilities::MPI::mpi_type_id_for_type<decltype(*buffer.data())>,
               &message_length);
             AssertThrowMPI(ierr_2);
 
@@ -649,7 +649,7 @@ namespace internal
             const int ierr_3 = MPI_Recv(
               buffer.data(),
               buffer.size(),
-              Utilities::MPI::mpi_type_id<decltype(*buffer.data())>,
+              Utilities::MPI::mpi_type_id_for_type<decltype(*buffer.data())>,
               status.MPI_SOURCE,
               Utilities::MPI::internal::Tags::fine_dof_handler_view_reinit,
               communicator,
index 3a94760614af20c894ea1f1db9300193d09311b1..b43397d77ead473d50ebd0df95c3362ab813feb1 100644 (file)
@@ -89,21 +89,21 @@ namespace Utilities
   {
 #ifdef DEAL_II_WITH_MPI
     // Provide definitions of template variables for all valid instantiations.
-    template const MPI_Datatype mpi_type_id<bool>;
-    template const MPI_Datatype mpi_type_id<char>;
-    template const MPI_Datatype mpi_type_id<signed char>;
-    template const MPI_Datatype mpi_type_id<short>;
-    template const MPI_Datatype mpi_type_id<int>;
-    template const MPI_Datatype mpi_type_id<long int>;
-    template const MPI_Datatype mpi_type_id<unsigned char>;
-    template const MPI_Datatype mpi_type_id<unsigned short>;
-    template const MPI_Datatype mpi_type_id<unsigned long int>;
-    template const MPI_Datatype mpi_type_id<unsigned long long int>;
-    template const MPI_Datatype mpi_type_id<float>;
-    template const MPI_Datatype mpi_type_id<double>;
-    template const MPI_Datatype mpi_type_id<long double>;
-    template const MPI_Datatype mpi_type_id<std::complex<float>>;
-    template const MPI_Datatype mpi_type_id<std::complex<double>>;
+    template const MPI_Datatype mpi_type_id_for_type<bool>;
+    template const MPI_Datatype mpi_type_id_for_type<char>;
+    template const MPI_Datatype mpi_type_id_for_type<signed char>;
+    template const MPI_Datatype mpi_type_id_for_type<short>;
+    template const MPI_Datatype mpi_type_id_for_type<int>;
+    template const MPI_Datatype mpi_type_id_for_type<long int>;
+    template const MPI_Datatype mpi_type_id_for_type<unsigned char>;
+    template const MPI_Datatype mpi_type_id_for_type<unsigned short>;
+    template const MPI_Datatype mpi_type_id_for_type<unsigned long int>;
+    template const MPI_Datatype mpi_type_id_for_type<unsigned long long int>;
+    template const MPI_Datatype mpi_type_id_for_type<float>;
+    template const MPI_Datatype mpi_type_id_for_type<double>;
+    template const MPI_Datatype mpi_type_id_for_type<long double>;
+    template const MPI_Datatype mpi_type_id_for_type<std::complex<float>>;
+    template const MPI_Datatype mpi_type_id_for_type<std::complex<double>>;
 #endif
 
 
index e6b12f3a2e4860ef318673b9444f2d251fa5a8bc..c83ba560422b24df6269626b251b13da34a2ba11 100644 (file)
@@ -80,7 +80,7 @@ namespace Utilities
         MPI_Exscan(&local_size,
                    &prefix_sum,
                    1,
-                   Utilities::MPI::mpi_type_id<decltype(prefix_sum)>,
+                   Utilities::MPI::mpi_type_id_for_type<decltype(prefix_sum)>,
                    MPI_SUM,
                    communicator);
       AssertThrowMPI(ierr);
index d7e97a616b612b145aeec9af49f5b4b0f397f445..090f738941cd02180a4711eae1ef21f65f81651d 100644 (file)
@@ -250,7 +250,7 @@ namespace Utilities
           const int ierr =
             MPI_Bcast(value,
                       count,
-                      Utilities::MPI::mpi_type_id<decltype(*value)>,
+                      Utilities::MPI::mpi_type_id_for_type<decltype(*value)>,
                       0 /*from root*/,
                       mpi_communicator_inactive_with_root);
           AssertThrowMPI(ierr);
index 10b56b5dc7d342a986eb738291d6f8478a0d1982..bce7f278671cbc545b27ae5eb810cca295363ef8 100644 (file)
@@ -89,7 +89,7 @@ namespace RepartitioningPolicyTools
     const int ierr = MPI_Exscan(&process_has_active_locally_owned_cells,
                                 &offset,
                                 1,
-                                Utilities::MPI::mpi_type_id<decltype(
+                                Utilities::MPI::mpi_type_id_for_type<decltype(
                                   process_has_active_locally_owned_cells)>,
                                 MPI_SUM,
                                 comm);
@@ -308,23 +308,24 @@ namespace RepartitioningPolicyTools
     // determine partial sum of weights of this process
     uint64_t process_local_weight_offset = 0;
 
-    int ierr =
-      MPI_Exscan(&process_local_weight,
-                 &process_local_weight_offset,
-                 1,
-                 Utilities::MPI::mpi_type_id<decltype(process_local_weight)>,
-                 MPI_SUM,
-                 tria->get_communicator());
+    int ierr = MPI_Exscan(
+      &process_local_weight,
+      &process_local_weight_offset,
+      1,
+      Utilities::MPI::mpi_type_id_for_type<decltype(process_local_weight)>,
+      MPI_SUM,
+      tria->get_communicator());
     AssertThrowMPI(ierr);
 
     // total weight of all processes
     uint64_t total_weight = process_local_weight_offset + process_local_weight;
 
-    ierr = MPI_Bcast(&total_weight,
-                     1,
-                     Utilities::MPI::mpi_type_id<decltype(total_weight)>,
-                     n_subdomains - 1,
-                     mpi_communicator);
+    ierr =
+      MPI_Bcast(&total_weight,
+                1,
+                Utilities::MPI::mpi_type_id_for_type<decltype(total_weight)>,
+                n_subdomains - 1,
+                mpi_communicator);
     AssertThrowMPI(ierr);
 
     // setup partition
index 9cbaeb689547c7f80518cd74f9854a98a2996e2e..6c83d1fc30d9291651299589c758894fbcc4b858 100644 (file)
@@ -423,13 +423,13 @@ namespace parallel
     // 2) determine the offset of each process
     types::global_cell_index cell_index = 0;
 
-    const int ierr =
-      MPI_Exscan(&n_locally_owned_cells,
-                 &cell_index,
-                 1,
-                 Utilities::MPI::mpi_type_id<decltype(n_locally_owned_cells)>,
-                 MPI_SUM,
-                 this->mpi_communicator);
+    const int ierr = MPI_Exscan(
+      &n_locally_owned_cells,
+      &cell_index,
+      1,
+      Utilities::MPI::mpi_type_id_for_type<decltype(n_locally_owned_cells)>,
+      MPI_SUM,
+      this->mpi_communicator);
     AssertThrowMPI(ierr);
 
     // 3) give global indices to locally-owned cells and mark all other cells as
@@ -493,13 +493,13 @@ namespace parallel
         std::vector<types::global_cell_index> cell_index(
           this->n_global_levels(), 0);
 
-        int ierr = MPI_Exscan(
-          n_locally_owned_cells.data(),
-          cell_index.data(),
-          this->n_global_levels(),
-          Utilities::MPI::mpi_type_id<decltype(*n_locally_owned_cells.data())>,
-          MPI_SUM,
-          this->mpi_communicator);
+        int ierr = MPI_Exscan(n_locally_owned_cells.data(),
+                              cell_index.data(),
+                              this->n_global_levels(),
+                              Utilities::MPI::mpi_type_id_for_type<decltype(
+                                *n_locally_owned_cells.data())>,
+                              MPI_SUM,
+                              this->mpi_communicator);
         AssertThrowMPI(ierr);
 
         // 3) determine global number of "active" cells on each level
@@ -512,7 +512,7 @@ namespace parallel
         ierr = MPI_Bcast(
           n_cells_level.data(),
           this->n_global_levels(),
-          Utilities::MPI::mpi_type_id<decltype(*n_cells_level.data())>,
+          Utilities::MPI::mpi_type_id_for_type<decltype(*n_cells_level.data())>,
           this->n_subdomains - 1,
           this->mpi_communicator);
         AssertThrowMPI(ierr);
index 666056d90d916e680ff4f100878f1746353ecacb..641be56c3cb76a89911500a8e0517fcfd733bed8 100644 (file)
@@ -184,14 +184,14 @@ ScaLAPACKMatrix<NumberType>::ScaLAPACKMatrix(
     }
   int ierr = MPI_Bcast(&n_rows,
                        1,
-                       Utilities::MPI::mpi_type_id<decltype(n_rows)>,
+                       Utilities::MPI::mpi_type_id_for_type<decltype(n_rows)>,
                        0 /*from root*/,
                        process_grid->mpi_communicator);
   AssertThrowMPI(ierr);
 
   ierr = MPI_Bcast(&n_columns,
                    1,
-                   Utilities::MPI::mpi_type_id<decltype(n_columns)>,
+                   Utilities::MPI::mpi_type_id_for_type<decltype(n_columns)>,
                    0 /*from root*/,
                    process_grid->mpi_communicator);
   AssertThrowMPI(ierr);
index dd6a1d4618e0da208be1ca166fbfe010240a23c7..e652a11fb7432e15f264dc80e20f37f40219761e 100644 (file)
@@ -893,15 +893,15 @@ namespace internal
               n_ghost_indices_in_larger_set_by_remote_rank[i] -
               ghost_targets_data[i][2];
 
-            const int ierr =
-              MPI_Irecv(buffer.data() + ghost_targets_data[i][1] + offset,
-                        ghost_targets_data[i][2],
-                        Utilities::MPI::mpi_type_id<decltype(*buffer.data())>,
-                        ghost_targets_data[i][0],
-                        communication_channel + 1,
-                        comm,
-                        requests.data() + sm_import_ranks.size() +
-                          sm_ghost_ranks.size() + i);
+            const int ierr = MPI_Irecv(
+              buffer.data() + ghost_targets_data[i][1] + offset,
+              ghost_targets_data[i][2],
+              Utilities::MPI::mpi_type_id_for_type<decltype(*buffer.data())>,
+              ghost_targets_data[i][0],
+              communication_channel + 1,
+              comm,
+              requests.data() + sm_import_ranks.size() + sm_ghost_ranks.size() +
+                i);
             AssertThrowMPI(ierr);
           }
 
@@ -920,7 +920,7 @@ namespace internal
             const int ierr = MPI_Isend(
               temporary_storage.data() + import_targets_data[i][1],
               import_targets_data[i][2],
-              Utilities::MPI::mpi_type_id<decltype(*data_this.data())>,
+              Utilities::MPI::mpi_type_id_for_type<decltype(*data_this.data())>,
               import_targets_data[i][0],
               communication_channel + 1,
               comm,
@@ -1169,29 +1169,31 @@ namespace internal
                   }
               }
 
-            const int ierr =
-              MPI_Isend(buffer.data() + ghost_targets_data[i][1],
-                        ghost_targets_data[i][2],
-                        Utilities::MPI::mpi_type_id<decltype(*buffer.data())>,
-                        ghost_targets_data[i][0],
-                        communication_channel + 0,
-                        comm,
-                        requests.data() + sm_ghost_ranks.size() +
-                          sm_import_ranks.size() + i);
+            const int ierr = MPI_Isend(
+              buffer.data() + ghost_targets_data[i][1],
+              ghost_targets_data[i][2],
+              Utilities::MPI::mpi_type_id_for_type<decltype(*buffer.data())>,
+              ghost_targets_data[i][0],
+              communication_channel + 0,
+              comm,
+              requests.data() + sm_ghost_ranks.size() + sm_import_ranks.size() +
+                i);
             AssertThrowMPI(ierr);
           }
 
         for (unsigned int i = 0; i < import_targets_data.size(); ++i)
           {
-            const int ierr = MPI_Irecv(
-              temporary_storage.data() + import_targets_data[i][1],
-              import_targets_data[i][2],
-              Utilities::MPI::mpi_type_id<decltype(*temporary_storage.data())>,
-              import_targets_data[i][0],
-              communication_channel + 0,
-              comm,
-              requests.data() + sm_ghost_ranks.size() + sm_import_ranks.size() +
-                ghost_targets_data.size() + i);
+            const int ierr =
+              MPI_Irecv(temporary_storage.data() + import_targets_data[i][1],
+                        import_targets_data[i][2],
+                        Utilities::MPI::mpi_type_id_for_type<decltype(
+                          *temporary_storage.data())>,
+                        import_targets_data[i][0],
+                        communication_channel + 0,
+                        comm,
+                        requests.data() + sm_ghost_ranks.size() +
+                          sm_import_ranks.size() + ghost_targets_data.size() +
+                          i);
             AssertThrowMPI(ierr);
           }
 #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.