diff --git a/env/AWSPW.env b/env/AWSPW.env index 7d81000f5c..a4f598d3d7 100755 --- a/env/AWSPW.env +++ b/env/AWSPW.env @@ -3,11 +3,6 @@ if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" - echo "argument can be any one of the following:" - echo "atmanlvar atmanlfv3inc atmensanlletkf atmensanlfv3inc aeroanlrun snowanl" - echo "anal sfcanl fcst post metp" - echo "eobs eupd ecen efcs epos" - echo "postsnd awips gempak" exit 1 fi @@ -26,13 +21,11 @@ ulimit -a if [[ "${step}" = "fcst" ]] || [[ "${step}" = "efcs" ]]; then - if [[ "${CDUMP}" =~ "gfs" ]]; then - nprocs="npe_${step}_gfs" - ppn="npe_node_${step}_gfs" || ppn="npe_node_${step}" - else - nprocs="npe_${step}" - ppn="npe_node_${step}" - fi + ppn="npe_node_${step}_${RUN}" + [[ -z "${!ppn+0}" ]] && ppn="npe_node_${step}" + nprocs="npe_${step}_${RUN}" + [[ -z ${!nprocs+0} ]] && nprocs="npe_${step}" + (( nnodes = (${!nprocs}+${!ppn}-1)/${!ppn} )) (( ntasks = nnodes*${!ppn} )) # With ESMF threading, the model wants to use the full node @@ -109,21 +102,6 @@ elif [[ "${step}" = "awips" ]]; then [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} export APRUN_AWIPSCFP="${launcher} -n ${npe_awips} ${mpmd_opt}" -elif [[ "${step}" = "gempak" ]]; then - - export CFP_MP="YES" - - if [[ ${CDUMP} == "gfs" ]]; then - npe_gempak=${npe_gempak_gfs} - npe_node_gempak=${npe_node_gempak_gfs} - fi - - nth_max=$((npe_node_max / npe_node_gempak)) - - export NTHREADS_GEMPAK=${nth_gempak:-1} - [[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} - export APRUN="${launcher} -n ${npe_gempak} ${mpmd_opt}" - elif [[ "${step}" = "fit2obs" ]]; then diff --git a/env/CONTAINER.env b/env/CONTAINER.env index 77768b485b..c40543794b 100755 --- a/env/CONTAINER.env +++ b/env/CONTAINER.env @@ -3,11 +3,6 @@ if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" - echo "argument can be any one of the following:" - echo "atmanlvar atmanlfv3inc atmensanlletkf atmensanlfv3inc aeroanlrun snowanl" - echo "anal sfcanl fcst post metp" - echo "eobs eupd ecen efcs epos" - echo "postsnd awips gempak" exit 1 fi diff --git a/env/GAEA.env b/env/GAEA.env index c19fecc934..5509a29a3f 100755 --- a/env/GAEA.env +++ b/env/GAEA.env @@ -3,8 +3,6 @@ if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" - echo "argument can be any one of the following:" - echo "fcst atmos_products" exit 1 fi @@ -19,13 +17,11 @@ ulimit -a if [[ "${step}" = "fcst" ]]; then - if [[ "${CDUMP}" =~ "gfs" ]]; then - nprocs="npe_${step}_gfs" - ppn="npe_node_${step}_gfs" || ppn="npe_node_${step}" - else - nprocs="npe_${step}" - ppn="npe_node_${step}" - fi + ppn="npe_node_${step}_${RUN}" + [[ -z "${!ppn+0}" ]] && ppn="npe_node_${step}" + nprocs="npe_${step}_${RUN}" + [[ -z ${!nprocs+0} ]] && nprocs="npe_${step}" + (( nnodes = (${!nprocs}+${!ppn}-1)/${!ppn} )) (( ntasks = nnodes*${!ppn} )) # With ESMF threading, the model wants to use the full node diff --git a/env/HERA.env b/env/HERA.env index 94bab36703..db63f0bfa5 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -3,11 +3,6 @@ if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" - echo "argument can be any one of the following:" - echo "atmanlvar atmanlfv3inc atmensanlletkf atmensanlfv3inc aeroanlrun snowanl" - echo "anal sfcanl fcst post metp" - echo "eobs eupd ecen efcs epos" - echo "postsnd awips gempak" exit 1 fi @@ -219,13 +214,11 @@ elif [[ "${step}" = "eupd" ]]; then elif [[ "${step}" = "fcst" ]] || [[ "${step}" = "efcs" ]]; then - if [[ "${CDUMP}" =~ "gfs" ]]; then - nprocs="npe_${step}_gfs" - ppn="npe_node_${step}_gfs" || ppn="npe_node_${step}" - else - nprocs="npe_${step}" - ppn="npe_node_${step}" - fi + ppn="npe_node_${step}_${RUN}" + [[ -z "${!ppn+0}" ]] && ppn="npe_node_${step}" + nprocs="npe_${step}_${RUN}" + [[ -z ${!nprocs+0} ]] && nprocs="npe_${step}" + (( nnodes = (${!nprocs}+${!ppn}-1)/${!ppn} )) (( ntasks = nnodes*${!ppn} )) # With ESMF threading, the model wants to use the full node @@ -314,10 +307,6 @@ elif [[ "${step}" = "gempak" ]]; then export CFP_MP="YES" - if [[ ${CDUMP} == "gfs" ]]; then - npe_node_gempak=${npe_node_gempak_gfs} - fi - nth_max=$((npe_node_max / npe_node_gempak)) export NTHREADS_GEMPAK=${nth_gempak:-1} diff --git a/env/HERCULES.env b/env/HERCULES.env index d43dedad8d..77e57e066d 100755 --- a/env/HERCULES.env +++ b/env/HERCULES.env @@ -3,9 +3,6 @@ if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" - echo "argument can be any one of the following:" - echo "fcst post" - echo "Note: Hercules is only set up to run in forecast-only mode" exit 1 fi @@ -211,13 +208,12 @@ case ${step} in "fcst" | "efcs") export OMP_STACKSIZE=512M - if [[ "${CDUMP}" =~ "gfs" ]]; then - nprocs="npe_${step}_gfs" - ppn="npe_node_${step}_gfs" || ppn="npe_node_${step}" - else - nprocs="npe_${step}" - ppn="npe_node_${step}" - fi + + ppn="npe_node_${step}_${RUN}" + [[ -z "${!ppn+0}" ]] && ppn="npe_node_${step}" + nprocs="npe_${step}_${RUN}" + [[ -z ${!nprocs+0} ]] && nprocs="npe_${step}" + (( nnodes = (${!nprocs}+${!ppn}-1)/${!ppn} )) (( ntasks = nnodes*${!ppn} )) # With ESMF threading, the model wants to use the full node @@ -312,18 +308,7 @@ case ${step} in ;; "gempak") - export CFP_MP="YES" - - if [[ ${CDUMP} == "gfs" ]]; then - npe_gempak=${npe_gempak_gfs} - npe_node_gempak=${npe_node_gempak_gfs} - fi - - nth_max=$((npe_node_max / npe_node_gempak)) - - export NTHREADS_GEMPAK=${nth_gempak:-1} - [[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} - export APRUN="${launcher} -n ${npe_gempak} ${mpmd_opt}" + echo "WARNING: ${step} is not enabled on ${machine}!" ;; "fit2obs") diff --git a/env/JET.env b/env/JET.env index 668ec1c2e4..bb9826f331 100755 --- a/env/JET.env +++ b/env/JET.env @@ -3,11 +3,6 @@ if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" - echo "argument can be any one of the following:" - echo "atmanlvar atmanlfv3inc atmensanlletkf atmensanlfv3inc aeroanlrun snowanl" - echo "anal sfcanl fcst post metp" - echo "eobs eupd ecen efcs epos" - echo "postsnd awips gempak" exit 1 fi @@ -192,13 +187,11 @@ elif [[ "${step}" = "eupd" ]]; then elif [[ "${step}" = "fcst" ]] || [[ "${step}" = "efcs" ]]; then - if [[ "${CDUMP}" =~ "gfs" ]]; then - nprocs="npe_${step}_gfs" - ppn="npe_node_${step}_gfs" || ppn="npe_node_${step}" - else - nprocs="npe_${step}" - ppn="npe_node_${step}" - fi + ppn="npe_node_${step}_${RUN}" + [[ -z "${!ppn+0}" ]] && ppn="npe_node_${step}" + nprocs="npe_${step}_${RUN}" + [[ -z ${!nprocs+0} ]] && nprocs="npe_${step}" + (( nnodes = (${!nprocs}+${!ppn}-1)/${!ppn} )) (( ntasks = nnodes*${!ppn} )) # With ESMF threading, the model wants to use the full node diff --git a/env/ORION.env b/env/ORION.env index afd1cda052..502e99e192 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -3,11 +3,6 @@ if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" - echo "argument can be any one of the following:" - echo "atmanlvar atmanlfv3inc atmensanlletkf atmensanlfv3inc aeroanlrun snowanl" - echo "anal sfcanl fcst post metp" - echo "eobs eupd ecen efcs epos" - echo "postsnd awips gempak" exit 1 fi @@ -226,14 +221,11 @@ elif [[ "${step}" = "eupd" ]]; then elif [[ "${step}" = "fcst" ]] || [[ "${step}" = "efcs" ]]; then - export OMP_STACKSIZE=512M - if [[ "${CDUMP}" =~ "gfs" ]]; then - nprocs="npe_${step}_gfs" - ppn="npe_node_${step}_gfs" || ppn="npe_node_${step}" - else - nprocs="npe_${step}" - ppn="npe_node_${step}" - fi + ppn="npe_node_${step}_${RUN}" + [[ -z "${!ppn+0}" ]] && ppn="npe_node_${step}" + nprocs="npe_${step}_${RUN}" + [[ -z ${!nprocs+0} ]] && nprocs="npe_${step}" + (( nnodes = (${!nprocs}+${!ppn}-1)/${!ppn} )) (( ntasks = nnodes*${!ppn} )) # With ESMF threading, the model wants to use the full node @@ -319,18 +311,7 @@ elif [[ "${step}" = "awips" ]]; then elif [[ "${step}" = "gempak" ]]; then - export CFP_MP="YES" - - if [[ ${CDUMP} == "gfs" ]]; then - npe_gempak=${npe_gempak_gfs} - npe_node_gempak=${npe_node_gempak_gfs} - fi - - nth_max=$((npe_node_max / npe_node_gempak)) - - export NTHREADS_GEMPAK=${nth_gempak:-1} - [[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} - export APRUN="${launcher} -n ${npe_gempak} ${mpmd_opt}" + echo "WARNING: ${step} is not enabled on ${machine}!" elif [[ "${step}" = "fit2obs" ]]; then diff --git a/env/S4.env b/env/S4.env index 8a368bf1d6..190c7295f4 100755 --- a/env/S4.env +++ b/env/S4.env @@ -3,11 +3,6 @@ if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" - echo "argument can be any one of the following:" - echo "atmanlvar atmanlfv3inc atmensanlletkf atmensanlfv3inc aeroanlrun snowanl" - echo "anal sfcanl fcst post metp" - echo "eobs eupd ecen efcs epos" - echo "postsnd awips gempak" exit 1 fi @@ -179,13 +174,11 @@ elif [[ "${step}" = "eupd" ]]; then elif [[ "${step}" = "fcst" ]] || [[ "${step}" = "efcs" ]]; then - if [[ "${CDUMP}" =~ "gfs" ]]; then - nprocs="npe_${step}_gfs" - ppn="npe_node_${step}_gfs" || ppn="npe_node_${step}" - else - nprocs="npe_${step}" - ppn="npe_node_${step}" - fi + ppn="npe_node_${step}_${RUN}" + [[ -z "${!ppn+0}" ]] && ppn="npe_node_${step}" + nprocs="npe_${step}_${RUN}" + [[ -z ${!nprocs+0} ]] && nprocs="npe_${step}" + (( nnodes = (${!nprocs}+${!ppn}-1)/${!ppn} )) (( ntasks = nnodes*${!ppn} )) # With ESMF threading, the model wants to use the full node @@ -198,6 +191,7 @@ elif [[ "${step}" = "upp" ]]; then export NTHREADS_UPP=${nth_upp:-1} [[ ${NTHREADS_UPP} -gt ${nth_max} ]] && export NTHREADS_UPP=${nth_max} + export OMP_NUM_THREADS="${NTHREADS_UPP}" export APRUN_UPP="${launcher} -n ${npe_upp}" elif [[ "${step}" = "atmos_products" ]]; then diff --git a/env/WCOSS2.env b/env/WCOSS2.env index 9fe9179e6b..befca81d26 100755 --- a/env/WCOSS2.env +++ b/env/WCOSS2.env @@ -3,11 +3,6 @@ if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" - echo "argument can be any one of the following:" - echo "atmanlvar atmanlfv3inc atmensanlletkf atmensanlfv3inc aeroanlrun snowanl" - echo "anal sfcanl fcst post metp" - echo "eobs eupd ecen esfc efcs epos" - echo "postsnd awips gempak" exit 1 fi @@ -38,7 +33,6 @@ elif [[ "${step}" = "prep_emissions" ]]; then elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then export USE_CFP="YES" - if [[ "${step}" = "waveprep" ]] && [[ "${CDUMP}" = "gfs" ]]; then export NTASKS=${NTASKS_gfs} ; fi export wavempexec="${launcher} -np" export wave_mpmd=${mpmd_opt} @@ -182,13 +176,11 @@ elif [[ "${step}" = "eupd" ]]; then elif [[ "${step}" = "fcst" ]] || [[ "${step}" = "efcs" ]]; then - if [[ "${CDUMP}" =~ "gfs" ]]; then - nprocs="npe_${step}_gfs" - ppn="npe_node_${step}_gfs" || ppn="npe_node_${step}" - else - nprocs="npe_${step}" - ppn="npe_node_${step}" - fi + ppn="npe_node_${step}_${RUN}" + [[ -z "${!ppn+0}" ]] && ppn="npe_node_${step}" + nprocs="npe_${step}_${RUN}" + [[ -z ${!nprocs+0} ]] && nprocs="npe_${step}" + (( nnodes = (${!nprocs}+${!ppn}-1)/${!ppn} )) (( ntasks = nnodes*${!ppn} )) # With ESMF threading, the model wants to use the full node @@ -291,11 +283,6 @@ elif [[ "${step}" = "awips" ]]; then elif [[ "${step}" = "gempak" ]]; then - if [[ ${CDUMP} == "gfs" ]]; then - npe_gempak=${npe_gempak_gfs} - npe_node_gempak=${npe_node_gempak_gfs} - fi - nth_max=$((npe_node_max / npe_node_gempak)) export NTHREADS_GEMPAK=${nth_gempak:-1} diff --git a/modulefiles/module_gwsetup.hercules.lua b/modulefiles/module_gwsetup.hercules.lua index 795b295b30..9d845fb71d 100644 --- a/modulefiles/module_gwsetup.hercules.lua +++ b/modulefiles/module_gwsetup.hercules.lua @@ -3,7 +3,7 @@ Load environment to run GFS workflow ci scripts on Hercules ]]) load(pathJoin("contrib","0.1")) -load(pathJoin("rocoto","1.3.5")) +load(pathJoin("rocoto","1.3.7")) prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/gsi-addon-env/install/modulefiles/Core") diff --git a/parm/config/gefs/config.resources b/parm/config/gefs/config.resources index b2ca5b3e51..7c3d77de1d 100644 --- a/parm/config/gefs/config.resources +++ b/parm/config/gefs/config.resources @@ -202,7 +202,7 @@ case ${step} in declare -x "wtime_${step}_gfs"="06:00:00" ;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" exit 4 ;; esac diff --git a/parm/config/gfs/config.anal b/parm/config/gfs/config.anal index 5c20a198de..2c55d85ff4 100644 --- a/parm/config/gfs/config.anal +++ b/parm/config/gfs/config.anal @@ -19,12 +19,8 @@ if [[ "${CDUMP}" = "gfs" ]] ; then export DIAG_TARBALL="YES" fi -export npe_gsi=${npe_anal} - -if [[ "${CDUMP}" == "gfs" ]] ; then - export npe_gsi=${npe_anal_gfs} - export nth_anal=${nth_anal_gfs} -fi +npe_var="npe_anal_${RUN/enkf}" +export npe_gsi="${!npe_var}" # Set parameters specific to L127 if [[ ${LEVS} = "128" ]]; then diff --git a/parm/config/gfs/config.analcalc b/parm/config/gfs/config.analcalc index 9405114ecc..d9501503f0 100644 --- a/parm/config/gfs/config.analcalc +++ b/parm/config/gfs/config.analcalc @@ -6,10 +6,6 @@ echo "BEGIN: config.analcalc" # Get task specific resources -. $EXPDIR/config.resources analcalc - -if [[ "$CDUMP" == "gfs" ]]; then - export nth_echgres=$nth_echgres_gfs -fi +. ${EXPDIR}/config.resources analcalc echo "END: config.analcalc" diff --git a/parm/config/gfs/config.resources b/parm/config/gfs/config.resources index e5f741cf7e..2e910d4eb4 100644 --- a/parm/config/gfs/config.resources +++ b/parm/config/gfs/config.resources @@ -3,6 +3,8 @@ ########## config.resources ########## # Set resource information for job tasks # e.g. walltime, node, cores per node, memory etc. +# Note: machine-specific resources should be placed into the appropriate config file: +# config.resources.${machine} if (( $# != 1 )); then @@ -33,16 +35,53 @@ step=$1 echo "BEGIN: config.resources" case ${machine} in - "WCOSS2") npe_node_max=128;; - "HERA") npe_node_max=40;; - "GAEA") npe_node_max=128;; - "ORION") npe_node_max=40;; - "HERCULES") npe_node_max=80;; + "WCOSS2") + npe_node_max=128 + # shellcheck disable=SC2034 + mem_node_max="500GB" + ;; + "HERA") + npe_node_max=40 + # shellcheck disable=SC2034 + mem_node_max="96GB" + ;; + "GAEA") + npe_node_max=128 + # shellcheck disable=SC2034 + mem_node_max="251GB" + ;; + "ORION") + npe_node_max=40 + # shellcheck disable=SC2034 + mem_node_max="192GB" + ;; + "HERCULES") + npe_node_max=80 + # shellcheck disable=SC2034 + mem_node_max="512GB" + ;; "JET") case ${PARTITION_BATCH} in - "xjet") npe_node_max=24;; - "vjet" | "sjet") npe_node_max=16;; - "kjet") npe_node_max=40;; + "xjet") + npe_node_max=24 + # shellcheck disable=SC2034 + mem_node_max="61GB" + ;; + "vjet") + npe_node_max=16 + # shellcheck disable=SC2034 + mem_node_max="61GB" + ;; + "sjet") + npe_node_max=16 + # shellcheck disable=SC2034 + mem_node_max="29GB" + ;; + "kjet") + npe_node_max=40 + # shellcheck disable=SC2034 + mem_node_max="88GB" + ;; *) echo "FATAL ERROR: Unknown partition ${PARTITION_BATCH} specified for ${machine}" exit 3 @@ -50,8 +89,15 @@ case ${machine} in ;; "S4") case ${PARTITION_BATCH} in - "s4") npe_node_max=32;; - "ivy") npe_node_max=20;; + "s4") npe_node_max=32 + # shellcheck disable=SC2034 + mem_node_max="168GB" + ;; + "ivy") + npe_node_max=20 + # shellcheck disable=SC2034 + mem_node_max="128GB" + ;; *) echo "FATAL ERROR: Unknown partition ${PARTITION_BATCH} specified for ${machine}" exit 3 @@ -60,15 +106,22 @@ case ${machine} in "AWSPW") export PARTITION_BATCH="compute" npe_node_max=40 + # TODO Supply a max mem/node value for AWS + # shellcheck disable=SC2034 + mem_node_max="" ;; "CONTAINER") npe_node_max=1 + # TODO Supply a max mem/node value for a container + # shellcheck disable=SC2034 + mem_node_max="" ;; *) echo "FATAL ERROR: Unknown machine encountered by ${BASH_SOURCE[0]}" exit 2 ;; esac + export npe_node_max case ${step} in @@ -77,11 +130,7 @@ case ${step} in export npe_prep=4 export npe_node_prep=2 export nth_prep=1 - if [[ "${machine}" == "WCOSS2" ]]; then - export is_exclusive=True - else - export memory_prep="40GB" - fi + export memory_prep="40GB" ;; "prepsnowobs") @@ -118,26 +167,39 @@ case ${step} in "waveprep") export wtime_waveprep="00:10:00" - export npe_waveprep=5 + export npe_waveprep_gdas=5 export npe_waveprep_gfs=65 - export nth_waveprep=1 + export nth_waveprep_gdas=1 export nth_waveprep_gfs=1 - export npe_node_waveprep=$(( npe_node_max / nth_waveprep )) + export npe_node_waveprep_gdas=$(( npe_node_max / nth_waveprep_gdas )) export npe_node_waveprep_gfs=$(( npe_node_max / nth_waveprep_gfs )) - export NTASKS=${npe_waveprep} + export NTASKS_gdas=${npe_waveprep_gdas} export NTASKS_gfs=${npe_waveprep_gfs} - export memory_waveprep="100GB" + export memory_waveprep_gdas="100GB" export memory_waveprep_gfs="150GB" + + var_npe_node="npe_node_waveprep_${RUN}" + var_nth="nth_waveprep_${RUN}" + var_npe="npe_waveprep_${RUN}" + var_NTASKS="ntasks_${RUN}" + # RUN is set to a single value at setup time, so these won't be found + # TODO rework setup_xml.py to initialize RUN to the applicable option + if [[ -n "${!var_npe_node+0}" ]]; then + declare -x "npe_node_waveprep"="${!var_npe_node}" \ + "nth_waveprep"="${!var_nth}" \ + "npe_waveprep"="${!var_npe}" \ + "NTASKS"="${!var_NTASKS}" + fi ;; "wavepostsbs") - export wtime_wavepostsbs="00:20:00" + export wtime_wavepostsbs_gdas="00:20:00" export wtime_wavepostsbs_gfs="03:00:00" export npe_wavepostsbs=8 export nth_wavepostsbs=1 export npe_node_wavepostsbs=$(( npe_node_max / nth_wavepostsbs )) export NTASKS=${npe_wavepostsbs} - export memory_wavepostsbs="10GB" + export memory_wavepostsbs_gdas="10GB" export memory_wavepostsbs_gfs="10GB" ;; @@ -229,13 +291,23 @@ case ${step} in export layout_y=${layout_y_atmanl} export wtime_atmanlvar="00:30:00" - export npe_atmanlvar=$(( layout_x * layout_y * 6 )) + export npe_atmanlvar_gdas=$(( layout_x * layout_y * 6 )) export npe_atmanlvar_gfs=$(( layout_x * layout_y * 6 )) - export nth_atmanlvar=1 - export nth_atmanlvar_gfs=${nth_atmanlvar} - export npe_node_atmanlvar=$(( npe_node_max / nth_atmanlvar )) + export nth_atmanlvar_gdas=1 + export nth_atmanlvar_gfs=${nth_atmanlvar_gdas} + export npe_node_atmanlvar_gdas=$(( npe_node_max / nth_atmanlvar_gdas )) + export npe_node_atmanlvar_gfs=$(( npe_node_max / nth_atmanlvar_gfs )) export memory_atmanlvar="96GB" export is_exclusive=True + + var_npe_node="npe_node_atmanlvar_${RUN}" + var_nth="nth_atmanlvar_${RUN}" + var_npe="npe_atmanlvar_${RUN}" + if [[ -n "${!var_npe_node+0}" ]]; then + declare -x "npe_node_atmanlvar"="${!var_npe_node}" \ + "nth_atmanlvar"="${!var_nth}" \ + "npe_atmanlvar"="${!var_npe}" + fi ;; "atmanlfv3inc") @@ -243,13 +315,23 @@ case ${step} in export layout_y=${layout_y_atmanl} export wtime_atmanlfv3inc="00:30:00" - export npe_atmanlfv3inc=$(( layout_x * layout_y * 6 )) + export npe_atmanlfv3inc_gdas=$(( layout_x * layout_y * 6 )) export npe_atmanlfv3inc_gfs=$(( layout_x * layout_y * 6 )) - export nth_atmanlfv3inc=1 - export nth_atmanlfv3inc_gfs=${nth_atmanlfv3inc} - export npe_node_atmanlfv3inc=$(( npe_node_max / nth_atmanlfv3inc )) + export nth_atmanlfv3inc_gdas=1 + export nth_atmanlfv3inc_gfs=${nth_atmanlfv3inc_gdas} + export npe_node_atmanlfv3inc_gdas=$(( npe_node_max / nth_atmanlfv3inc_gdas )) + export npe_node_atmanlfv3inc_gfs=$(( npe_node_max / nth_atmanlfv3inc_gfs )) export memory_atmanlfv3inc="96GB" export is_exclusive=True + + var_npe_node="npe_node_atmanlfv3inc_${RUN}" + var_nth="nth_atmanlfv3inc_${RUN}" + var_npe="npe_atmanlfv3inc_${RUN}" + if [[ -n "${!var_npe_node+0}" ]]; then + declare -x "npe_node_atmanlfv3inc"="${!var_npe_node}" \ + "nth_atmanlfv3inc"="${!var_nth}" \ + "npe_atmanlfv3inc"="${!var_npe}" + fi ;; "atmanlfinal") @@ -276,7 +358,7 @@ case ${step} in layout_y=1 ;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" exit 4 esac @@ -318,7 +400,7 @@ case ${step} in layout_y=1 ;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" exit 4 esac @@ -351,7 +433,7 @@ case ${step} in layout_y=1 ;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" exit 4 esac @@ -359,12 +441,22 @@ case ${step} in export layout_y export wtime_aeroanlrun="00:30:00" - export npe_aeroanlrun=$(( layout_x * layout_y * 6 )) + export npe_aeroanlrun_gdas=$(( layout_x * layout_y * 6 )) export npe_aeroanlrun_gfs=$(( layout_x * layout_y * 6 )) - export nth_aeroanlrun=1 + export nth_aeroanlrun_gdas=1 export nth_aeroanlrun_gfs=1 - export npe_node_aeroanlrun=$(( npe_node_max / nth_aeroanlrun )) + export npe_node_aeroanlrun_gdas=$(( npe_node_max / nth_aeroanlrun_gdas )) + export npe_node_aeroanlrun_gfs=$(( npe_node_max / nth_aeroanlrun_gfs )) export is_exclusive=True + + var_npe_node="npe_node_aeroanlrun_${RUN}" + var_nth="nth_aeroanlrun_${RUN}" + var_npe="npe_aeroanlrun_${RUN}" + if [[ -n "${!var_npe_node+0}" ]]; then + declare -x "npe_node_aeroanlrun"="${!var_npe_node}" \ + "nth_aeroanlrun"="${!var_nth}" \ + "npe_aeroanlrun"="${!var_npe}" + fi ;; "aeroanlfinal") @@ -398,7 +490,7 @@ case ${step} in "050") npes=16;; "500") npes=16;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${OCNRES}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${OCNRES}" exit 4 esac @@ -425,7 +517,7 @@ case ${step} in memory_ocnanalrun="24GB" ;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${OCNRES}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${OCNRES}" exit 4 esac @@ -453,7 +545,7 @@ case ${step} in memory_ocnanalecen="24GB" ;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${OCNRES}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${OCNRES}" exit 4 esac @@ -481,7 +573,7 @@ case ${step} in memory_ocnanalletkf="24GB" ;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${OCNRES}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${OCNRES}" exit 4 esac @@ -510,7 +602,7 @@ case ${step} in memory_ocnanalchkpt="32GB" npes=8;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${OCNRES}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${OCNRES}" exit 4 esac export npe_ocnanalchkpt=${npes} @@ -533,59 +625,26 @@ case ${step} in ;; "anal") - export wtime_anal="01:20:00" + export wtime_anal_gdas="01:20:00" export wtime_anal_gfs="01:00:00" - export npe_anal=780 - export nth_anal=5 - export npe_anal_gfs=825 - export nth_anal_gfs=5 - if [[ "${machine}" == "WCOSS2" ]]; then - export nth_anal=8 - export nth_anal_gfs=8 - fi case ${CASE} in + "C768") + export npe_anal_gdas=780 + export npe_anal_gfs=825 + export nth_anal=5 + ;; "C384") - export npe_anal=160 + export npe_anal_gdas=160 export npe_anal_gfs=160 export nth_anal=10 - export nth_anal_gfs=10 - if [[ ${machine} = "HERA" ]]; then - export npe_anal=270 - export npe_anal_gfs=270 - export nth_anal=8 - export nth_anal_gfs=8 - fi - if [[ ${machine} = "S4" ]]; then - #On the S4-s4 partition, this is accomplished by increasing the task - #count to a multiple of 32 - if [[ ${PARTITION_BATCH} = "s4" ]]; then - export npe_anal=416 - export npe_anal_gfs=416 - fi - #S4 is small, so run this task with just 1 thread - export nth_anal=1 - export nth_anal_gfs=1 - export wtime_anal="02:00:00" - fi ;; "C192" | "C96" | "C48") - export npe_anal=84 + export npe_anal_gdas=84 export npe_anal_gfs=84 - if [[ ${machine} == "S4" ]]; then - export nth_anal=4 - export nth_anal_gfs=4 - #Adjust job count for S4 - if [[ ${PARTITION_BATCH} == "s4" ]]; then - export npe_anal=88 - export npe_anal_gfs=88 - elif [[ ${PARTITION_BATCH} == "ivy" ]]; then - export npe_anal=90 - export npe_anal_gfs=90 - fi - fi + export nth_anal=5 ;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" exit 4 ;; esac @@ -593,18 +652,31 @@ case ${step} in export nth_cycle=${nth_anal} export npe_node_cycle=$(( npe_node_max / nth_cycle )) export is_exclusive=True + + var_npe="npe_anal_${RUN}" + if [[ -n "${!var_npe+0}" ]]; then + declare -x "npe_anal"="${!var_npe}" + fi ;; "analcalc") - export wtime_analcalc="00:10:00" + export wtime_analcalc="00:15:00" export npe_analcalc=127 export ntasks="${npe_analcalc}" export nth_analcalc=1 - export nth_echgres=4 - export nth_echgres_gfs=12 export npe_node_analcalc=$(( npe_node_max / nth_analcalc )) + export nth_echgres_gdas=4 + export nth_echgres_gfs=12 export is_exclusive=True export memory_analcalc="48GB" + if [[ "${CASE}" == "C384" || "${CASE}" == "C768" ]]; then + export memory_analcalc="${mem_node_max}" + fi + + var_nth="nth_echgres_${RUN}" + if [[ -n "${!var_nth+0}" ]]; then + declare -x "nth_echgres"="${!var_nth}" + fi ;; "analdiag") @@ -643,6 +715,18 @@ case ${step} in ntasks_quilt=${ntasks_quilt_gfs} nthreads_fv3=${nthreads_fv3_gfs} nthreads_ufs=${nthreads_ufs_gfs} + # Will not be set if we are skipping the mediator + nthreads_mediator=${nthreads_mediator_gfs:-} + elif [[ "${_CDUMP}" =~ "gdas" ]]; then + export layout_x=${layout_x_gdas} + export layout_y=${layout_y_gdas} + export WRITE_GROUP=${WRITE_GROUP_GDAS} + export WRTTASK_PER_GROUP_PER_THREAD=${WRTTASK_PER_GROUP_PER_THREAD_GDAS} + ntasks_fv3=${ntasks_fv3_gdas} + ntasks_quilt=${ntasks_quilt_gdas} + nthreads_fv3=${nthreads_fv3_gdas} + nthreads_ufs=${nthreads_ufs_gdas} + nthreads_mediator=${nthreads_mediator_gdas:-} fi # Determine if using ESMF-managed threading or traditional threading @@ -737,37 +821,45 @@ case ${step} in echo "Total PETS for ${_CDUMP} = ${NTASKS_TOT}" - if [[ "${_CDUMP}" =~ "gfs" ]]; then - declare -x "npe_${step}_gfs"="${NTASKS_TOT}" - declare -x "nth_${step}_gfs"="${UFS_THREADS}" - declare -x "npe_node_${step}_gfs"="${npe_node_max}" - else - declare -x "npe_${step}"="${NTASKS_TOT}" - declare -x "nth_${step}"="${UFS_THREADS}" - declare -x "npe_node_${step}"="${npe_node_max}" - fi + declare -x "npe_${step}_${_CDUMP}"="${NTASKS_TOT}" + declare -x "nth_${step}_${_CDUMP}"="${UFS_THREADS}" + declare -x "npe_node_${step}_${_CDUMP}"="${npe_node_max}" done case "${CASE}" in "C48" | "C96" | "C192") - declare -x "wtime_${step}"="00:20:00" + declare -x "wtime_${step}_gdas"="00:20:00" + declare -x "wtime_${step}_enkfgdas"="00:20:00" declare -x "wtime_${step}_gfs"="03:00:00" + declare -x "wtime_${step}_enkfgfs"="00:20:00" ;; "C384") - declare -x "wtime_${step}"="00:30:00" + declare -x "wtime_${step}_gdas"="00:30:00" + declare -x "wtime_${step}_enkfgdas"="00:30:00" declare -x "wtime_${step}_gfs"="06:00:00" + declare -x "wtime_${step}_enkfgfs"="00:30:00" ;; "C768" | "C1152") - declare -x "wtime_${step}"="00:30:00" + # Not valid resolutions for ensembles + declare -x "wtime_${step}_gdas"="00:40:00" declare -x "wtime_${step}_gfs"="06:00:00" ;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" exit 4 ;; esac + var_npe_node="npe_node_${step}_${RUN}" + var_nth="nth_${step}_${RUN}" + var_npe="npe_${step}_${RUN}" + if [[ -n "${!var_npe_node+0}" ]]; then + declare -x "npe_node_${step}"="${!var_npe_node}" \ + "nth_${step}"="${!var_nth}" \ + "npe_${step}"="${!var_npe}" + fi + unset _CDUMP _CDUMP_LIST unset NTASKS_TOT ;; @@ -785,21 +877,15 @@ case ${step} in "C48" | "C96") export npe_upp=${CASE:1} ;; - "C192" | "C384") + "C192" | "C384" | "C768" ) export npe_upp=120 - export memory_upp="96GB" - ;; - "C768") - export npe_upp=120 - export memory_upp="96GB" - if [[ ${machine} == "WCOSS2" ]]; then export memory_upp="480GB" ; fi + export memory_upp="${mem_node_max}" ;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" exit 4 ;; esac - if [[ ${machine} == "JET" ]]; then unset memory_upp ; fi export npe_node_upp=${npe_upp} export nth_upp=1 @@ -816,10 +902,6 @@ case ${step} in export npe_atmos_products=24 export nth_atmos_products=1 export npe_node_atmos_products="${npe_atmos_products}" - export wtime_atmos_products_gfs="${wtime_atmos_products}" - export npe_atmos_products_gfs="${npe_atmos_products}" - export nth_atmos_products_gfs="${nth_atmos_products}" - export npe_node_atmos_products_gfs="${npe_node_atmos_products}" export is_exclusive=True ;; @@ -844,10 +926,6 @@ case ${step} in export npe_vminmon=1 export nth_vminmon=1 export npe_node_vminmon=1 - export wtime_vminmon_gfs="00:05:00" - export npe_vminmon_gfs=1 - export nth_vminmon_gfs=1 - export npe_node_vminmon_gfs=1 export memory_vminmon="1G" ;; @@ -881,17 +959,14 @@ case ${step} in export nth_fit2obs=1 export npe_node_fit2obs=1 export memory_fit2obs="20G" - if [[ ${machine} == "WCOSS2" ]]; then export npe_node_fit2obs=3 ; fi ;; "metp") export nth_metp=1 - export wtime_metp="03:00:00" + export wtime_metp_gdas="03:00:00" + export wtime_metp_gfs="06:00:00" export npe_metp=4 export npe_node_metp=4 - export wtime_metp_gfs="06:00:00" - export npe_metp_gfs=4 - export npe_node_metp_gfs=4 export is_exclusive=True ;; @@ -900,9 +975,6 @@ case ${step} in export npe_echgres=3 export nth_echgres=${npe_node_max} export npe_node_echgres=1 - if [[ "${machine}" == "WCOSS2" ]]; then - export memory_echgres="200GB" - fi ;; "init") @@ -933,9 +1005,6 @@ case ${step} in declare -x "npe_node_${step}"="1" declare -x "nth_${step}"="1" declare -x "memory_${step}"="4096M" - if [[ "${machine}" == "WCOSS2" ]]; then - declare -x "memory_${step}"="50GB" - fi ;; "cleanup") @@ -970,13 +1039,25 @@ case ${step} in export layout_y=${layout_y_atmensanl} export wtime_atmensanlletkf="00:30:00" - export npe_atmensanlletkf=$(( layout_x * layout_y * 6 )) - export npe_atmensanlletkf_gfs=$(( layout_x * layout_y * 6 )) - export nth_atmensanlletkf=1 - export nth_atmensanlletkf_gfs=${nth_atmensanlletkf} - export npe_node_atmensanlletkf=$(( npe_node_max / nth_atmensanlletkf )) + export npe_atmensanlletkf_enkfgdas=$(( layout_x * layout_y * 6 )) + export npe_atmensanlletkf_enkfgfs=$(( layout_x * layout_y * 6 )) + export nth_atmensanlletkf_enkfgdas=1 + export nth_atmensanlletkf_enkfgfs=${nth_atmensanlletkf_enkfgdas} + export npe_node_atmensanlletkf_enkfgdas=$(( npe_node_max / nth_atmensanlletkf_enkfgdas )) + export npe_node_atmensanlletkf_enkfgfs=$(( npe_node_max / nth_atmensanlletkf_enkfgfs )) export memory_atmensanlletkf="96GB" export is_exclusive=True + + var_npe_node="npe_node_atmensanlletkf_${RUN}" + var_nth="nth_atmensanlletkf_${RUN}" + var_npe="npe_atmensanlletkf_${RUN}" + # RUN is set to a single value at setup time, so these won't be found + # TODO rework setup_xml.py to initialize RUN to the applicable option + if [[ -n "${!var_npe_node+0}" ]]; then + declare -x "npe_node_atmensanlletkf"="${!var_npe_node}" \ + "nth_atmensanlletkf"="${!var_nth}" \ + "npe_atmensanlletkf"="${!var_npe}" + fi ;; "atmensanlfv3inc") @@ -984,13 +1065,25 @@ case ${step} in export layout_y=${layout_y_atmensanl} export wtime_atmensanlfv3inc="00:30:00" - export npe_atmensanlfv3inc=$(( layout_x * layout_y * 6 )) - export npe_atmensanlfv3inc_gfs=$(( layout_x * layout_y * 6 )) - export nth_atmensanlfv3inc=1 - export nth_atmensanlfv3inc_gfs=${nth_atmensanlfv3inc} - export npe_node_atmensanlfv3inc=$(( npe_node_max / nth_atmensanlfv3inc )) + export npe_atmensanlfv3inc_enkfgdas=$(( layout_x * layout_y * 6 )) + export npe_atmensanlfv3inc_enkfgfs=$(( layout_x * layout_y * 6 )) + export nth_atmensanlfv3inc_enkfgdas=1 + export nth_atmensanlfv3inc_enkfgfs=${nth_atmensanlfv3inc_enkfgdas} + export npe_node_atmensanlfv3inc_enkfgdas=$(( npe_node_max / nth_atmensanlfv3inc_enkfgdas )) + export npe_node_atmensanlfv3inc_enkfgfs=$(( npe_node_max / nth_atmensanlfv3inc_enkfgfs )) export memory_atmensanlfv3inc="96GB" export is_exclusive=True + + var_npe_node="npe_node_atmensanlfv3inc_${RUN}" + var_nth="nth_atmensanlfv3inc_${RUN}" + var_npe="npe_atmensanlfv3inc_${RUN}" + # RUN is set to a single value at setup time, so these won't be found + # TODO rework setup_xml.py to initialize RUN to the applicable option + if [[ -n "${!var_npe_node+0}" ]]; then + declare -x "npe_node_atmensanlfv3inc"="${!var_npe_node}" \ + "nth_atmensanlfv3inc"="${!var_nth}" \ + "npe_atmensanlfv3inc"="${!var_npe}" + fi ;; "atmensanlfinal") @@ -1009,27 +1102,25 @@ case ${step} in "C384") export npe_eobs=100;; "C192" | "C96" | "C48") export npe_eobs=40;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" exit 4 ;; esac export npe_eomg=${npe_eobs} export nth_eobs=2 export nth_eomg=${nth_eobs} + # NOTE The number of tasks and cores used must be the same for eobs + # See https://github.com/NOAA-EMC/global-workflow/issues/2092 for details export npe_node_eobs=$(( npe_node_max / nth_eobs )) export is_exclusive=True - # The number of tasks and cores used must be the same for eobs - # See https://github.com/NOAA-EMC/global-workflow/issues/2092 for details - # For S4, this is accomplished by running 10 tasks/node - if [[ ${machine} = "S4" ]]; then - export npe_node_eobs=10 - elif [[ ${machine} = "HERCULES" ]]; then - # For Hercules, this is only an issue at C384; use 20 tasks/node - if [[ ${CASE} = "C384" ]]; then - export npe_node_eobs=20 - fi - fi export npe_node_eomg=${npe_node_eobs} + # Unset npe_node_eobs if it is not a multiple of npe_node_max + # to prevent dropping data on the floor. This should be set int + # config.resources.{machine} instead. This will result in an error at + # experiment setup time if not set in config.resources.{machine}. + if [[ $(( npe_node_max % npe_node_eobs )) != 0 ]]; then + unset npe_node_max + fi ;; "ediag") @@ -1046,33 +1137,17 @@ case ${step} in "C768") export npe_eupd=480 export nth_eupd=6 - if [[ "${machine}" == "WCOSS2" ]]; then - export npe_eupd=315 - export nth_eupd=14 - fi ;; "C384") export npe_eupd=270 export nth_eupd=8 - if [[ "${machine}" == "WCOSS2" ]]; then - export npe_eupd=315 - export nth_eupd=14 - elif [[ "${machine}" == "S4" ]]; then - export npe_eupd=160 - export nth_eupd=2 - elif [[ "${machine}" == "HERA" ]]; then - export npe_eupd=80 - fi ;; "C192" | "C96" | "C48") export npe_eupd=42 export nth_eupd=2 - if [[ "${machine}" == "HERA" || "${machine}" == "JET" ]]; then - export nth_eupd=4 - fi ;; *) - echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}" + echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" exit 4 ;; esac @@ -1084,7 +1159,6 @@ case ${step} in export wtime_ecen="00:10:00" export npe_ecen=80 export nth_ecen=4 - if [[ "${machine}" == "HERA" ]]; then export nth_ecen=6; fi if [[ ${CASE} == "C384" || ${CASE} == "C192" || ${CASE} == "C96" || ${CASE} == "C48" ]]; then export nth_ecen=2 fi @@ -1101,11 +1175,11 @@ case ${step} in export npe_node_esfc=$(( npe_node_max / nth_esfc )) export nth_cycle=${nth_esfc} export npe_node_cycle=$(( npe_node_max / nth_cycle )) - if [[ ${machine} != "JET" ]]; then export memory_esfc="80G" ; fi ;; "epos") export wtime_epos="00:15:00" + [[ ${CASE} == "C768" ]] && export wtime_epos="00:25:00" export npe_epos=80 export nth_epos=1 export npe_node_epos=$(( npe_node_max / nth_epos )) @@ -1144,13 +1218,22 @@ case ${step} in "gempak") export wtime_gempak="03:00:00" - export npe_gempak=2 + export npe_gempak_gdas=2 export npe_gempak_gfs=28 - export npe_node_gempak=2 + export npe_node_gempak_gdas=2 export npe_node_gempak_gfs=28 export nth_gempak=1 - export memory_gempak="4GB" + export memory_gempak_gdas="4GB" export memory_gempak_gfs="2GB" + + var_npe_node="npe_node_gempak_${RUN}" + var_npe="npe_gempak_${RUN}" + # RUN is set to a single value at setup time, so these won't be found + # TODO rework setup_xml.py to initialize RUN to the applicable option + if [[ -n "${!var_npe_node+0}" ]]; then + declare -x "npe_node_gempak"="${!var_npe_node}" \ + "npe_gempak"="${!var_npe}" + fi ;; "mos_stn_prep") @@ -1307,4 +1390,15 @@ case ${step} in esac +# Unset dynamic variable names +unset var_NTASKS \ + var_npe \ + var_npe_node \ + var_nth + +# Get machine-specific resources, overriding/extending the above assignments +if [[ -f "${EXPDIR}/config.resources.${machine}" ]]; then + source "${EXPDIR}/config.resources.${machine}" +fi + echo "END: config.resources" diff --git a/parm/config/gfs/config.resources.GAEA b/parm/config/gfs/config.resources.GAEA new file mode 100644 index 0000000000..64990b299f --- /dev/null +++ b/parm/config/gfs/config.resources.GAEA @@ -0,0 +1,22 @@ +#! /usr/bin/env bash + +# Gaea-specific job resources + +case ${step} in + "eobs") + # The number of tasks and cores used must be the same for eobs + # See https://github.com/NOAA-EMC/global-workflow/issues/2092 for details + case ${CASE} in + "C768" | "C384") + export npe_node_eobs=50 + ;; + *) + export npe_node_eobs=40 + ;; + esac + ;; + + *) + ;; + +esac diff --git a/parm/config/gfs/config.resources.HERA b/parm/config/gfs/config.resources.HERA new file mode 100644 index 0000000000..cfd614961d --- /dev/null +++ b/parm/config/gfs/config.resources.HERA @@ -0,0 +1,36 @@ +#! /usr/bin/env bash + +# Hera-specific job resources + +case ${step} in + "anal") + if [[ "${CASE}" == "C384" ]]; then + export npe_anal_gdas=270 + export npe_anal_gfs=270 + export nth_anal=8 + export npe_node_anal=$(( npe_node_max / nth_anal )) + fi + ;; + + "eupd") + case ${CASE} in + "C384") + export npe_eupd=80 + ;; + "C192" | "C96" | "C48") + export nth_eupd=4 + ;; + *) + ;; + esac + export npe_node_eupd=$(( npe_node_max / nth_eupd )) + ;; + + "ecen") + if [[ "${CASE}" == "C768" ]]; then export nth_ecen=6; fi + export npe_node_ecen=$(( npe_node_max / nth_ecen )) + ;; + + *) + ;; +esac diff --git a/parm/config/gfs/config.resources.HERCULES b/parm/config/gfs/config.resources.HERCULES new file mode 100644 index 0000000000..7d2ca646e6 --- /dev/null +++ b/parm/config/gfs/config.resources.HERCULES @@ -0,0 +1,17 @@ +#! /usr/bin/env bash + +# Hercules-specific job resources + +case ${step} in + "eobs" | "eomg") + # The number of tasks and cores used must be the same for eobs + # See https://github.com/NOAA-EMC/global-workflow/issues/2092 for details + # For Hercules, this is only an issue at C384; use 20 tasks/node + if [[ ${CASE} = "C384" ]]; then + export npe_node_eobs=20 + fi + export npe_node_eomg=${npe_node_eobs} + ;; + *) + ;; +esac diff --git a/parm/config/gfs/config.resources.JET b/parm/config/gfs/config.resources.JET new file mode 100644 index 0000000000..de2ec6547a --- /dev/null +++ b/parm/config/gfs/config.resources.JET @@ -0,0 +1,53 @@ +#! /usr/bin/env bash + +# Jet-specific job resources + +case ${step} in + "anal") + if [[ "${CASE}" == "C384" ]]; then + export npe_anal_gdas=270 + export npe_anal_gfs=270 + export nth_anal=8 + export npe_node_anal=$(( npe_node_max / nth_anal )) + fi + ;; + + "eobs") + if [[ "${PARTITION_BATCH}" == "xjet" ]]; then + # The number of tasks and cores used must be the same for eobs + # See https://github.com/NOAA-EMC/global-workflow/issues/2092 for details + # This would also be an issues for vjet and sjet if anyone runs on those nodes. + export npe_node_eobs=10 + fi + ;; + + "eupd") + case ${CASE} in + "C384") + export npe_eupd=80 + ;; + "C192" | "C96" | "C48") + export nth_eupd=4 + ;; + *) + ;; + esac + export npe_node_eupd=$(( npe_node_max / nth_eupd )) + ;; + + "ecen") + if [[ "${CASE}" == "C768" ]]; then export nth_ecen=6; fi + export npe_node_ecen=$(( npe_node_max / nth_ecen )) + ;; + + "upp") + export memory_upp="${mem_node_max}" + ;; + + "esfc") + export memory_esfc="${mem_node_max}" + ;; + + *) + ;; +esac diff --git a/parm/config/gfs/config.resources.S4 b/parm/config/gfs/config.resources.S4 new file mode 100644 index 0000000000..3f6654f8d6 --- /dev/null +++ b/parm/config/gfs/config.resources.S4 @@ -0,0 +1,59 @@ +#! /usr/bin/env bash + +# S4-specific job resources + +case ${step} in + "anal") + case ${CASE} in + "C384") + #Some of the intermediate data can be lost if the number of tasks + #per node does not match the number of reserved cores/node. + #On the S4-s4 partition, this is accomplished by increasing the task + #count to a multiple of 32 + if [[ ${PARTITION_BATCH} = "s4" ]]; then + export npe_anal_gdas=416 + export npe_anal_gfs=416 + fi + #S4 is small, so run this task with just 1 thread + export nth_anal=1 + export wtime_anal_gdas="02:00:00" + export wtime_anal_gfs="02:00:00" + ;; + "C192" | "C96" | "C48") + export nth_anal=4 + if [[ ${PARTITION_BATCH} == "s4" ]]; then + export npe_anal_gdas=88 + export npe_anal_gfs=88 + elif [[ ${PARTITION_BATCH} == "ivy" ]]; then + export npe_anal_gdas=90 + export npe_anal_gfs=90 + fi + ;; + *) + ;; + esac + export npe_node_anal=$(( npe_node_max / nth_anal )) + ;; + + "eobs") + # The number of tasks and cores used must be the same for eobs + # See https://github.com/NOAA-EMC/global-workflow/issues/2092 for details + # For S4, this is accomplished by running 10 tasks/node + export npe_node_eobs=10 + ;; + + "eupd") + if [[ "${CASE}" == "C384" ]]; then + export npe_eupd=160 + export nth_eupd=2 + fi + export npe_node_eupd=$(( npe_node_max / nth_eupd )) + ;; + + "ediag") + export memory_ediag="${mem_node_max}" + ;; + + *) + ;; +esac diff --git a/parm/config/gfs/config.resources.WCOSS2 b/parm/config/gfs/config.resources.WCOSS2 new file mode 100644 index 0000000000..7e4314a0e9 --- /dev/null +++ b/parm/config/gfs/config.resources.WCOSS2 @@ -0,0 +1,59 @@ +#! /usr/bin/env bash + +# WCOSS2-specific job resources + +case ${step} in + "prep") + export is_exclusive=True + export memory_prep="480GB" + ;; + + "anal") + if [[ "${CASE}" == "C768" ]]; then + export nth_anal=8 + # Make npe a multiple of 16 + export npe_anal_gdas=784 + export npe_anal_gfs=832 + export npe_node_anal=$(( npe_node_max / nth_anal )) + fi + ;; + + "fit2obs") + export npe_node_fit2obs=3 + ;; + + "echgres") + export memory_echgres="200GB" + ;; + + "arch" | "earc" | "getic") + declare -x "memory_${step}"="50GB" + ;; + + "eupd") + case ${CASE} in + "C768" | "C384") + export npe_eupd=315 + export nth_eupd=14 + ;; + *) + ;; + esac + export npe_node_eupd=$(( npe_node_max / nth_eupd )) + ;; + + "eobs") + case ${CASE} in + "C768" | "C384") + export npe_node_eobs=50 + ;; + *) + export npe_node_eobs=40 + ;; + esac + ;; + + *) + ;; + +esac diff --git a/parm/config/gfs/config.ufs b/parm/config/gfs/config.ufs index 9f6c47ce72..b87435cfef 100644 --- a/parm/config/gfs/config.ufs +++ b/parm/config/gfs/config.ufs @@ -88,16 +88,16 @@ fi case "${fv3_res}" in "C48") export DELTIM=1200 - export layout_x=1 - export layout_y=1 + export layout_x_gdas=1 + export layout_y_gdas=1 export layout_x_gfs=1 export layout_y_gfs=1 - export nthreads_fv3=1 + export nthreads_fv3_gdas=1 export nthreads_fv3_gfs=1 - export nthreads_ufs=1 + export nthreads_ufs_gdas=1 export nthreads_ufs_gfs=1 - export xr_cnvcld=".false." # Do not pass conv. clouds to Xu-Randall cloud fraction - export cdmbgwd="0.071,2.1,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling + export xr_cnvcld=".false." # Do not pass conv. clouds to Xu-Randall cloud fraction + export cdmbgwd="0.071,2.1,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling export cdmbgwd_gsl="40.0,1.77,1.0,1.0" # settings for GSL drag suite export knob_ugwp_tauamp=6.0e-3 # setting for UGWPv1 non-stationary GWD export k_split=1 @@ -105,8 +105,8 @@ case "${fv3_res}" in export tau=10.0 export rf_cutoff=100.0 export fv_sg_adj=3600 - export WRITE_GROUP=1 - export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 + export WRITE_GROUP_GDAS=1 + export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=1 export WRITE_GROUP_GFS=1 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=1 ;; @@ -124,22 +124,22 @@ case "${fv3_res}" in export npy_nest=241 export NEST_DLON=0.25 export NEST_DLAT=0.25 - export WRITE_GROUP=2 - export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=2 + export WRITE_GROUP_GDAS=2 + export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=2 export WRITE_GROUP_GFS=2 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=2 else export DELTIM=600 - export layout_x=2 - export layout_y=2 + export layout_x_gdas=2 + export layout_y_gdas=2 export layout_x_gfs=2 export layout_y_gfs=2 - export nthreads_fv3=1 + export nthreads_fv3_gdas=1 export nthreads_fv3_gfs=1 - export nthreads_ufs=1 + export nthreads_ufs_gdas=1 export nthreads_ufs_gfs=1 - export xr_cnvcld=.false. # Do not pass conv. clouds to Xu-Randall cloud fraction - export cdmbgwd="0.14,1.8,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling + export xr_cnvcld=.false. # Do not pass conv. clouds to Xu-Randall cloud fraction + export cdmbgwd="0.14,1.8,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling export cdmbgwd_gsl="20.0,2.5,1.0,1.0" # settings for GSL drag suite export knob_ugwp_tauamp=3.0e-3 # setting for UGWPv1 non-stationary GWD export k_split=1 @@ -147,8 +147,8 @@ case "${fv3_res}" in export tau=8.0 export rf_cutoff=100.0 export fv_sg_adj=1800 - export WRITE_GROUP=1 - export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 + export WRITE_GROUP_GDAS=1 + export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=1 export WRITE_GROUP_GFS=1 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=1 fi @@ -167,19 +167,19 @@ case "${fv3_res}" in export npy_nest=481 export NEST_DLON=0.125 export NEST_DLAT=0.125 - export WRITE_GROUP=2 - export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=15 + export WRITE_GROUP_GDAS=2 + export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=15 export WRITE_GROUP_GFS=2 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=15 else export DELTIM=600 - export layout_x=4 - export layout_y=6 + export layout_x_gdas=4 + export layout_y_gdas=6 export layout_x_gfs=4 export layout_y_gfs=6 - export nthreads_fv3=1 + export nthreads_fv3_gdas=1 export nthreads_fv3_gfs=2 - export nthreads_ufs=1 + export nthreads_ufs_gdas=1 export nthreads_ufs_gfs=2 export cdmbgwd="0.23,1.5,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling export cdmbgwd_gsl="10.0,3.5,1.0,1.0" # settings for GSL drag suite @@ -189,8 +189,8 @@ case "${fv3_res}" in export tau=6.0 export rf_cutoff=100.0 export fv_sg_adj=1800 - export WRITE_GROUP=1 - export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 + export WRITE_GROUP_GDAS=1 + export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=10 export WRITE_GROUP_GFS=2 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=5 fi @@ -198,8 +198,8 @@ case "${fv3_res}" in "C384") if [[ "${DO_NEST:-NO}" == "YES" ]] ; then export DELTIM=150 - export layout_x=8 - export layout_y=8 + export layout_x_gdas=8 + export layout_y_gdas=8 export layout_x_gfs=8 export layout_y_gfs=8 export layout_x_nest=34 @@ -211,19 +211,19 @@ case "${fv3_res}" in export npy_nest=961 export NEST_DLON=0.0625 export NEST_DLAT=0.0625 - export WRITE_GROUP=2 - export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=20 + export WRITE_GROUP_GDAS=2 + export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=20 export WRITE_GROUP_GFS=2 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=20 else export DELTIM=300 - export layout_x=8 - export layout_y=8 + export layout_x_gdas=8 + export layout_y_gdas=8 export layout_x_gfs=8 export layout_y_gfs=8 - export nthreads_fv3=2 + export nthreads_fv3_gdas=2 export nthreads_fv3_gfs=2 - export nthreads_ufs=2 + export nthreads_ufs_gdas=2 export nthreads_ufs_gfs=2 export cdmbgwd="1.1,0.72,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling export cdmbgwd_gsl="5.0,5.0,1.0,1.0" # settings for GSL drag suite @@ -233,8 +233,8 @@ case "${fv3_res}" in export tau=4.0 export rf_cutoff=100.0 export fv_sg_adj=900 - export WRITE_GROUP=4 - export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 + export WRITE_GROUP_GDAS=4 + export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=10 export WRITE_GROUP_GFS=4 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=10 fi @@ -242,13 +242,14 @@ case "${fv3_res}" in "C768") if [[ "${DO_NEST:-NO}" == "YES" ]] ; then export DELTIM=75 - export layout_x=16 - export layout_y=10 + export layout_x_gdas=16 + export layout_y_gdas=10 export layout_x_gfs=16 export layout_y_gfs=10 export layout_x_nest=48 export layout_y_nest=45 - export nthreads_fv3=2 + export nthreads_fv3_nest=2 + export nthreads_fv3_gdas=2 export nthreads_fv3_gfs=2 export nest_refine=4 export nest_ioffset=24 @@ -257,19 +258,19 @@ case "${fv3_res}" in export npy_nest=1921 export NEST_DLON=0.0325 export NEST_DLAT=0.0325 - export WRITE_GROUP=2 - export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=90 + export WRITE_GROUP_GDAS=2 + export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=90 export WRITE_GROUP_GFS=2 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=90 else export DELTIM=150 - export layout_x=8 - export layout_y=12 + export layout_x_gdas=8 + export layout_y_gdas=12 export layout_x_gfs=12 export layout_y_gfs=16 - export nthreads_fv3=4 + export nthreads_fv3_gdas=4 export nthreads_fv3_gfs=4 - export nthreads_ufs=4 + export nthreads_ufs_gdas=4 export nthreads_ufs_gfs=4 export cdmbgwd="4.0,0.15,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling export cdmbgwd_gsl="2.5,7.5,1.0,1.0" # settings for GSL drag suite @@ -279,21 +280,21 @@ case "${fv3_res}" in export tau=3.0 export rf_cutoff=100.0 export fv_sg_adj=450 - export WRITE_GROUP=2 - export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 + export WRITE_GROUP_GDAS=2 + export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=10 export WRITE_GROUP_GFS=4 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=20 #Note this should be 10 for WCOSS2 fi ;; "C1152") export DELTIM=150 - export layout_x=8 - export layout_y=16 + export layout_x_gdas=8 + export layout_y_gdas=16 export layout_x_gfs=8 export layout_y_gfs=16 - export nthreads_fv3=4 + export nthreads_fv3_gdas=4 export nthreads_fv3_gfs=4 - export nthreads_ufs=4 + export nthreads_ufs_gdas=4 export nthreads_ufs_gfs=4 export cdmbgwd="4.0,0.10,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling export cdmbgwd_gsl="1.67,8.8,1.0,1.0" # settings for GSL drag suite @@ -303,20 +304,20 @@ case "${fv3_res}" in export tau=2.5 export rf_cutoff=100.0 export fv_sg_adj=450 - export WRITE_GROUP=4 - export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 # TODO: refine these numbers when a case is available + export WRITE_GROUP_GDAS=4 + export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=10 # TODO: refine these numbers when a case is available export WRITE_GROUP_GFS=4 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=20 # TODO: refine these numbers when a case is available ;; "C3072") export DELTIM=90 export layout_x=16 - export layout_y=32 - export layout_x_gfs=16 + export layout_y_gdas=32 + export layout_x_gfs_gdas=16 export layout_y_gfs=32 - export nthreads_fv3=4 + export nthreads_fv3_gdas=4 export nthreads_fv3_gfs=4 - export nthreads_ufs=4 + export nthreads_ufs_gdas=4 export nthreads_ufs_gfs=4 export cdmbgwd="4.0,0.05,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling export cdmbgwd_gsl="0.625,14.1,1.0,1.0" # settings for GSL drag suite @@ -326,8 +327,8 @@ case "${fv3_res}" in export tau=0.5 export rf_cutoff=100.0 export fv_sg_adj=300 - export WRITE_GROUP=4 - export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 # TODO: refine these numbers when a case is available + export WRITE_GROUP_GDAS=4 + export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=10 # TODO: refine these numbers when a case is available export WRITE_GROUP_GFS=4 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=10 # TODO: refine these numbers when a case is available ;; @@ -337,22 +338,22 @@ case "${fv3_res}" in ;; esac -(( WRTTASK_PER_GROUP_PER_THREAD = WRTTASK_PER_GROUP_PER_THREAD_PER_TILE * 6 )) +(( WRTTASK_PER_GROUP_PER_THREAD_GDAS = WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS * 6 )) (( WRTTASK_PER_GROUP_PER_THREAD_GFS = WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS * 6 )) -export WRTTASK_PER_GROUP_PER_THREAD +export WRTTASK_PER_GROUP_PER_THREAD_GDAS export WRTTASK_PER_GROUP_PER_THREAD_GFS -(( ntasks_fv3 = layout_x * layout_y * 6 )) +(( ntasks_fv3_gdas = layout_x_gdas * layout_y_gdas * 6 )) (( ntasks_fv3_gfs = layout_x_gfs * layout_y_gfs * 6 )) if [[ "${DO_NEST:-NO}" == "YES" ]] ; then (( ntasks_fv3_gfs += layout_x_nest * layout_y_nest )) fi -export ntasks_fv3 +export ntasks_fv3_gdas export ntasks_fv3_gfs -(( ntasks_quilt = WRITE_GROUP * WRTTASK_PER_GROUP_PER_THREAD )) +(( ntasks_quilt_gdas = WRITE_GROUP_GDAS * WRTTASK_PER_GROUP_PER_THREAD_GDAS )) (( ntasks_quilt_gfs = WRITE_GROUP_GFS * WRTTASK_PER_GROUP_PER_THREAD_GFS )) -export ntasks_quilt +export ntasks_quilt_gdas export ntasks_quilt_gfs # Determine whether to use parallel NetCDF based on resolution @@ -389,7 +390,8 @@ model_list="atm" # Mediator specific settings if [[ "${skip_mediator}" == "false" ]]; then export cpl=".true." - export nthreads_mediator=${nthreads_fv3} # Use same threads as FV3 + export nthreads_mediator_gfs=${nthreads_fv3_gfs} # Use same threads as FV3 + export nthreads_mediator_gdas=${nthreads_fv3_gdas} export CCPP_SUITE="FV3_GFS_v17_coupled_p8_ugwpv1" # TODO: Does this include FV3_GFS_v17_p8? Can this be used instead of FV3_GFS_v17_p8? fi diff --git a/ush/forecast_postdet.sh b/ush/forecast_postdet.sh index 2cc34eaacd..993331d70b 100755 --- a/ush/forecast_postdet.sh +++ b/ush/forecast_postdet.sh @@ -268,20 +268,23 @@ FV3_out() { fi fi - # Get list of FV3 restart files - local file_list fv3_file - file_list=$(FV3_restarts) + ### Check that there are restart files to copy + if [[ ${#restart_dates[@]} -gt 0 ]]; then + # Get list of FV3 restart files + local file_list fv3_file + file_list=$(FV3_restarts) - # Copy restarts for the dates collected above to COM - for restart_date in "${restart_dates[@]}"; do - echo "Copying FV3 restarts for 'RUN=${RUN}' at ${restart_date}" - for fv3_file in ${file_list}; do - ${NCP} "${DATArestart}/FV3_RESTART/${restart_date}.${fv3_file}" \ - "${COMOUT_ATMOS_RESTART}/${restart_date}.${fv3_file}" + # Copy restarts for the dates collected above to COM + for restart_date in "${restart_dates[@]}"; do + echo "Copying FV3 restarts for 'RUN=${RUN}' at ${restart_date}" + for fv3_file in ${file_list}; do + ${NCP} "${DATArestart}/FV3_RESTART/${restart_date}.${fv3_file}" \ + "${COMOUT_ATMOS_RESTART}/${restart_date}.${fv3_file}" + done done - done - echo "SUB ${FUNCNAME[0]}: Output data for FV3 copied" + echo "SUB ${FUNCNAME[0]}: Output data for FV3 copied" + fi } # Disable variable not used warnings diff --git a/workflow/rocoto/tasks.py b/workflow/rocoto/tasks.py index ad135be713..a126992cee 100644 --- a/workflow/rocoto/tasks.py +++ b/workflow/rocoto/tasks.py @@ -178,25 +178,34 @@ def get_resource(self, task_name): account = task_config['ACCOUNT_SERVICE'] if task_name in Tasks.SERVICE_TASKS else task_config['ACCOUNT'] - walltime = task_config[f'wtime_{task_name}'] - if self.cdump in ['gfs'] and f'wtime_{task_name}_gfs' in task_config.keys(): - walltime = task_config[f'wtime_{task_name}_gfs'] + if f'wtime_{task_name}_{self.cdump}' in task_config: + walltime = task_config[f'wtime_{task_name}_{self.cdump}'] + else: + walltime = task_config[f'wtime_{task_name}'] - cores = task_config[f'npe_{task_name}'] - if self.cdump in ['gfs'] and f'npe_{task_name}_gfs' in task_config.keys(): - cores = task_config[f'npe_{task_name}_gfs'] + if f'npe_{task_name}_{self.cdump}' in task_config: + cores = task_config[f'npe_{task_name}_{self.cdump}'] + else: + cores = task_config[f'npe_{task_name}'] - ppn = task_config[f'npe_node_{task_name}'] - if self.cdump in ['gfs'] and f'npe_node_{task_name}_gfs' in task_config.keys(): - ppn = task_config[f'npe_node_{task_name}_gfs'] + if f'npe_node_{task_name}_{self.cdump}' in task_config: + ppn = task_config[f'npe_node_{task_name}_{self.cdump}'] + else: + ppn = task_config[f'npe_node_{task_name}'] nodes = int(np.ceil(float(cores) / float(ppn))) - threads = task_config[f'nth_{task_name}'] - if self.cdump in ['gfs'] and f'nth_{task_name}_gfs' in task_config.keys(): - threads = task_config[f'nth_{task_name}_gfs'] + if f'nth_{task_name}_{self.cdump}' in task_config: + threads = task_config[f'nth_{task_name}_{self.cdump}'] + else: + threads = task_config[f'nth_{task_name}'] + + if f'memory_{task_name}_{self.cdump}' in task_config: + memory = task_config[f'memory_{task_name}_{self.cdump}'] + else: + # Memory is not required + memory = task_config.get(f'memory_{task_name}', None) - memory = task_config.get(f'memory_{task_name}', None) if scheduler in ['pbspro']: if task_config.get('prepost', False): memory += ':prepost=true'