Skip to content

Commit

Permalink
realm: fix amsg payload lifetime issue
Browse files Browse the repository at this point in the history
  • Loading branch information
streichler committed Jun 28, 2022
1 parent 4c749a0 commit 21637ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runtime/realm/deppart/sparsity_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1251,11 +1251,12 @@ namespace Realm {
// send partial messages first
while(remaining > max_to_send) {
size_t bytes = max_to_send * sizeof(Rect<N,T>);
ActiveMessage<RemoteSparsityContrib> amsg(requestor, rdata, bytes);
ActiveMessage<RemoteSparsityContrib> amsg(requestor, bytes);
amsg->sparsity = me;
amsg->piece_count = 0;
amsg->disjoint = true; // we've already de-overlapped everything
amsg->total_count = total_count;
amsg.add_payload(rdata, bytes, PAYLOAD_COPY);
amsg.commit();

num_pieces++;
Expand All @@ -1265,11 +1266,12 @@ namespace Realm {

// final message includes the count of all messages (including this one!)
size_t bytes = remaining * sizeof(Rect<N,T>);
ActiveMessage<RemoteSparsityContrib> amsg(requestor, rdata, bytes);
ActiveMessage<RemoteSparsityContrib> amsg(requestor, bytes);
amsg->sparsity = me;
amsg->piece_count = num_pieces + 1;
amsg->disjoint = true; // we've already de-overlapped everything
amsg->total_count = total_count;
amsg.add_payload(rdata, bytes, PAYLOAD_COPY);
amsg.commit();
}
}
Expand Down

0 comments on commit 21637ca

Please sign in to comment.