From e027b0fa0cd7a8abb91e25f77ab6c8d3cf17a78b Mon Sep 17 00:00:00 2001 From: Ronak Buch Date: Mon, 31 Oct 2022 16:35:38 -0400 Subject: [PATCH 1/4] HTram: Increment msg refcount instead of allocating new --- examples/charm++/libcode/htram.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/charm++/libcode/htram.C b/examples/charm++/libcode/htram.C index 7d1d3c0bcb..6488235833 100644 --- a/examples/charm++/libcode/htram.C +++ b/examples/charm++/libcode/htram.C @@ -58,7 +58,7 @@ void HTramRecv::receive(HTramMessage* agg_message) { //nodegroup //reference from group for(int i=CkNodeFirst(CkMyNode()); i < CkNodeFirst(CkMyNode())+CkNodeSize(0);i++) { - HTramMessage* tmpMsg = new HTramMessage(agg_message->next, agg_message->buffer); + HTramMessage* tmpMsg = CkReference(agg_message); htramProxy[i].receivePerPE(tmpMsg); } } From 9dda5896b70a8cfbe3c046d5dfc2cb0d10636206 Mon Sep 17 00:00:00 2001 From: Ronak Buch Date: Mon, 31 Oct 2022 16:43:21 -0400 Subject: [PATCH 2/4] Fix incorrect spelling of function call --- examples/charm++/libcode/htram.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/charm++/libcode/htram.C b/examples/charm++/libcode/htram.C index 6488235833..99e302857a 100644 --- a/examples/charm++/libcode/htram.C +++ b/examples/charm++/libcode/htram.C @@ -58,7 +58,7 @@ void HTramRecv::receive(HTramMessage* agg_message) { //nodegroup //reference from group for(int i=CkNodeFirst(CkMyNode()); i < CkNodeFirst(CkMyNode())+CkNodeSize(0);i++) { - HTramMessage* tmpMsg = CkReference(agg_message); + HTramMessage* tmpMsg = CkReferenceMsg(agg_message); htramProxy[i].receivePerPE(tmpMsg); } } From f11f86195c751da341aa5cee4912980286d6a93a Mon Sep 17 00:00:00 2001 From: Ronak Buch Date: Mon, 31 Oct 2022 17:11:21 -0400 Subject: [PATCH 3/4] Free message --- examples/charm++/libcode/htram.C | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/charm++/libcode/htram.C b/examples/charm++/libcode/htram.C index 99e302857a..3301a55c9a 100644 --- a/examples/charm++/libcode/htram.C +++ b/examples/charm++/libcode/htram.C @@ -61,6 +61,7 @@ void HTramRecv::receive(HTramMessage* agg_message) { HTramMessage* tmpMsg = CkReferenceMsg(agg_message); htramProxy[i].receivePerPE(tmpMsg); } + delete agg_message; } void HTram::receivePerPE(HTramMessage* msg) { From c3e4a3459bbd8ef3f11ea83bfdb585046e13e938 Mon Sep 17 00:00:00 2001 From: Ronak Buch Date: Mon, 31 Oct 2022 17:23:58 -0400 Subject: [PATCH 4/4] HTram: Force RTS to allow resending message --- examples/charm++/libcode/htram.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/charm++/libcode/htram.C b/examples/charm++/libcode/htram.C index 3301a55c9a..bc4118dc02 100644 --- a/examples/charm++/libcode/htram.C +++ b/examples/charm++/libcode/htram.C @@ -59,6 +59,8 @@ void HTramRecv::receive(HTramMessage* agg_message) { for(int i=CkNodeFirst(CkMyNode()); i < CkNodeFirst(CkMyNode())+CkNodeSize(0);i++) { HTramMessage* tmpMsg = CkReferenceMsg(agg_message); + // Needed to tell the RTS not to stop us from reusing this message + _SET_USED(UsrToEnv(tmpMsg), 0); htramProxy[i].receivePerPE(tmpMsg); } delete agg_message;