Skip to content

Commit

Permalink
Merged in re_add_synchronization_to_p2p_reshape (pull request #209)
Browse files Browse the repository at this point in the history
Fix p2p reshape synchronize after dfe2e61
  • Loading branch information
Maetveis authored and mkstoyanov committed Sep 29, 2022
2 parents 43fd266 + 65125a7 commit 5ea5bf8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/heffte_reshape3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@ void reshape3d_pointtopoint<location_tag, packer, index>::no_gpuaware_send_recv(

packer<location_tag> packit;

// synchronize before starting the receives, because kernels from an other reshape might
// still be running, using the workspace
this->synchronize_device();
// queue the receive messages, using asynchronous receive
for(size_t i=0; i<requests.size(); i++){
heffte::add_trace name("irecv " + std::to_string(batch_size * recv_size[i]) + " from " + std::to_string(recv_proc[i]));
Expand Down Expand Up @@ -627,6 +630,9 @@ void reshape3d_pointtopoint<location_tag, packer, index>::apply_base(int batch_s

packer<location_tag> packit;

// synchronize before starting the receives, because otherwise kernels could be still using
// the workspace
this->synchronize_device();
// queue the receive messages, using asynchronous receive
for(size_t i=0; i<requests.size(); i++){
heffte::add_trace name("irecv " + std::to_string(batch_size * recv_size[i]) + " from " + std::to_string(recv_proc[i]));
Expand Down

0 comments on commit 5ea5bf8

Please sign in to comment.