Skip to content

Commit

Permalink
Add ocnanalbmat (NOAA-EMC#1286)
Browse files Browse the repository at this point in the history
This adds the ocnanalbmat task to S2S workflow between ocnanalprep and ocnanalrun.

At present this is a stub task that does not actually run the associated jjob, pending more extensive testing

Partially addresses NOAA-EMC/GDASApp#263
  • Loading branch information
AndrewEichmann-NOAA committed Jan 31, 2023
1 parent 807b529 commit 32b2169
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 6 deletions.
12 changes: 11 additions & 1 deletion env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,17 @@ elif [[ "${step}" = "aeroanlrun" ]]; then
[[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max}
export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}"

elif [ ${step} = "ocnanalrun" ]; then
elif [[ "${step}" = "ocnanalbmat" ]]; then

export APRUNCFP="${launcher} -n \$ncmd --multi-prog"

nth_max=$((npe_node_max / npe_node_ocnanalbmat))

export NTHREADS_OCNANAL=${nth_ocnanalbmat:-${nth_max}}
[[ ${NTHREADS_OCNANAL} -gt ${nth_max} ]] && export NTHREADS_OCNANAL=${nth_max}
export APRUN_OCNANAL="${launcher} -n ${npe_ocnanalbmat}"

elif [[ "${step}" = "ocnanalrun" ]]; then

export APRUNCFP="${launcher} -n \$ncmd --multi-prog"

Expand Down
14 changes: 12 additions & 2 deletions env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,24 @@ elif [[ "${step}" = "aeroanlrun" ]]; then
[[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max}
export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}"

elif [ ${step} = "ocnanalrun" ]; then
elif [[ "${step}" = "ocnanalbmat" ]]; then

export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"

nth_max=$((npe_node_max / npe_node_ocnanalbmat))

export NTHREADS_OCNANAL=${nth_ocnanalbmat:-${nth_max}}
[[ ${NTHREADS_OCNANAL} -gt ${nth_max} ]] && export NTHREADS_OCNANAL=${nth_max}
export APRUN_OCNANAL="${launcher} -n ${npe_ocnanalbmat}"

elif [[ "${step}" = "ocnanalrun" ]]; then

export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"

nth_max=$((npe_node_max / npe_node_ocnanalrun))

export NTHREADS_OCNANAL=${nth_ocnanalrun:-${nth_max}}
[[ $NTHREADS_OCNANAL -gt ${nth_max} ]] && export NTHREADS_OCNANAL=${nth_max}
[[ ${NTHREADS_OCNANAL} -gt ${nth_max} ]] && export NTHREADS_OCNANAL=${nth_max}
export APRUN_OCNANAL="${launcher} -n ${npe_ocnanalrun}"

elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then
Expand Down
19 changes: 19 additions & 0 deletions jobs/rocoto/ocnanalbmat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"

###############################################################
# Source UFSDA workflow modules
. "${HOMEgfs}/ush/load_ufsda_modules.sh"
status=$?
[[ "${status}" -ne 0 ]] && exit "${status}"

export job="ocnanalbmat"
export jobid="${job}.$$"

###############################################################
# Execute the JJOB
#"${HOMEgfs}"/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_BMAT
echo "BMAT gets run here"
status=$?
exit "${status}"
11 changes: 11 additions & 0 deletions parm/config/config.ocnanalbmat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

########## config.ocnanalbmat ##########
# Ocn Analysis specific

echo "BEGIN: config.ocnanalbmat"

# Get task specific resources
. "${EXPDIR}/config.resources" ocnanalbmat

echo "END: config.ocnanalbmat"
23 changes: 22 additions & 1 deletion parm/config/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,27 @@ elif [[ "${step}" = "ocnanalprep" ]]; then
export npe_node_ocnanalprep
export memory_ocnanalprep="3072M"

elif [[ "${step}" = "ocnanalbmat" ]]; then
npes=16
case ${CASE} in
C384)
npes=480
;;
C48)
npes=16
;;
*)
echo "FATAL: Resolution not supported'"
exit 1
esac

export wtime_ocnanalbmat="00:30:00"
export npe_ocnanalbmat=${npes}
export nth_ocnanalbmat=1
export is_exclusive=True
npe_node_ocnanalbmat=$(echo "${npe_node_max} / ${nth_ocnanalbmat}" | bc)
export npe_node_ocnanalbmat

elif [[ "${step}" = "ocnanalrun" ]]; then
npes=16
case ${CASE} in
Expand All @@ -266,7 +287,7 @@ elif [[ "${step}" = "ocnanalrun" ]]; then
export wtime_ocnanalrun="00:30:00"
export npe_ocnanalrun=${npes}
export nth_ocnanalrun=1
export native_ocnanalrun="--exclusive"
export is_exclusive=True
npe_node_ocnanalrun=$(echo "${npe_node_max} / ${nth_ocnanalrun}" | bc)
export npe_node_ocnanalrun

Expand Down
8 changes: 8 additions & 0 deletions workflow/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ def _cycled_configs(self):
else:
configs += ['anal', 'analdiag']

if self.do_jediocnvar:
configs += ['ocnanalprep', 'ocnanalbmat', 'ocnanalrun', 'ocnanalpost']
configs += ['ocnpost']

configs += ['sfcanl', 'analcalc', 'fcst', 'post', 'vrfy', 'arch']

if self.do_gldas:
Expand Down Expand Up @@ -342,13 +346,17 @@ def _get_cycled_task_names(self):

gdas_gfs_common_tasks_before_fcst = ['prep']
gdas_gfs_common_tasks_after_fcst = ['post', 'vrfy']

gdas_gfs_common_cleanup_tasks = ['arch']

if self.do_jedivar:
gdas_gfs_common_tasks_before_fcst += ['atmanalprep', 'atmanalrun', 'atmanalpost']
else:
gdas_gfs_common_tasks_before_fcst += ['anal']

if self.do_jediocnvar:
gdas_gfs_common_tasks_before_fcst += ['ocnanalprep', 'ocnanalbmat', 'ocnanalrun', 'ocnanalpost']

gdas_gfs_common_tasks_before_fcst += ['sfcanl', 'analcalc']

if self.do_aero:
Expand Down
20 changes: 18 additions & 2 deletions workflow/rocoto/workflow_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Tasks:
VALID_TASKS = ['aerosol_init', 'coupled_ic', 'getic', 'init',
'prep', 'anal', 'sfcanl', 'analcalc', 'analdiag', 'gldas', 'arch',
'atmanalprep', 'atmanalrun', 'atmanalpost',
'ocnanalprep', 'ocnanalrun', 'ocnanalpost',
'ocnanalprep', 'ocnanalbmat', 'ocnanalrun', 'ocnanalpost',
'earc', 'ecen', 'echgres', 'ediag', 'efcs',
'eobs', 'eomg', 'epos', 'esfc', 'eupd',
'atmensanalprep', 'atmensanalrun', 'atmensanalpost',
Expand Down Expand Up @@ -516,13 +516,29 @@ def ocnanalprep(self):

return task

def ocnanalrun(self):
def ocnanalbmat(self):

deps = []
dep_dict = {'type': 'task', 'name': f'{self.cdump}ocnanalprep'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps)

resources = self.get_resource('ocnanalbmat')
task = create_wf_task('ocnanalbmat',
resources,
cdump=self.cdump,
envar=self.envars,
dependency=dependencies)

return task

def ocnanalrun(self):

deps = []
dep_dict = {'type': 'task', 'name': f'{self.cdump}ocnanalbmat'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps)

resources = self.get_resource('ocnanalrun')
task = create_wf_task('ocnanalrun',
resources,
Expand Down

0 comments on commit 32b2169

Please sign in to comment.