]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix several scary MPI bugs 2148/head
authorTimo Heister <timo.heister@gmail.com>
Mon, 8 Feb 2016 14:20:18 +0000 (09:20 -0500)
committerTimo Heister <timo.heister@gmail.com>
Mon, 8 Feb 2016 14:20:18 +0000 (09:20 -0500)
I am surprised the code in question used to work at all because we are just
overwriting random memory. I detected those using clang's argument type
warnings and extensible clang type annotation within MPICH.

include/deal.II/numerics/vector_tools.templates.h
source/base/data_out_base.cc
source/distributed/grid_refinement.cc

index f693089c39ad7e6518cd05adee44f43b4737f17f..e6889a36b415401d333bc4168cf0070d087ee451 100644 (file)
@@ -7082,7 +7082,7 @@ namespace VectorTools
         double my_values[3] = { mean_double.real(), mean_double.imag(), area };
         double global_values[3];
 
-        MPI_Allreduce (&my_values, &global_values, 3, MPI_DOUBLE,
+        MPI_Allreduce (my_values, global_values, 3, MPI_DOUBLE,
                        MPI_SUM,
                        p_triangulation->get_communicator());
 
index ff0005d352cb1799f591fa789f0213608c5b0897..8e5a78bbd70e1fd700d48ee56003347700a14d60 100644 (file)
@@ -6173,7 +6173,7 @@ void DataOutInterface<dim,spacedim>::write_vtu_in_parallel (const char *filename
       MPI_File_write(fh, const_cast<char *>(ss.str().c_str()), header_size, MPI_CHAR, MPI_STATUS_IGNORE);
     }
 
-  MPI_Bcast(&header_size, 1, MPI_INT, 0, comm);
+  MPI_Bcast(&header_size, 1, MPI_UNSIGNED, 0, comm);
 
   MPI_File_seek_shared( fh, header_size, MPI_SEEK_SET );
   {
index 262c50e7b4e3c48b491e95197a31ba2d595b4165..0c772583a86f6b899987a45203bd00c9b3d5a700 100644 (file)
@@ -96,7 +96,7 @@ namespace
 
     // compute the minimum on
     // processor zero
-    MPI_Reduce (&comp, &result, 2, MPI_DOUBLE,
+    MPI_Reduce (comp, result, 2, MPI_DOUBLE,
                 MPI_MIN, 0, mpi_communicator);
 
     // make sure only processor zero

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.