Skip to content

Commit

Permalink
Use queue options directly from ert
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Nov 14, 2024
1 parent 137bdc6 commit 100ab9a
Showing 1 changed file with 14 additions and 55 deletions.
69 changes: 14 additions & 55 deletions src/everest/config/simulator_config.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import warnings
from typing import Literal, Optional
from typing import Optional, Union

from pydantic import BaseModel, Field, NonNegativeInt, PositiveInt, field_validator

from .has_ert_queue_options import HasErtQueueOptions
from ert.config.queue_config import (
LocalQueueOptions,
LsfQueueOptions,
SlurmQueueOptions,
TorqueQueueOptions,
)


class SimulatorConfig(BaseModel, HasErtQueueOptions, extra="forbid"): # type: ignore
name: Optional[str] = Field(
default=None, description="Specifies which queue to use"
)
class SimulatorConfig(BaseModel, extra="forbid"): # type: ignore
cores: Optional[PositiveInt] = Field(
default=None,
alias="max_running",
description="""Defines the number of simultaneously running forward models.
When using queue system lsf, this corresponds to number of nodes used at one
Expand All @@ -35,24 +38,6 @@ class SimulatorConfig(BaseModel, HasErtQueueOptions, extra="forbid"): # type: i
description="Whether the batch folder for a successful simulation "
"needs to be deleted.",
)
exclude_host: Optional[str] = Field(
"",
description="""Comma separated list of nodes that should be
excluded from the slurm run.""",
)
include_host: Optional[str] = Field(
"",
description="""Comma separated list of nodes that
should be included in the slurm run""",
)
max_memory: Optional[str] = Field(
default=None,
description="Maximum memory usage for a slurm job.",
)
max_memory_cpu: Optional[str] = Field(
default=None,
description="Maximum memory usage per cpu for a slurm job.",
)
max_runtime: Optional[NonNegativeInt] = Field(
default=None,
description="""Maximum allowed running time of a forward model. When
Expand All @@ -66,9 +51,11 @@ class SimulatorConfig(BaseModel, HasErtQueueOptions, extra="forbid"): # type: i
Examples to set memory requirement is:
* rusage[mem=1000]""",
)
queue_system: Optional[Literal["lsf", "local", "slurm", "torque"]] = Field(
default="local",
description="Defines which queue system the everest server runs on.",
queue_system: Union[
LocalQueueOptions, LsfQueueOptions, SlurmQueueOptions, TorqueQueueOptions
] = Field(
default_factory=LocalQueueOptions,
description="Defines which queue system the everest submits jobs to",
)
resubmit_limit: Optional[NonNegativeInt] = Field(
default=None,
Expand All @@ -81,34 +68,6 @@ class SimulatorConfig(BaseModel, HasErtQueueOptions, extra="forbid"): # type: i
resumbit_limit defines the number of times we will resubmit a failing forward model.
If not specified, a default value of 1 will be used.""",
)
sbatch: Optional[str] = Field(
default=None,
description="sbatch executable to be used by the slurm queue interface.",
)
scancel: Optional[str] = Field(
default=None,
description="scancel executable to be used by the slurm queue interface.",
)
scontrol: Optional[str] = Field(
default=None,
description="scontrol executable to be used by the slurm queue interface.",
)
squeue: Optional[str] = Field(
default=None,
description="squeue executable to be used by the slurm queue interface.",
)
server: Optional[str] = Field(
default=None,
description="Name of LSF server to use. This option is deprecated and no longer required",
)
slurm_timeout: Optional[int] = Field(
default=None,
description="Timeout for cached status used by the slurm queue interface",
)
squeue_timeout: Optional[int] = Field(
default=None,
description="Timeout for cached status used by the slurm queue interface.",
)
enable_cache: bool = Field(
default=False,
description="""Enable forward model result caching.
Expand Down

0 comments on commit 100ab9a

Please sign in to comment.