Skip to content

Commit

Permalink
Clean up job_queue for unused functions
Browse files Browse the repository at this point in the history
Remove _max_job_duration attribute from job_queue
Remove changes_after_transition func
  • Loading branch information
xjules committed Oct 17, 2023
1 parent 5812488 commit 9e82d9b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
10 changes: 0 additions & 10 deletions src/ert/job_queue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,10 @@ def __init__(self, prototype: str, bind: bool = True) -> None:
super().__init__(ResPrototype.lib, prototype, bind=bind)


RES_LIB = ResPrototype.lib

from ecl.util.util import updateAbortSignals # noqa

updateAbortSignals()


def root() -> str:
"""
Will print the filesystem root of the current ert package.
"""
return os.path.abspath(os.path.join(os.path.dirname(__file__), "../"))


from .driver import Driver # noqa
from .job_queue_manager import JobQueueManager # noqa
from .job_queue_node import JobQueueNode # noqa
Expand Down
8 changes: 0 additions & 8 deletions src/ert/job_queue/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def __init__(self, driver: "Driver", max_submit: int = 2):

self.driver = driver
self._differ = QueueDiffer()
self._max_job_duration = 0
self._max_submit = max_submit

def get_max_running(self) -> int:
Expand All @@ -120,9 +119,6 @@ def get_max_running(self) -> int:
def set_max_running(self, max_running: int) -> None:
self.driver.set_max_running(max_running)

def set_max_job_duration(self, max_duration: int) -> None:
self._max_job_duration = max_duration

@property
def max_submit(self) -> int:
return self._max_submit
Expand Down Expand Up @@ -459,10 +455,6 @@ def snapshot(self) -> Optional[Dict[int, str]]:
"""Return the whole state, or None if there was no snapshot."""
return self._differ.snapshot()

def changes_after_transition(self) -> Dict[int, str]:
old_state, new_state = self._differ.transition(self.job_list)
return self._differ.diff_states(old_state, new_state)

def changes_without_transition(self) -> Tuple[Dict[int, str], List[JobStatus]]:
old_state, new_state = self._differ.get_old_and_new_state(self.job_list)
return self._differ.diff_states(old_state, new_state), new_state
Expand Down
2 changes: 0 additions & 2 deletions src/ert/simulator/simulation_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,12 @@ def __init__( # pylint: disable=too-many-arguments
case_data: List[Tuple[Any, Any]],
):
self._ert = ert
max_runtime = ert.analysisConfig().max_runtime
self._mask = mask

job_queue = JobQueue(
Driver.create_driver(ert.get_queue_config()),
max_submit=ert.get_queue_config().max_submit,
)
job_queue.set_max_job_duration(max_runtime or 0)
self._queue_manager = JobQueueManager(job_queue)
# fill in the missing geo_id data
global_substitutions = ert.get_context()
Expand Down

0 comments on commit 9e82d9b

Please sign in to comment.