]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use the correct data type for a buffer size variable.
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 14 Feb 2022 05:08:45 +0000 (22:08 -0700)
committerTimo Heister <timo.heister@gmail.com>
Wed, 16 Feb 2022 01:14:41 +0000 (20:14 -0500)
include/deal.II/base/mpi.h

index 77ea392a58e38ac94680b83a5dc152af0fd96f49..c3459641a2b8315c246818235065d15df6aed546 100644 (file)
@@ -1851,7 +1851,7 @@ namespace Utilities
       (void)n_procs;
 
       std::vector<char> buffer;
-      unsigned int      buffer_size = numbers::invalid_unsigned_int;
+      std::size_t       buffer_size = numbers::invalid_size_type;
 
       // On the root process, pack the data and determine what the
       // buffer size needs to be.
@@ -1862,7 +1862,11 @@ namespace Utilities
         }
 
       // Exchange the size of buffer
-      int ierr = MPI_Bcast(&buffer_size, 1, MPI_UNSIGNED, root_process, comm);
+      int ierr = MPI_Bcast(&buffer_size,
+                           1,
+                           internal::mpi_type_id(&buffer_size),
+                           root_process,
+                           comm);
       AssertThrowMPI(ierr);
 
       // If not on the root process, correctly size the buffer to

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.