Skip to content

The cascade config structure

Guoqing Ge edited this page Jul 21, 2024 · 15 revisions

config/ structure

Use a cascading structure to separate concerns so that a task/job only defines required environmental variables in runtime

config.* file sourcing order in runtime

[config.pre] --> config.${MACHINE} -> config.base -> config.${task_id}

resources/config.* file sourcing order in setup_xml.py

[config.pre] --> config.${MACHINE} -> config.base -> [config.realtime if it is a realtime run]
NOTE:

  1. resources config files are only visible in the workflow setup process and are not needed in runtime
  2. task-specific resource settings are through variable cascading in resources/config.base. For example, we define WALLTIME for all tasks first. If we want to set a different WALLTIME for spinup fcst, we can add a variable WALLTIME_FCST_SPINUP in config/resources/config.base. setup_xml.py has a function called get_cascade_env to get the correct environmental setting in a reverse cascading way. Examples:
export NODES=${NODES:-"<nodes>1:ppn=1</nodes>"} #the NODES variable has to include the tag <nodes> or <cores>
........
........
# fcst
export NODES_FCST=${NODES_FCST:-"<nodes>3:ppn=40</nodes>"}
export WALLTIME_FCST=${WALLTIME_FCST:-"00:50:00"}

config.pre* files:

These optional files preamp some variables to provide some automation, such as for Jet realtime runs. Examples:

         config/config.pre.jet_hrrrv5  
         config/resources/config.pre.jet_hrrrv5 

They can be found in ${HOMErrfs}/workflow. setup_exp.py will copy them to config.pre under ${EXPDIR}

config.base

Most workflow settings go into this file

config.${MACHINE}

Define machine-dependent settings, such as COMINgfs, COMINrap, etc.
For resources configuration, this file defines
ACCOUNT, QUEUE, PARTITION, RESERVATION, NODES, WALLTIME, NATIVE, MEMORY
on different machines

config.${task_id}

Define task specific settings, such as config.lbc:

export LBC_PREFIX="GFS"
export LBC_OFFSET_HRS="6"
export LBC_INTERVAL_HRS="1"
export LBC_LENGTH_HRS=${FCST_LENGTH_HRS:-"12"}
export LBC_LENGTH_HRS=$((LBC_LENGTH_HRS+6))

config.realtime

This file defines DEADLINE and STARTTIME for rocoto-based realtime runs

Clone this wiki locally