From b96f5ebbb1968bd539336652b87a2faa8ce68fd4 Mon Sep 17 00:00:00 2001 From: Kate Friedman Date: Tue, 12 Mar 2024 07:58:40 -0400 Subject: [PATCH] Add switch to control `debug=true` on WCOSS2 for development testing (#2388) Adds a switch (`DEBUG_POSTSCRIPT`) to control whether `debug=true` is set when submitting development rocoto jobs to PBS schedulers (currently just WCOSS2). There isn't an equivalent flag to set for SLURM on the RDHPCS. Have added this new switch to documentation. Refs #619 --- .github/workflows/docs.yaml | 2 +- docs/source/configure.rst | 112 ++++++++++++++++++----------------- parm/config/gefs/config.base | 1 + parm/config/gfs/config.base | 1 + workflow/rocoto/tasks.py | 7 ++- 5 files changed, 66 insertions(+), 57 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3113c31149..b04c85688b 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -57,7 +57,7 @@ jobs: if-no-files-found: ignore - name: Comment ReadDocs Link in PR - if: github.event_name == 'pull_request' + if: ${{ github.event_name == 'pull_request' }} uses: actions/github-script@v6 with: script: | diff --git a/docs/source/configure.rst b/docs/source/configure.rst index 12c2f75a48..439c5df110 100644 --- a/docs/source/configure.rst +++ b/docs/source/configure.rst @@ -4,58 +4,60 @@ Configure Run The global-workflow configs contain switches that change how the system runs. Many defaults are set initially. Users wishing to run with different settings should adjust their $EXPDIR configs and then rerun the ``setup_xml.py`` script since some configuration settings/switches change the workflow/xml ("Adjusts XML" column value is "YES"). -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| Switch | What | Default | Adjusts XML | More Details | -+================+==================================+===============+=============+===================================================+ -| APP | Model application | ATM | YES | See case block in config.base for options | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DOIAU | Enable 4DIAU for control | YES | NO | Turned off for cold-start first half cycle | -| | with 3 increments | | | | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DOHYBVAR | Run EnKF | YES | YES | Don't recommend turning off | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DONST | Run NSST | YES | NO | If YES, turns on NSST in anal/fcst steps, and | -| | | | | turn off rtgsst | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DO_AWIPS | Run jobs to produce AWIPS | NO | YES | downstream processing, ops only | -| | products | | | | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DO_BUFRSND | Run job to produce BUFR | NO | YES | downstream processing | -| | sounding products | | | | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DO_GEMPAK | Run job to produce GEMPAK | NO | YES | downstream processing, ops only | -| | products | | | | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DO_FIT2OBS | Run FIT2OBS job | YES | YES | Whether to run the FIT2OBS job | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DO_TRACKER | Run tracker job | YES | YES | Whether to run the tracker job | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DO_GENESIS | Run genesis job | YES | YES | Whether to run the genesis job | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DO_GENESIS_FSU | Run FSU genesis job | YES | YES | Whether to run the FSU genesis job | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DO_VERFOZN | Run GSI monitor ozone job | YES | YES | Whether to run the GSI monitor ozone job | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DO_VERFRAD | Run GSI monitor radiance job | YES | YES | Whether to run the GSI monitor radiance job | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DO_VMINMON | Run GSI monitor minimization job | YES | YES | Whether to run the GSI monitor minimization job | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| DO_METP | Run METplus jobs | YES | YES | One cycle spinup | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| EXP_WARM_START | Is experiment starting warm | .false. | NO | Impacts IAU settings for initial cycle. Can also | -| | (.true.) or cold (.false)? | | | be set when running ``setup_expt.py`` script with | -| | | | | the ``--start`` flag (e.g. ``--start warm``) | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| HPSSARCH | Archive to HPPS | NO | Possibly | Whether to save output to tarballs on HPPS | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| LOCALARCH | Archive to a local directory | NO | Possibly | Instead of archiving data to HPSS, archive to a | -| | | | | local directory, specified by ATARDIR. If | -| | | | | LOCALARCH=YES, then HPSSARCH must =NO. Changing | -| | | | | HPSSARCH from YES to NO will adjust the XML. | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| QUILTING | Use I/O quilting | .true. | NO | If .true. choose OUTPUT_GRID as cubed_sphere_grid | -| | | | | in netcdf or gaussian_grid | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ -| WRITE_DOPOST | Run inline post | .true. | NO | If .true. produces master post output in forecast | -| | | | | job | -+----------------+----------------------------------+---------------+-------------+---------------------------------------------------+ ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| Switch | What | Default | Adjusts XML | More Details | ++==================+==================================+===============+=============+===================================================+ +| APP | Model application | ATM | YES | See case block in config.base for options | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DEBUG_POSTSCRIPT | Debug option for PBS scheduler | NO | YES | Sets debug=true for additional logging | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DOIAU | Enable 4DIAU for control | YES | NO | Turned off for cold-start first half cycle | +| | with 3 increments | | | | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DOHYBVAR | Run EnKF | YES | YES | Don't recommend turning off | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DONST | Run NSST | YES | NO | If YES, turns on NSST in anal/fcst steps, and | +| | | | | turn off rtgsst | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DO_AWIPS | Run jobs to produce AWIPS | NO | YES | downstream processing, ops only | +| | products | | | | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DO_BUFRSND | Run job to produce BUFR | NO | YES | downstream processing | +| | sounding products | | | | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DO_GEMPAK | Run job to produce GEMPAK | NO | YES | downstream processing, ops only | +| | products | | | | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DO_FIT2OBS | Run FIT2OBS job | YES | YES | Whether to run the FIT2OBS job | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DO_TRACKER | Run tracker job | YES | YES | Whether to run the tracker job | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DO_GENESIS | Run genesis job | YES | YES | Whether to run the genesis job | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DO_GENESIS_FSU | Run FSU genesis job | YES | YES | Whether to run the FSU genesis job | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DO_VERFOZN | Run GSI monitor ozone job | YES | YES | Whether to run the GSI monitor ozone job | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DO_VERFRAD | Run GSI monitor radiance job | YES | YES | Whether to run the GSI monitor radiance job | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DO_VMINMON | Run GSI monitor minimization job | YES | YES | Whether to run the GSI monitor minimization job | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| DO_METP | Run METplus jobs | YES | YES | One cycle spinup | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| EXP_WARM_START | Is experiment starting warm | .false. | NO | Impacts IAU settings for initial cycle. Can also | +| | (.true.) or cold (.false)? | | | be set when running ``setup_expt.py`` script with | +| | | | | the ``--start`` flag (e.g. ``--start warm``) | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| HPSSARCH | Archive to HPPS | NO | Possibly | Whether to save output to tarballs on HPPS | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| LOCALARCH | Archive to a local directory | NO | Possibly | Instead of archiving data to HPSS, archive to a | +| | | | | local directory, specified by ATARDIR. If | +| | | | | LOCALARCH=YES, then HPSSARCH must =NO. Changing | +| | | | | HPSSARCH from YES to NO will adjust the XML. | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| QUILTING | Use I/O quilting | .true. | NO | If .true. choose OUTPUT_GRID as cubed_sphere_grid | +| | | | | in netcdf or gaussian_grid | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ +| WRITE_DOPOST | Run inline post | .true. | NO | If .true. produces master post output in forecast | +| | | | | job | ++------------------+----------------------------------+---------------+-------------+---------------------------------------------------+ diff --git a/parm/config/gefs/config.base b/parm/config/gefs/config.base index 495f201437..da315a73e7 100644 --- a/parm/config/gefs/config.base +++ b/parm/config/gefs/config.base @@ -75,6 +75,7 @@ export NMV="/bin/mv" export NLN="/bin/ln -sf" export VERBOSE="YES" export KEEPDATA="NO" +export DEBUG_POSTSCRIPT="NO" # PBS only; sets debug=true export CHGRP_RSTPROD="@CHGRP_RSTPROD@" export CHGRP_CMD="@CHGRP_CMD@" export NCDUMP="${NETCDF:-${netcdf_c_ROOT:-}}/bin/ncdump" diff --git a/parm/config/gfs/config.base b/parm/config/gfs/config.base index 48a9c728a4..d81ec60132 100644 --- a/parm/config/gfs/config.base +++ b/parm/config/gfs/config.base @@ -86,6 +86,7 @@ export NMV="/bin/mv" export NLN="/bin/ln -sf" export VERBOSE="YES" export KEEPDATA="NO" +export DEBUG_POSTSCRIPT="NO" # PBS only; sets debug=true export CHGRP_RSTPROD="@CHGRP_RSTPROD@" export CHGRP_CMD="@CHGRP_CMD@" export NCDUMP="${NETCDF:-${netcdf_c_ROOT:-}}/bin/ncdump" diff --git a/workflow/rocoto/tasks.py b/workflow/rocoto/tasks.py index ac70c6e4fc..01bf586af1 100644 --- a/workflow/rocoto/tasks.py +++ b/workflow/rocoto/tasks.py @@ -63,6 +63,7 @@ def __init__(self, app_config: AppConfig, cdump: str) -> None: 'cyc': '@H', 'COMROOT': self._base.get('COMROOT'), 'DATAROOT': self._base.get('DATAROOT')} + self.envars = self._set_envars(envar_dict) @staticmethod @@ -192,7 +193,11 @@ def get_resource(self, task_name): native = None if scheduler in ['pbspro']: - native = '-l debug=true,place=vscatter' + # Set place=vscatter by default and debug=true if DEBUG_POSTSCRIPT="YES" + if self._base['DEBUG_POSTSCRIPT']: + native = '-l debug=true,place=vscatter' + else: + native = '-l place=vscatter' # Set either exclusive or shared - default on WCOSS2 is exclusive when not set if task_config.get('is_exclusive', False): native += ':exclhost'