Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
(testing)
Browse files Browse the repository at this point in the history
Add TORQUE option to Everest
  • Loading branch information
Yngve S. Kristiansen committed Sep 4, 2024
1 parent 29ace2b commit 2ac2f18
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/everest/config/simulator_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SimulatorConfig(BaseModel, HasErtQueueOptions, extra="forbid"): # type: i
Examples to set memory requirement is:
* rusage[mem=1000]""",
)
queue_system: Optional[Literal["lsf", "local", "slurm"]] = Field(
queue_system: Optional[Literal["lsf", "local", "slurm", "torque"]] = Field(
default="local",
description="Defines which queue system the everest server runs on.",
)
Expand Down
14 changes: 14 additions & 0 deletions src/everest/config_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ class ConfigKeys:
TEMPLATE = "template"
TIME_CORR = "time_correlation"
TIMES_LIST = "times_list"
TORQUE = "torque"
TORQUE_QSUB_CMD = "qsub_cmd"
TORQUE_QSTAT_CMD = "qstat_cmd"
TORQUE_QDEL_CMD = "qdel_cmd"
TORQUE_QSTAT_OPTIONS = "qstat_options"
TORQUE_QUEUE = "queue"
TORQUE_CLUSTER_LABEL = "cluster_label"
TORQUE_NUM_NODES = "num_nodes"
TORQUE_NUM_CPUS_PER_NODE = "num_cpus_per_node"
TORQUE_MEMORY_PER_JOB = "memory_per_job"
TORQUE_KEEP_QSUB_OUTPUT = "keep_qsub_output"
TORQUE_SUBMIT_SLEEP = "submit_sleep"
TORQUE_QUEUE_QUERY_TIMEOUT = "queue_query_timeout"
TORQUE_PROJECT_CODE = "project_code"
TYPE = "type"
UPPER_BOUND = "upper_bound"
USER_DEFINED_TYPE = "user_defined_type"
Expand Down
20 changes: 20 additions & 0 deletions src/everest/queue_driver/queue_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@
(ConfigKeys.SLURM_INCLUDE_HOST_OPTION, "INCLUDE_HOST"),
]

_TORQUE_OPTIONS = [
(ConfigKeys.CORES, "MAX_RUNNING"),
(ConfigKeys.TORQUE_QSUB_CMD, "QSUB_CMD"),
(ConfigKeys.TORQUE_QSTAT_CMD, "QSTAT_CMD"),
(ConfigKeys.TORQUE_QDEL_CMD, "QDEL_CMD"),
(ConfigKeys.TORQUE_QSTAT_OPTIONS, "QSTAT_OPTIONS"),
(ConfigKeys.TORQUE_QUEUE, "QUEUE"),
(ConfigKeys.TORQUE_CLUSTER_LABEL, "CLUSTER_LABEL"),
(ConfigKeys.TORQUE_NUM_NODES, "NUM_NODES"),
(ConfigKeys.TORQUE_NUM_CPUS_PER_NODE, "NUM_CPUS_PER_NODE"),
(ConfigKeys.TORQUE_MEMORY_PER_JOB, "MEMORY_PER_JOB"),
(ConfigKeys.TORQUE_KEEP_QSUB_OUTPUT, "KEEP_QSUB_OUTPUT"),
(ConfigKeys.TORQUE_SUBMIT_SLEEP, "SUBMIT_SLEEP"),
(ConfigKeys.TORQUE_QUEUE_QUERY_TIMEOUT, "QUEUE_QUERY_TIMEOUT"),
(ConfigKeys.TORQUE_PROJECT_CODE, "PROJECT_CODE"),
]

def _extract_ert_queue_options_from_simulator_config(
simulator: Optional[SimulatorConfig], queue_system
Expand All @@ -51,6 +67,10 @@ def _extract_ert_queue_options_from_simulator_config(
return simulator.extract_ert_queue_options(
queue_system=QueueSystem.SLURM, everest_to_ert_key_tuples=_SLURM_OPTIONS
)
elif queue_system == ConfigKeys.TORQUE:
return simulator.extract_ert_queue_options(
queue_system=QueueSystem.TORQUE, everest_to_ert_key_tuples=_TORQUE_OPTIONS
)

raise KeyError(
f"Invalid queue_system: {queue_system}, "
Expand Down

0 comments on commit 2ac2f18

Please sign in to comment.