MPI_Request was saved to address pointing to local memory, fixed

This commit is contained in:
jpekkila
2020-01-20 19:15:20 +02:00
parent 54d91e7eeb
commit 354cf81777

View File

@@ -1283,11 +1283,8 @@ acTransferCommData(const Device device, //
PackedData dst = data->dsts_host[b_idx]; PackedData dst = data->dsts_host[b_idx];
const int3 pid3d = getPid3D(pid, decomp); const int3 pid3d = getPid3D(pid, decomp);
MPI_Request recv_req;
MPI_Irecv(dst.data, count, datatype, getPid(pid3d - neighbor, decomp), MPI_Irecv(dst.data, count, datatype, getPid(pid3d - neighbor, decomp),
b_idx, MPI_COMM_WORLD, &recv_req); b_idx, MPI_COMM_WORLD, &data->recv_reqs[b_idx]);
data->recv_reqs[b_idx] = recv_req;
} }
} }
} }
@@ -1321,13 +1318,10 @@ acTransferCommData(const Device device, //
// PackedData dst = data->dsts_host[b_idx]; // PackedData dst = data->dsts_host[b_idx];
const int3 pid3d = getPid3D(pid, decomp); const int3 pid3d = getPid3D(pid, decomp);
MPI_Request send_req;
cudaStreamSynchronize(data->streams[a_idx]); cudaStreamSynchronize(data->streams[a_idx]);
MPI_Isend(src.data, count, datatype, getPid(pid3d + neighbor, decomp), MPI_Isend(src.data, count, datatype, getPid(pid3d + neighbor, decomp),
b_idx, MPI_COMM_WORLD, &send_req); b_idx, MPI_COMM_WORLD, &data->send_reqs[b_idx]);
data->send_reqs[b_idx] = send_req;
} }
} }
} }