Skip to content

Commit

Permalink
Simplify downstream atmos product generation scripts (#1822)
Browse files Browse the repository at this point in the history
This PR came about attempting to understand how the atmos downstream products are
generated from the master grib2 files before they are updated to python-based scripts
and improved control.

This PR:
- removes explicit if blocks over the two downsets that largely repeats the same
operations and condenses into a loop
- introduces a generic `run_mpmd.sh` that is tested on Hera and WCOSS2 and can be
used elsewhere in the global-workflow.  Its input is a script that needs the instructions
to be executed, one-per-line.

No change in information content is expected from this update to the products.

This PR is necessary if the global-workflow team is to mange the post processing and
product generation scripts.
  • Loading branch information
aerorahul authored Sep 15, 2023
1 parent 2b73f0e commit a749f11
Show file tree
Hide file tree
Showing 11 changed files with 285 additions and 391 deletions.
4 changes: 3 additions & 1 deletion env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ step=$1

export npe_node_max=40
export launcher="srun -l --export=ALL"
export mpmd_opt="--multi-prog --output=${step}.%J.%t.out"
export mpmd_opt="--multi-prog --output=mpmd.%j.%t.out"

# Configure MPI environment
#export I_MPI_ADJUST_ALLREDUCE=5
Expand Down Expand Up @@ -215,6 +215,7 @@ elif [[ "${step}" = "post" ]]; then
[[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max}
export APRUN_NP="${launcher} -n ${npe_post}"

export USE_CFP="YES" # Use MPMD for downstream product generation on Hera
export NTHREADS_DWN=${nth_dwn:-1}
[[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max}
export APRUN_DWN="${launcher} -n ${npe_dwn}"
Expand Down Expand Up @@ -302,3 +303,4 @@ elif [[ "${step}" = "fit2obs" ]]; then
export MPIRUN="${launcher} -n ${npe_fit2obs}"

fi

3 changes: 2 additions & 1 deletion env/JET.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ elif [[ "${PARTITION_BATCH}" = "kjet" ]]; then
export npe_node_max=40
fi
export launcher="srun -l --epilog=/apps/local/bin/report-mem --export=ALL"
export mpmd_opt="--multi-prog --output=${step}.%J.%t.out"
export mpmd_opt="--multi-prog --output=mpmd.%j.%t.out"

# Configure MPI environment
export OMP_STACKSIZE=2048000
Expand Down Expand Up @@ -201,6 +201,7 @@ elif [[ "${step}" = "post" ]]; then
[[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max}
export APRUN_NP="${launcher} -n ${npe_post}"

export USE_CFP="YES" # Use MPMD for downstream product generation on Jet
export NTHREADS_DWN=${nth_dwn:-1}
[[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max}
export APRUN_DWN="${launcher} -n ${npe_dwn}"
Expand Down
3 changes: 2 additions & 1 deletion env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ step=$1

export npe_node_max=40
export launcher="srun -l --export=ALL"
export mpmd_opt="--multi-prog --output=${step}.%J.%t.out"
export mpmd_opt="--multi-prog --output=mpmd.%j.%t.out"

# Configure MPI environment
export MPI_BUFS_PER_PROC=2048
Expand Down Expand Up @@ -214,6 +214,7 @@ elif [[ "${step}" = "post" ]]; then
[[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max}
export APRUN_NP="${launcher} -n ${npe_post}"

export USE_CFP="YES" # Use MPMD for downstream product generation on Orion
export NTHREADS_DWN=${nth_dwn:-1}
[[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max}
export APRUN_DWN="${launcher} -n ${npe_dwn}"
Expand Down
3 changes: 2 additions & 1 deletion env/S4.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ elif [[ ${PARTITION_BATCH} = "ivy" ]]; then
export npe_node_max=20
fi
export launcher="srun -l --export=ALL"
export mpmd_opt="--multi-prog --output=${step}.%J.%t.out"
export mpmd_opt="--multi-prog --output=mpmd.%j.%t.out"

# Configure MPI environment
export OMP_STACKSIZE=2048000
Expand Down Expand Up @@ -187,6 +187,7 @@ elif [[ "${step}" = "post" ]]; then
[[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max}
export APRUN_NP="${launcher} -n ${npe_post}"

export USE_CFP="YES" # Use MPMD for downstream product generation on S4
export NTHREADS_DWN=${nth_dwn:-1}
[[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max}
export APRUN_DWN="${launcher} -n ${npe_dwn}"
Expand Down
1 change: 1 addition & 0 deletions env/WCOSS2.env
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ elif [[ "${step}" = "post" ]]; then
[[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max}
export APRUN_NP="${launcher} -n ${npe_np:-${npe_post}} -ppn ${npe_node_post} --cpu-bind depth --depth ${NTHREADS_NP}"

export USE_CFP="YES" # Use MPMD for downstream product generation on WCOSS2
export NTHREADS_DWN=${nth_dwn:-1}
[[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max}
export APRUN_DWN="${launcher} -np ${npe_dwn} ${mpmd_opt}"
Expand Down
2 changes: 1 addition & 1 deletion jobs/JGLOBAL_ATMOS_POST
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fi
for grid in '0p25' '0p50' '1p00'; do
prod_dir="COM_ATMOS_GRIB_${grid}"
GRID=${grid} YMD=${PDY} HH=${cyc} generate_com -rx "${prod_dir}:COM_ATMOS_GRIB_GRID_TMPL"
if [[ ! -d "${prod_dir}" ]]; then mkdir -m 775 -p "${!prod_dir}"; fi
if [[ ! -d "${!prod_dir}" ]]; then mkdir -m 775 -p "${!prod_dir}"; fi
done

if [ "${RUN}" = gfs ];then
Expand Down
Loading

0 comments on commit a749f11

Please sign in to comment.