Skip to content

Commit

Permalink
core: Workaround for MPI serialization bug on 1 rank
Browse files Browse the repository at this point in the history
See details in espressomd#4663
  • Loading branch information
jngrad committed Mar 10, 2023
1 parent 02d4929 commit 3da215b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/core/bond_breakage/bond_breakage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ void clear_queue() { queue.clear(); }
/** @brief Gathers combined queue from all mpi ranks */
Queue gather_global_queue(Queue const &local_queue) {
Queue res = local_queue;
Utils::Mpi::gather_buffer(res, comm_cart);
boost::mpi::broadcast(comm_cart, res, 0);
if (comm_cart.size() > 1) {
Utils::Mpi::gather_buffer(res, comm_cart);
boost::mpi::broadcast(comm_cart, res, 0);
}
return res;
}

Expand Down
7 changes: 4 additions & 3 deletions src/core/collision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,10 @@ void glue_to_surface_bind_part_to_vs(const Particle *const p1,

std::vector<CollisionPair> gather_global_collision_queue() {
std::vector<CollisionPair> res = local_collision_queue;
Utils::Mpi::gather_buffer(res, comm_cart);
boost::mpi::broadcast(comm_cart, res, 0);

if (comm_cart.size() > 1) {
Utils::Mpi::gather_buffer(res, comm_cart);
boost::mpi::broadcast(comm_cart, res, 0);
}
return res;
}

Expand Down

0 comments on commit 3da215b

Please sign in to comment.