From: Wolfgang Bangerth Date: Mon, 7 Apr 2025 21:48:16 +0000 (-0600) Subject: Minimize the use of MPI macros. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0f05607761ac43ce17507a4cadea0b9a2a998fc;p=dealii.git Minimize the use of MPI macros. --- diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index f28a3529ff..01ab0b2f13 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -7495,10 +7495,10 @@ namespace DataOutBase std::vector chunk_sizes(n_ranks); int ierr = MPI_Gather(&my_size, 1, - MPI_UINT64_T, + Utilities::MPI::mpi_type_id_for_type, static_cast(chunk_sizes.data()), 1, - MPI_UINT64_T, + Utilities::MPI::mpi_type_id_for_type, 0, comm); AssertThrowMPI(ierr); @@ -7533,7 +7533,7 @@ namespace DataOutBase /* offset = */ sizeof(header), chunk_sizes.data(), chunk_sizes.size(), - MPI_UINT64_T, + Utilities::MPI::mpi_type_id_for_type, MPI_STATUS_IGNORE); AssertThrowMPI(ierr); } @@ -7541,7 +7541,12 @@ namespace DataOutBase // Write the main part on each rank: { std::uint64_t prefix_sum = 0; - ierr = MPI_Exscan(&my_size, &prefix_sum, 1, MPI_UINT64_T, MPI_SUM, comm); + ierr = MPI_Exscan(&my_size, + &prefix_sum, + 1, + Utilities::MPI::mpi_type_id_for_type, + MPI_SUM, + comm); AssertThrowMPI(ierr); // Locate specific offset for each processor. @@ -7792,8 +7797,12 @@ DataOutInterface::write_vtu_in_parallel( // Use prefix sum to find specific offset to write at. const std::uint64_t size_on_proc = ss.str().size(); std::uint64_t prefix_sum = 0; - ierr = - MPI_Exscan(&size_on_proc, &prefix_sum, 1, MPI_UINT64_T, MPI_SUM, comm); + ierr = MPI_Exscan(&size_on_proc, + &prefix_sum, + 1, + Utilities::MPI::mpi_type_id_for_type, + MPI_SUM, + comm); AssertThrowMPI(ierr); // Locate specific offset for each processor. @@ -8021,7 +8030,7 @@ DataOutInterface::create_xdmf_entry( int ierr = MPI_Allreduce(local_node_cell_count, global_node_cell_count, 2, - MPI_UINT64_T, + Utilities::MPI::mpi_type_id_for_type, MPI_SUM, comm); AssertThrowMPI(ierr); @@ -8239,17 +8248,18 @@ namespace std::uint64_t global_node_cell_offsets[2] = {0, 0}; # ifdef DEAL_II_WITH_MPI - int ierr = MPI_Allreduce(local_node_cell_count, - global_node_cell_count, - 2, - MPI_UINT64_T, - MPI_SUM, - comm); + int ierr = + MPI_Allreduce(local_node_cell_count, + global_node_cell_count, + 2, + Utilities::MPI::mpi_type_id_for_type, + MPI_SUM, + comm); AssertThrowMPI(ierr); ierr = MPI_Exscan(local_node_cell_count, global_node_cell_offsets, 2, - MPI_UINT64_T, + Utilities::MPI::mpi_type_id_for_type, MPI_SUM, comm); AssertThrowMPI(ierr);