]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Silence another warning in compute_n_point_to_point_communications 7164/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 7 Sep 2018 22:30:54 +0000 (00:30 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 7 Sep 2018 22:33:15 +0000 (00:33 +0200)
source/base/mpi.cc

index 3c152561c38d4447ca4cd1d5feeb1a0d2661aa6c..e99471202e7f211380fb3c7d451916cdb6f60546 100644 (file)
@@ -319,8 +319,9 @@ namespace Utilities
 #  if DEAL_II_MPI_VERSION_GTE(2, 2)
       // Find out how many processes will send to this one
       // MPI_Reduce_scatter(_block) does exactly this
-      unsigned int n_recv_from;
-      const int    ierr = MPI_Reduce_scatter_block(
+      unsigned int n_recv_from = 0;
+
+      const int ierr = MPI_Reduce_scatter_block(
         &dest_vector[0], &n_recv_from, 1, MPI_UNSIGNED, MPI_SUM, mpi_comm);
 
       AssertThrowMPI(ierr);
@@ -331,7 +332,7 @@ namespace Utilities
       // by reducing with sum and then scattering the
       // results over all processes
       std::vector<unsigned int> buffer(dest_vector.size());
-      unsigned int              n_recv_from;
+      unsigned int              n_recv_from = 0;
 
       MPI_Reduce(&dest_vector[0],
                  &buffer[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.