Commit 7359b704 authored by Volker Springel's avatar Volker Springel
Browse files

fix for hideous instability on some systems where MPI_Gather in a shared...

fix for hideous instability on some systems where MPI_Gather in a shared memory communicator can sometimes return permaturely before all data has safely arrived
parent 539af34f
......@@ -87,6 +87,9 @@ void shmem::shared_memory_handler(void)
prepare_offset_table(NULL, tree_info[handle].SphP_offsets);
prepare_offset_table(NULL, tree_info[handle].Foreign_Nodes_offsets);
prepare_offset_table(NULL, tree_info[handle].Foreign_Points_offsets);
MPI_Barrier(SharedMemComm); // this barrier is in principle superfluous, but on some systems,
// the MPI_Gather in prepare_offset_table() can return prematurely before all data has arrived
}
else if(tag == TAG_HEADER) // signals that we are freeing addresses we stored for tree access
{
......
......@@ -957,6 +957,10 @@ void tree<node, partset, point_data, foreign_point_data>::prepare_shared_memory_
Shmem.inform_offset_table(Foreign_Nodes);
Shmem.inform_offset_table(Foreign_Points);
MPI_Barrier(Shmem.SharedMemComm); // this barrier is in principle superfluous, but on some systems,
// the MPI_Gather in prepare_offset_table() can return prematurely
// on the target rank before all data has arrived
/* the following is needed to make sure that the shared memory handler on different nodes is already properly initialized */
MPI_Barrier(D->Communicator);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment