From 197417ff2f268183d673b00b8cc7fa3556b79e20 Mon Sep 17 00:00:00 2001 From: Andrew Nolan Date: Thu, 12 Sep 2024 10:03:13 -0600 Subject: [PATCH 1/2] Add reservation option to `job` config section for chicoma --- compass/job/__init__.py | 8 +++++++- compass/job/job_script.template | 3 +++ compass/machines/chicoma-cpu.cfg | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/compass/job/__init__.py b/compass/job/__init__.py index 54a0421235..21ec57f582 100644 --- a/compass/job/__init__.py +++ b/compass/job/__init__.py @@ -82,6 +82,11 @@ def write_job_script(config, machine, target_cores, min_cores, work_dir, else: constraint = '' + if config.has_option('job', 'reservation'): + reservation = config.get('job', 'reservation') + else: + reservation = '' + job_name = config.get('job', 'job_name') if job_name == '<<>>': if suite == '': @@ -96,7 +101,8 @@ def write_job_script(config, machine, target_cores, min_cores, work_dir, text = template.render(job_name=job_name, account=account, nodes=f'{nodes}', wall_time=wall_time, qos=qos, partition=partition, constraint=constraint, - suite=suite, pre_run_commands=pre_run_commands, + reservation=reservation, suite=suite, + pre_run_commands=pre_run_commands, post_run_commands=post_run_commands) text = _clean_up_whitespace(text) if suite == '': diff --git a/compass/job/job_script.template b/compass/job/job_script.template index 09030e2a6a..37a384a280 100644 --- a/compass/job/job_script.template +++ b/compass/job/job_script.template @@ -10,6 +10,9 @@ {% if qos != '' -%} #SBATCH --qos={{ qos }} {%- endif %} +{% if reservation != '' -%} +#SBATCH --reservation={{ reservation }} +{%- endif %} {% if partition != '' -%} #SBATCH --partition={{ partition }} {%- endif %} diff --git a/compass/machines/chicoma-cpu.cfg b/compass/machines/chicoma-cpu.cfg index 34211cf53f..73e75d3ffe 100644 --- a/compass/machines/chicoma-cpu.cfg +++ b/compass/machines/chicoma-cpu.cfg @@ -51,5 +51,8 @@ threads_per_core = 1 # The job partition to use partition = standard +# The job reservation to use (needed for debug jobs) +reservation = + # The job quality of service (QOS) to use qos = standard From 5fab51373c71e6ff228dfa88e2cf7b92d1ad12f7 Mon Sep 17 00:00:00 2001 From: Andrew Nolan Date: Thu, 12 Sep 2024 10:52:36 -0600 Subject: [PATCH 2/2] Update docs for using chicoma debug reservation --- docs/developers_guide/machines/chicoma.rst | 19 +++++++++++++++++++ docs/users_guide/machines/chicoma.rst | 7 +++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/developers_guide/machines/chicoma.rst b/docs/developers_guide/machines/chicoma.rst index 8bc14cfeec..69d4c7139e 100644 --- a/docs/developers_guide/machines/chicoma.rst +++ b/docs/developers_guide/machines/chicoma.rst @@ -19,3 +19,22 @@ Then, you can build the MPAS model with .. code-block:: bash make [DEBUG=true] gnu-cray + +debug jobs +~~~~~~~~~~ + +In order to run jobs in the debug queue, you will need to use: + +.. code-block:: cfg + + # Config options related to creating a job script + [job] + + # The job partition to use + partition = debug + + # The job reservation to use (needed for debug jobs) + reservation = debug + + # The job quality of service (QOS) to use + qos = diff --git a/docs/users_guide/machines/chicoma.rst b/docs/users_guide/machines/chicoma.rst index aa379af53c..3bc304db3c 100644 --- a/docs/users_guide/machines/chicoma.rst +++ b/docs/users_guide/machines/chicoma.rst @@ -138,9 +138,12 @@ when setting up test cases or a test suite: # The job partition to use partition = standard + # The job reservation to use (needed for debug jobs) + reservation = + # The job quality of service (QOS) to use qos = standard - + Additionally, some relevant config options come from the `mache `_ package: @@ -213,4 +216,4 @@ To build the MPAS model with .. code-block:: bash - make [DEBUG=true] [OPENMP=true] [ALBANY=true] gnu-cray \ No newline at end of file + make [DEBUG=true] [OPENMP=true] [ALBANY=true] gnu-cray