You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]
The text was updated successfully, but these errors were encountered:
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.
For example, the above code prints out [0, 10]
The text was updated successfully, but these errors were encountered: