Skip to content

Commit

Permalink
Fix incorrect usage of CFP on WCOSS2 (NOAA-EMC#1977)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerorahul authored Oct 25, 2023
1 parent 0b5cf9b commit 8556541
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ush/run_mpmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ source "${HOMEgfs}/ush/preamble.sh"

cmdfile=${1:?"run_mpmd requires an input file containing commands to execute in MPMD mode"}

# Determine the number of MPMD processes from incoming ${cmdfile}
nprocs=$(wc -l < "${cmdfile}")

# Local MPMD file containing instructions to run in CFP
mpmd_cmdfile="${DATA:-}/mpmd_cmdfile"
if [[ -s "${mpmd_cmdfile}" ]]; then rm -f "${mpmd_cmdfile}"; fi
Expand All @@ -19,7 +22,6 @@ if [[ "${launcher:-}" =~ ^srun.* ]]; then # srun-based system e.g. Hera, Orion
((nm=nm+1))
done < "${cmdfile}"

nprocs=$(wc -l < "${mpmd_cmdfile}")
set +e
# shellcheck disable=SC2086
${launcher:-} ${mpmd_opt:-} -n ${nprocs} "${mpmd_cmdfile}"
Expand All @@ -42,7 +44,8 @@ elif [[ "${launcher:-}" =~ ^mpiexec.* ]]; then # mpiexec
done < "${cmdfile}"

chmod 755 "${mpmd_cmdfile}"
${launcher:-} "${mpmd_cmdfile}"
# shellcheck disable=SC2086
${launcher:-} -np ${nprocs} ${mpmd_opt:-} "${mpmd_cmdfile}"
rc=$?
if (( rc == 0 )); then
out_files=$(find . -name 'mpmd.*.out')
Expand Down

0 comments on commit 8556541

Please sign in to comment.