Skip to content

Commit

Permalink
Refactor Slurm error-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Sep 10, 2024
1 parent c020e8c commit e0e9d97
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions src/ert/config/queue_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,26 +328,19 @@ def from_dict(cls, config_dict: ConfigDict) -> QueueConfig:
"MEMORY_PER_JOB",
selected_queue_system == QueueSystem.TORQUE,
)
if (
isinstance(_queue_vals, SlurmQueueOptions)
and _queue_vals.memory
and realization_memory
):
_throw_error_or_warning(
"Do not specify both REALIZATION_MEMORY and SLURM option MEMORY",
"MEMORY",
selected_queue_system == QueueSystem.SLURM,
)
if (
isinstance(_queue_vals, SlurmQueueOptions)
and _queue_vals.memory_per_cpu
and realization_memory
):
_throw_error_or_warning(
"Do not specify both REALIZATION_MEMORY and SLURM option MEMORY_PER_CPU",
"MEMORY_PER_CPU",
selected_queue_system == QueueSystem.SLURM,
)
if isinstance(_queue_vals, SlurmQueueOptions) and realization_memory:
if _queue_vals.memory:
_throw_error_or_warning(
"Do not specify both REALIZATION_MEMORY and SLURM option MEMORY",
"MEMORY",
selected_queue_system == QueueSystem.SLURM,
)
if _queue_vals.memory_per_cpu:
_throw_error_or_warning(
"Do not specify both REALIZATION_MEMORY and SLURM option MEMORY_PER_CPU",
"MEMORY_PER_CPU",
selected_queue_system == QueueSystem.SLURM,
)

return QueueConfig(
job_script,
Expand Down

0 comments on commit e0e9d97

Please sign in to comment.