每个从属设备都会将长度为 len 的数组 num 发送到根节点。我怎样才能将所有这些数组存储在2D数组中?
if (world_rank == root) {
for(i=1; i<world_size;i++) {
// clueless what to do
}
MPI_Waitall(world_size-1, &rcv_request[1], &status[1]);
}
else {
MPI_Isend(num, len, MPI_FLOAT, i, 1, MPI_COMM_WORLD, &send_request[i]);
MPI_Wait(&send_request[1], &status[1]);
}