Skip to content

Commit

Permalink
WIP: the workaround for small step of aiida-core support
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Dec 19, 2024
1 parent f46b75f commit 17f5d62
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/plumpy/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
cast,
)

import kiwipy

from plumpy.coordinator import Coordinator

try:
Expand Down Expand Up @@ -324,9 +326,11 @@ def init(self) -> None:

try:
# filter out state change broadcasts
identifier = self._coordinator.add_broadcast_subscriber(
self.broadcast_receive, subject_filters=[re.compile(r'^(?!state_changed).*')], identifier=str(self.pid)
)
subscriber = kiwipy.BroadcastFilter(self.broadcast_receive, subject=re.compile(r'^(?!state_changed).*'))
identifier = self._coordinator.add_broadcast_subscriber(subscriber, identifier=str(self.pid))
# identifier = self._coordinator.add_broadcast_subscriber(
# subscriber, subject_filters=[re.compile(r'^(?!state_changed).*')], identifier=str(self.pid)
# )
self.add_cleanup(functools.partial(self._coordinator.remove_broadcast_subscriber, identifier))
except concurrent.futures.TimeoutError:
self.logger.exception('Process<%s>: failed to register as a broadcast subscriber', self.pid)
Expand Down Expand Up @@ -788,6 +792,8 @@ def recursively_copy_dictionaries(value: Any) -> Any:
self._uuid = uuid.uuid4()
if self._pid is None:
self._pid = self._uuid
# __import__('ipdb').set_trace()
# print("!!!!! ")

@super_check
def on_exit_running(self) -> None:
Expand Down

0 comments on commit 17f5d62

Please sign in to comment.