Skip to content

Commit

Permalink
Remove ExecutorStatus abstraction and push everything into PollItem
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford committed Jul 19, 2023
1 parent d4c2489 commit 73c3901
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
6 changes: 3 additions & 3 deletions parsl/dataflow/job_error_handler.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from typing import List, Dict

from parsl.dataflow.job_status_poller import ExecutorStatus
from parsl.dataflow.job_status_poller import PollItem
from parsl.executors.base import ParslExecutor
from parsl.providers.base import JobStatus, JobState


class JobErrorHandler:
def run(self, status: List[ExecutorStatus]):
def run(self, status: List[PollItem]):
for es in status:
self._check_irrecoverable_executor(es)

def _check_irrecoverable_executor(self, es: ExecutorStatus):
def _check_irrecoverable_executor(self, es: PollItem):
if not es.executor.error_management_enabled:
return
es.executor.handle_errors(self, es.status)
Expand Down
15 changes: 1 addition & 14 deletions parsl/dataflow/job_status_poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,7 @@

logger = logging.getLogger(__name__)


class ExecutorStatus(metaclass=ABCMeta):
@property
@abstractmethod
def executor(self) -> "parsl.executors.base.ParslExecutor":
pass

@property
@abstractmethod
def status(self) -> Dict[str, "parsl.providers.base.JobStatus"]:
pass


class PollItem(ExecutorStatus):
class PollItem:
def __init__(self, executor: ParslExecutor, dfk: "parsl.dataflow.dflow.DataFlowKernel"):
self._executor = executor
self._dfk = dfk
Expand Down
4 changes: 2 additions & 2 deletions parsl/dataflow/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import warnings
from typing import Dict, List, Optional

from parsl.dataflow.job_status_poller import ExecutorStatus
from parsl.dataflow.job_status_poller import PollItem
from parsl.executors import HighThroughputExecutor
from parsl.executors.base import ParslExecutor
from parsl.executors.status_handling import BlockProviderExecutor
Expand Down Expand Up @@ -134,7 +134,7 @@ def add_executors(self, executors):
for executor in executors:
self.executors[executor.label] = {'idle_since': None}

def _strategy_noop(self, status: List[ExecutorStatus]) -> None:
def _strategy_noop(self, status: List[PollItem]) -> None:
"""Do nothing.
"""
logger.debug("strategy_noop: doing nothing")
Expand Down

0 comments on commit 73c3901

Please sign in to comment.