Skip to content

Commit

Permalink
Check that send buffers are completed before deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
lroberts36 committed Nov 5, 2024
1 parent f72ee8f commit a194eba
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/bvals/comms/combined_buffers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,15 @@ struct CombinedBuffers {
}

void clear() {
// TODO(LFR): Need to be more careful here that the asynchronous send buffers are
// finished
bool can_delete;
do {
can_delete = true;
for (auto &[p, cbr] : combined_send_buffers) {
for (auto &[r, cbrp] : cbr.combined_bufs) {
can_delete = cbrp.IsAvailableForWrite() && can_delete;
}
}
} while (!can_delete);
combined_send_buffers.clear();
combined_recv_buffers.clear();
processing_messages.clear();
Expand Down

0 comments on commit a194eba

Please sign in to comment.