Skip to content

Commit

Permalink
Remove unused monitoring radio source ID (#3670)
Browse files Browse the repository at this point in the history
crossref PR #3666 which removes a different unused monitoring source
identifier.

## Type of change

- Code maintenance/cleanup
  • Loading branch information
benclifford authored Nov 1, 2024
1 parent 4f20b3e commit 7fe576e
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 7fe576e

Please sign in to comment.