]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix incorrect MPI_Allgather 2244/head
authorTimo Heister <timo.heister@gmail.com>
Thu, 25 Feb 2016 17:21:49 +0000 (12:21 -0500)
committerTimo Heister <timo.heister@gmail.com>
Thu, 25 Feb 2016 17:27:32 +0000 (12:27 -0500)
MPI_Allgather in compute_local_to_global_vertex_index_map() was using
the wrong data type, which probably lead to wrong results or at least
illegal memory access.

source/grid/grid_tools.cc

index eb61d2164cf2da268109233cf53238e5165a87c6..eabb5ff3107d225bedb41d8dd8344ace44b0a7ae 100644 (file)
@@ -1714,8 +1714,8 @@ next_cell:
     // processors and shifting the indices accordingly
     const unsigned int n_cpu = Utilities::MPI::n_mpi_processes(triangulation.get_communicator());
     std::vector<types::global_vertex_index> indices(n_cpu);
-    MPI_Allgather(&next_index, 1, MPI_UNSIGNED_LONG_LONG, &indices[0],
-                  indices.size(), MPI_UNSIGNED_LONG_LONG, triangulation.get_communicator());
+    MPI_Allgather(&next_index, 1, DEAL_II_DOF_INDEX_MPI_TYPE, &indices[0],
+                  indices.size(), DEAL_II_DOF_INDEX_MPI_TYPE, triangulation.get_communicator());
     const types::global_vertex_index shift = std::accumulate(&indices[0],
                                                              &indices[0]+triangulation.locally_owned_subdomain(),0);
 

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.