static bool receive_global(pcu_msg* m) { m->received.peer = MPI_ANY_SOURCE; while ( ! pcu_mpi_receive(&(m->received),pcu_user_comm)) { if (m->state == send_recv_state) if (done_sending_peers(m->peers)) { pcu_begin_barrier(&(m->coll)); m->state = recv_state; } if (m->state == recv_state) if (pcu_barrier_done(&(m->coll))) return false; } return true; }
void pcu_barrier(pcu_coll* c) { pcu_begin_barrier(c); while( ! pcu_barrier_done(c)); }