Skip to content
Snippets Groups Projects
Commit 1c141cb0 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Fix broadcast of trivial that only cast to array

This fixes the case of sequential compilation. Was correct in parallel.
parent c0ebd344
No related branches found
No related tags found
1 merge request!11Feature/mpi
......@@ -364,12 +364,8 @@ class Messenger
CastType& cast_data = reinterpret_cast<CastType&>(data);
_broadcast_value(cast_data, root_rank);
} else {
#ifdef PASTIS_HAS_MPI
MPI_Datatype mpi_datatype
= Messenger::helper::mpiType<CastType>();
MPI_Bcast(reinterpret_cast<CastType*>(&data), sizeof(DataType)/sizeof(CastType),
mpi_datatype, root_rank, MPI_COMM_WORLD);
#endif // PASTIS_HAS_MPI
CastArray cast_array = cast_value_to<CastType>::from(data);
_broadcast_array(cast_array, root_rank);
}
} else {
static_assert(std::is_trivial_v<DataType>,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment