From 35fe26cb95600ab1c3130a11ab90ddde8f8cafa7 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 5 Sep 2021 13:20:50 -0400 Subject: [PATCH] Assign unique shm keys for duplicate fsps to avoid array clobbering --- piker/ui/_chart.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index f7d94415..981e96cf 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -351,7 +351,7 @@ class LinkedSplits(QWidget): # self.xaxis.hide() self.splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical) - self.splitter.setMidLineWidth(2) + self.splitter.setMidLineWidth(1) self.splitter.setHandleWidth(0) self.layout = QtWidgets.QVBoxLayout(self) @@ -1331,6 +1331,8 @@ async def spawn_fsps( linkedsplits.focus() + uid = tractor.current_actor().uid + # spawns sub-processes which execute cpu bound FSP code async with tractor.open_nursery(loglevel=loglevel) as n: @@ -1351,7 +1353,7 @@ async def spawn_fsps( # TODO: should `index` be a required internal field? fsp_dtype = np.dtype([('index', int), (fsp_func_name, float)]) - key = f'{sym}.fsp.' + display_name + key = f'{sym}.fsp.{display_name}.{".".join(uid)}' # this is all sync currently shm, opened = maybe_open_shm_array( @@ -1361,9 +1363,10 @@ async def spawn_fsps( readonly=True, ) - # XXX: fsp may have been opened by a duplicate chart. Error for - # now until we figure out how to wrap fsps as "feeds". - # assert opened, f"A chart for {key} likely already exists?" + # XXX: fsp may have been opened by a duplicate chart. + # Error for now until we figure out how to wrap fsps as + # "feeds". assert opened, f"A chart for {key} likely + # already exists?" conf['shm'] = shm