Improvements to samples

This commit is contained in:
jpekkila
2020-04-07 17:58:47 +03:00
parent 427a3ac5d8
commit fb41741d74
5 changed files with 79 additions and 23 deletions

View File

@@ -650,7 +650,7 @@ acPinPackedData(const Device device, const cudaStream_t stream, PackedData* ddat
static void
acUnpinPackedData(const Device device, const cudaStream_t stream, PackedData* ddata)
{
if (!ddata->pinned)
if (!ddata->pinned) // Unpin iff the data was pinned previously
return;
cudaSetDevice(device->id);
@@ -1362,7 +1362,8 @@ acTransferCommData(const Device device, //
const int npid = getPid(pid3d + neighbor, decomp);
cudaStreamSynchronize(data->streams[a_idx]);
MPI_Isend(src->data, count, datatype, npid, b_idx, MPI_COMM_WORLD,
MPI_Isend(src->data, count, datatype, npid, b_idx, MPI_COMM_WORLD,
&data->send_reqs[b_idx]);
}
}
}

View File

@@ -15,8 +15,8 @@ typedef struct {
#if (AC_MPI_ENABLED && AC_MPI_RT_PINNING)
AcReal* data_pinned;
bool pinned; // Set if data was received to pinned memory
#endif // (AC_MPI_ENABLED && AC_MPI_RT_PINNING)
bool pinned = false; // Set if data was received to pinned memory
#endif // (AC_MPI_ENABLED && AC_MPI_RT_PINNING)
#if (AC_MPI_ENABLED && AC_MPI_UNIDIRECTIONAL_COMM)
MPI_Win win; // MPI window for RMA