Skip to content

Commit

Permalink
Make filesystem radio serialize monitoring messages the same as with …
Browse files Browse the repository at this point in the history
…UDP and HTEX radios: using pickle not parsl.serialize
  • Loading branch information
benclifford committed Oct 31, 2024
1 parent 39fc0de commit 2552add
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions parsl/monitoring/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import multiprocessing.synchronize as ms
import os
import pickle
import queue
import time
from multiprocessing import Event
Expand All @@ -18,7 +19,6 @@
from parsl.monitoring.types import TaggedMonitoringMessage
from parsl.multiprocessing import ForkProcess, SizedQueue
from parsl.process_loggers import wrap_with_logs
from parsl.serialize import deserialize
from parsl.utils import RepresentationMixin, setproctitle

_db_manager_excepts: Optional[Exception]
Expand Down Expand Up @@ -278,7 +278,7 @@ def filesystem_receiver(q: Queue[TaggedMonitoringMessage], run_dir: str) -> None
logger.info(f"Processing filesystem radio file {filename}")
full_path_filename = f"{new_dir}/{filename}"
with open(full_path_filename, "rb") as f:
message = deserialize(f.read())
message = pickle.load(f)
logger.debug(f"Message received is: {message}")
assert isinstance(message, tuple)
target_radio.send(cast(TaggedMonitoringMessage, message))
Expand Down
4 changes: 1 addition & 3 deletions parsl/monitoring/radios.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import zmq

from parsl.serialize import serialize

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -59,7 +57,7 @@ def send(self, message: object) -> None:
# move it into new/, so that a partially written
# file will never be observed in new/
with open(tmp_filename, "wb") as f:
f.write(serialize(buffer))
pickle.dump(buffer, f)
os.rename(tmp_filename, new_filename)


Expand Down

0 comments on commit 2552add

Please sign in to comment.