-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
The local message optimization stores a reference to entry method arguments in the destination chare's local msg buffer if the source and destination chares lie on the same PE to avoid copying and serialization. This is an issue because if the sender chare then modifies the data being sent, the receiving chare will now be holding a reference to the modified data.
from time import time
import numpy as np
mainProxy = None
class TestCopy(Chare):
def __init__(self):
x = np.array([0, 0])
mainProxy.send(x)
x[1] = 10
class Main(Chare):
def __init__(self, args):
charm.thisProxy.updateGlobals({'mainProxy': self.thisProxy},
'__main__', awaitable=True).get()
Chare(TestCopy)
def send(self, x):
print(x)
charm.exit()
charm.start(Main)
For example, the above code prints out [0, 10]
Metadata
Metadata
Assignees
Labels
No labels