Skip to content

Commit

Permalink
Adding typing info for HTEX.outstanding, HTEX.connected_workers and H…
Browse files Browse the repository at this point in the history
…TEX.connected_managers
  • Loading branch information
yadudoc committed Jul 31, 2023
1 parent ce7e8f6 commit f4b47a6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions parsl/executors/high_throughput/executor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import typing
from concurrent.futures import Future
import typeguard
import logging
Expand Down Expand Up @@ -523,16 +524,23 @@ def hold_worker(self, worker_id: str) -> None:
logger.debug("Sent hold request to manager: {}".format(worker_id))

@property
def outstanding(self):
def outstanding(self) -> int:
"""Returns the count of tasks outstanding across the interchange
and managers"""
outstanding_c = self.command_client.run("OUTSTANDING_C")
return outstanding_c

@property
def connected_workers(self):
def connected_workers(self) -> int:
"""Returns the count of workers across all connected managers"""
workers = self.command_client.run("WORKERS")
return workers

def connected_managers(self):
def connected_managers(self) -> List[Dict[str, typing.Any]]:
"""Returns a list of dicts one for each connected managers.
The dict contains info on manager(str:manager_id), block_id,
worker_count, tasks(int), idle_durations(float), active(bool)
"""
managers = self.command_client.run("MANAGERS")
return managers

Expand Down

0 comments on commit f4b47a6

Please sign in to comment.