Skip to content

Commit

Permalink
Merge commit 'origin/master~1' into benc-remove-channels
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford committed Nov 1, 2024
2 parents 094a5dd + 7fe576e commit ce6f792
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
13 changes: 3 additions & 10 deletions parsl/monitoring/radios.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ class FilesystemRadioSender(MonitoringRadioSender):
the UDP radio, but should be much more reliable.
"""

def __init__(self, *, monitoring_url: str, source_id: int, timeout: int = 10, run_dir: str):
def __init__(self, *, monitoring_url: str, timeout: int = 10, run_dir: str):
logger.info("filesystem based monitoring channel initializing")
self.source_id = source_id
self.base_path = f"{run_dir}/monitor-fs-radio/"
self.tmp_path = f"{self.base_path}/tmp"
self.new_path = f"{self.base_path}/new"
Expand All @@ -66,19 +65,16 @@ def send(self, message: object) -> None:

class HTEXRadioSender(MonitoringRadioSender):

def __init__(self, monitoring_url: str, source_id: int, timeout: int = 10):
def __init__(self, monitoring_url: str, timeout: int = 10):
"""
Parameters
----------
monitoring_url : str
URL of the form <scheme>://<IP>:<PORT>
source_id : str
String identifier of the source
timeout : int
timeout, default=10s
"""
self.source_id = source_id
logger.info("htex-based monitoring channel initialising")

def send(self, message: object) -> None:
Expand Down Expand Up @@ -120,21 +116,18 @@ def send(self, message: object) -> None:

class UDPRadioSender(MonitoringRadioSender):

def __init__(self, monitoring_url: str, source_id: int, timeout: int = 10):
def __init__(self, monitoring_url: str, timeout: int = 10):
"""
Parameters
----------
monitoring_url : str
URL of the form <scheme>://<IP>:<PORT>
source_id : str
String identifier of the source
timeout : int
timeout, default=10s
"""
self.monitoring_url = monitoring_url
self.sock_timeout = timeout
self.source_id = source_id
try:
self.scheme, self.ip, port = (x.strip('/') for x in monitoring_url.split(':'))
self.port = int(port)
Expand Down
8 changes: 3 additions & 5 deletions parsl/monitoring/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,12 @@ def wrapped(*args: List[Any], **kwargs: Dict[str, Any]) -> Any:
def get_radio(radio_mode: str, monitoring_hub_url: str, task_id: int, run_dir: str) -> MonitoringRadioSender:
radio: MonitoringRadioSender
if radio_mode == "udp":
radio = UDPRadioSender(monitoring_hub_url,
source_id=task_id)
radio = UDPRadioSender(monitoring_hub_url)
elif radio_mode == "htex":
radio = HTEXRadioSender(monitoring_hub_url,
source_id=task_id)
radio = HTEXRadioSender(monitoring_hub_url)
elif radio_mode == "filesystem":
radio = FilesystemRadioSender(monitoring_url=monitoring_hub_url,
source_id=task_id, run_dir=run_dir)
run_dir=run_dir)
else:
raise RuntimeError(f"Unknown radio mode: {radio_mode}")
return radio
Expand Down

0 comments on commit ce6f792

Please sign in to comment.