Skip to content

Commit

Permalink
Review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Nov 29, 2024
1 parent f0a0889 commit e315c9b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
13 changes: 13 additions & 0 deletions docs/ert/reference/configuration/queue.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ The following is a list of available LSF configuration options:

QUEUE_OPTION LSF LSF_QUEUE name_of_queue

.. note::
It is preferred to use the generic option instead:
QUEUE_OPTION GENERIC QUEUE_NAME name_of_queue

.. _lsf_resource:
.. topic:: LSF_RESOURCE

Expand Down Expand Up @@ -264,6 +268,10 @@ The following is a list of all queue-specific configuration options:

QUEUE_OPTION TORQUE QUEUE name_of_queue

.. note::
It is preferred to use the generic option instead:
QUEUE_OPTION GENERIC QUEUE_NAME name_of_queue

.. _torque_cluster_label:
.. topic:: CLUSTER_LABEL

Expand Down Expand Up @@ -428,6 +436,10 @@ only the most necessary options have been added.

QUEUE_OPTION SLURM PARTITION foo

.. note::
It is preferred to use the generic option instead:
QUEUE_OPTION GENERIC QUEUE_NAME name_of_queue

.. _slurm_squeue_timeout:
.. topic:: SQUEUE_TIMEOUT

Expand Down Expand Up @@ -515,6 +527,7 @@ the `GENERIC` keyword. ::
QUEUE_SYSTEM LSF
QUEUE_OPTION GENERIC MAX_RUNNING 10
QUEUE_OPTION GENERIC SUBMIT_SLEEP 2
QUEUE_OPTION GENERIC QUEUE_NAME some_name

Is equivalent to::

Expand Down
5 changes: 0 additions & 5 deletions src/ert/config/queue_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,6 @@ def from_dict(cls, config_dict: ConfigDict) -> QueueConfig:
or (q_system == QueueSystem.SLURM and options[0] == "PARTITION")
or (q_system == QueueSystem.TORQUE and options[0] == "QUEUE")
):
ConfigWarning.deprecation_warn(
f"Deprecated keyword: {options[0]} for QUEUE_OPTION {q_system}, use: "
f"QUEUE_OPTION GENERIC QUEUE_NAME {options[1] if len(options) >= 2 else ''}",
_raw_queue_options[i],
)
_raw_queue_options[i] = [
QueueSystemWithGeneric.GENERIC,
"QUEUE_NAME",
Expand Down
10 changes: 5 additions & 5 deletions tests/ert/unit_tests/config/test_queue_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,17 +525,17 @@ def test_default_activate_script_generation(expected, monkeypatch, venv):


@pytest.mark.parametrize(
"queue_system, queue_option",
"queue_system, queue_option",
(
("LSF", "LSF_QUEUE"),
("TORQUE", "QUEUE"),
("SLURM", "PARTITION"),
),
)
def test_deprecated_queue_name_initialization(queue_system, queue_option):
with pytest.warns(
ConfigWarning, match="Deprecated .* use: QUEUE_OPTION GENERIC QUEUE_NAME"
):
assert (
QueueConfig.from_dict(
{"QUEUE_OPTION": [[queue_system, queue_option, "some_name"]]}
)
).queue_options.queue_name
== "some_name"
)

0 comments on commit e315c9b

Please sign in to comment.