displacements[i] = displacements[i - 1] + n_elements[i - 1];
global_quad_points_first.resize(displacements[n_processes]);
- MPI_Allgatherv(&local_quad_points_first[0],
+ MPI_Allgatherv((local_quad_points_first.size() > 0) ?
+ (&local_quad_points_first[0]) :
+ nullptr,
n_my_elements,
MPI_DOUBLE,
&global_quad_points_first[0],
displacements[i] = displacements[i - 1] + n_elements[i - 1];
global_quad_points_second.resize(displacements[n_processes]);
- MPI_Allgatherv(&local_quad_points_second[0],
+ MPI_Allgatherv((local_quad_points_second.size() > 0) ?
+ (&local_quad_points_second[0]) :
+ nullptr,
n_my_elements,
MPI_DOUBLE,
&global_quad_points_second[0],
for (unsigned int i = 1; i < nprocs; ++i)
{
if (myid == i)
- MPI_Send(&renumbering[0],
+ MPI_Send((renumbering.size() > 0) ? (&renumbering[0]) : nullptr,
renumbering.size(),
Utilities::MPI::mpi_type_id_for_type<
decltype(complete_renumbering[0])>,
i,
MPI_COMM_WORLD);
else if (myid == 0)
- MPI_Recv(&complete_renumbering[offset],
+ MPI_Recv((dofs_per_proc[i].n_elements() > 0) ?
+ (&complete_renumbering[offset]) :
+ nullptr,
dofs_per_proc[i].n_elements(),
Utilities::MPI::mpi_type_id_for_type<
decltype(complete_renumbering[0])>,