Skip to content

Commit

Permalink
Avoid incomplete_region update during recv arbiter poll
Browse files Browse the repository at this point in the history
  • Loading branch information
fknorr committed Jan 15, 2025
1 parent 86e7e94 commit e8f1e60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion include/receive_arbiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ struct region_request {
void* allocation;
box<3> allocated_box;
region<3> incomplete_region;
size_t incomplete_area;
std::vector<incoming_region_fragment> incoming_fragments;
bool may_await_subregion;

region_request(region<3> requested_region, void* const allocation, const box<3>& allocated_bounding_box, const bool may_await_subregion)
: allocation(allocation), allocated_box(allocated_bounding_box), incomplete_region(std::move(requested_region)),
may_await_subregion(may_await_subregion) {}
incomplete_area(incomplete_region.get_area()), may_await_subregion(may_await_subregion) {}
bool do_complete();
};

Expand Down
7 changes: 4 additions & 3 deletions src/receive_arbiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ bool region_request::do_complete() {

std::erase_if(incoming_fragments, [&](const incoming_region_fragment& fragment) {
if(!fragment.communication.is_complete()) return false;
incomplete_region = region_difference(incomplete_region, fragment.box);
if(may_await_subregion) { incomplete_region = region_difference(incomplete_region, fragment.box); }
incomplete_area -= fragment.box.get_area();
return true;
});
assert(!incomplete_region.empty() || incoming_fragments.empty());
return incomplete_region.empty();
assert(incomplete_area > 0 || incoming_fragments.empty());
return incomplete_area == 0;
}

bool multi_region_transfer::do_complete() {
Expand Down

0 comments on commit e8f1e60

Please sign in to comment.