void mds_set_type_links(struct mds_net* net, struct mds* m, int t, struct mds_links* ln) { unsigned i; unsigned j; unsigned* in; struct mds_copy c; PCU_Comm_Begin(); for (i = 0; i < ln->np; ++i) { PCU_ALWAYS_ASSERT(ln->l); for (j = 0; j < ln->n[i]; ++j) PCU_COMM_PACK(ln->p[i], ln->l[i][j]); } PCU_Comm_Send(); while (PCU_Comm_Listen()) { c.p = PCU_Comm_Sender(); PCU_ALWAYS_ASSERT(c.p != PCU_Comm_Self()); i = find_peer(ln, c.p); in = PCU_Comm_Extract(ln->n[i] * sizeof(unsigned)); for (j = 0; j < ln->n[i]; ++j) { c.e = mds_identify(t, in[j]); mds_add_copy(net, m, mds_identify(t, ln->l[i][j]), c); } } }
static void recv_links(struct mds_links* ln) { int from; mds_id* tmp; int pi; unsigned i; from = PCU_Comm_Sender(); pi = find_peer(ln, from); tmp = PCU_Comm_Extract(ln->n[pi] * sizeof(mds_id)); for (i = 0; i < ln->n[pi]; ++i) ln->l[pi][i] = mds_index(tmp[i]); }