Skip to content

Commit

Permalink
Add lsf options purely to lsf_validation
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Oct 25, 2023
1 parent 47c2e98 commit d524913
Showing 1 changed file with 18 additions and 39 deletions.
57 changes: 18 additions & 39 deletions src/ert/config/queue_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,6 @@ def _validate_torque_options(torque_options: List[Tuple[str, str]]) -> None:


string_lsf_options = [
"QSUB_CMD",
"QSTAT_CMD",
"QSTAT_OPTIONS",
"QDEL_CMD",
"QUEUE",
"CLUSTER_LABEL",
"JOB_PREFIX",
"DEBUG_OUTPUT",
"LSF_RESOURCE",
"LSF_SERVER",
Expand All @@ -176,26 +169,13 @@ def _validate_torque_options(torque_options: List[Tuple[str, str]]) -> None:
"BJOBS_CMD",
"BKILL_CMD",
"BHIST_CMD",
"BJOBS_TIMEOUT",
"EXCLUDE_HOST",
"PARTITION",
"PROJECT_CODE",
"SBATCH",
"SCANCEL",
"SCONTROL",
"SQUEUE",
"MEMORY",
"MEMORY_PER_CPU",
"EXCLUDE_HOST",
"INCLUDE_HOST",
]

positive_int_lsf_options = [
"NUM_CPUS_PER_NODE",
"NUM_NODES",
"BJOBS_TIMEOUT",
"MAX_RUNNING",
"MAX_RUNTIME",
"QUEUE_QUERY_TIMEOUT",
]


Expand All @@ -208,28 +188,27 @@ def _validate_lsf_options(lsf_options: List[Tuple[str, str]]) -> None:
f"The value '{option_value}' is not valid string for the LSF option "
"{option_name}, it must be of string type."
)

if (
option_name in ["SUBMIT_SLEEP", "SQUEUE_TIMEOUT"]
option_name == "SUBMIT_SLEEP"
and re.match(r"\d+(\.\d+)", option_value) is None
):
raise ConfigValidationError(
f"The value '{option_value}' is not valid integer or float"
" for the LSF option {option_name}."
)
if (
option_name in positive_int_lsf_options
and re.match(r"\d+", option_value) is None
):
raise ConfigValidationError(
f"The value '{option_value}' is not valid positive integer "
" for the LSF option {option_name}."
)
if option_name in ["KEEP_QSUB_OUTPUT", "DEBUG_OUTPUT"] and not option_value in [
"TRUE",
"FALSE",
]:
raise ConfigValidationError(
f"The value '{option_value}' must be either TRUE or FALSE "
" for the LSF option {option_name}."
)
if (
option_name in positive_int_lsf_options
and re.match(r"\d+", option_value) is None
):
raise ConfigValidationError(
f"The value '{option_value}' is not valid positive integer "
" for the LSF option {option_name}."
)
if option_name == "DEBUG_OUTPUT" and not option_value in [
"TRUE",
"FALSE",
]:
raise ConfigValidationError(
f"The value '{option_value}' must be either TRUE or FALSE "
" for the LSF option {option_name}."
)

0 comments on commit d524913

Please sign in to comment.