Skip to content

Commit

Permalink
Enable scheduler by default for LOCAL queue
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Jan 23, 2024
1 parent 797b49a commit 58cdbe4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/ert/ensemble_evaluator/_builder/_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ async def _evaluate_inner( # pylint: disable=too-many-branches
"""
event_creator = self.generate_event_creator(experiment_id=experiment_id)
timeout_queue: Optional[asyncio.Queue[Any]] = None
if (
self._queue_config.queue_system in [QueueSystem.LOCAL]
and FeatureToggling.value("scheduler") is not False
):
FeatureToggling._conf["scheduler"].value = True
if not FeatureToggling.is_enabled("scheduler"):
# Set up the timeout-mechanism
timeout_queue = asyncio.Queue()
Expand Down
7 changes: 4 additions & 3 deletions src/ert/shared/feature_toggling.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import os
from argparse import ArgumentParser
from copy import deepcopy
from typing import Dict, Optional, Union
from typing import TYPE_CHECKING, Dict, Optional, Union

from ert.namespace import Namespace
if TYPE_CHECKING:
from ert.namespace import Namespace


class _Feature:
Expand Down Expand Up @@ -98,7 +99,7 @@ def add_feature_toggling_args(parser: ArgumentParser) -> None:
)

@staticmethod
def update_from_args(args: Namespace) -> None:
def update_from_args(args: "Namespace") -> None:
pattern = "feature-"
feature_args = [arg for arg in vars(args).items() if arg[0].startswith(pattern)]
for name, value in feature_args:
Expand Down
6 changes: 5 additions & 1 deletion src/ert/simulator/simulation_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ def __init__(
self._ert = ert
self._mask = mask

if FeatureToggling.is_enabled("scheduler"):
if (
self._queue_config.queue_system in [QueueSystem.LOCAL]
and FeatureToggling.value("scheduler") is not False
):
FeatureToggling._conf["scheduler"].value = True
if ert.ert_config.queue_config.queue_system != QueueSystem.LOCAL:
raise NotImplementedError()
driver = create_driver(ert.ert_config.queue_config)
Expand Down
2 changes: 1 addition & 1 deletion test-data/poly_example/poly.ert
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUNPATH poly_out/realization-<IENS>/iter-<ITER>

OBS_CONFIG observations

NUM_REALIZATIONS 100
NUM_REALIZATIONS 5
MIN_REALIZATIONS 1

GEN_KW COEFFS coeff_priors
Expand Down

0 comments on commit 58cdbe4

Please sign in to comment.