Skip to content

Commit

Permalink
Add mpi hosts file to wave forecasts configuration
Browse files Browse the repository at this point in the history
Enables wwatch3 to be run on different VMs to those where NEMO is run.
This is a step towards running wwatch3 nowcast/forecast runs concurrently with
nowcast-green.
  • Loading branch information
douglatornell committed Nov 6, 2023
1 parent f245a98 commit 96f8cc4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions config/nowcast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,10 @@ wave forecasts:
# Template for NEMO hourly results file name
# **Must be quoted to project {} characters**
NEMO file template: 'SalishSea_1h_{s_yyyymmdd}_{e_yyyymmdd}_grid_{grid}.nc'
# Location on the compute host of the file that contains IP addresses
# and MPI slots specifications.
# Only required for runs on cloud hosts.
mpi hosts file: ${HOME}/mpi_hosts.wwatch3
# Path to the wwatch3 executables directory
wwatch3 exe path: /nemoShare/MEOPAR/nowcast-sys/wwatch3-5.16/exe
# Path to the salishsea command processor executable to use in the run script
Expand Down
3 changes: 2 additions & 1 deletion nowcast/workers/run_ww3.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,14 @@ def _definitions(run_date, run_type, run_dir_path, results_path, config):
"""
ddmmmyy = run_date.format("DDMMMYY").lower()
wwatch3_exe_path = config["wave forecasts"]["wwatch3 exe path"]
mpi_hosts_file = config["wave forecasts"]["mpi hosts file"]
salishsea_cmd = config["wave forecasts"]["salishsea cmd"]
defns = (
f'RUN_ID="{ddmmmyy}ww3-{run_type}"\n'
f'WORK_DIR="{run_dir_path}"\n'
f'RESULTS_DIR="{results_path/ddmmmyy}"\n'
f'WW3_EXE="{wwatch3_exe_path}"\n'
f'MPIRUN="mpirun --mca btl ^openib --mca orte_tmpdir_base /dev/shm --hostfile ${{HOME}}/mpi_hosts"\n'
f'MPIRUN="mpirun --mca btl ^openib --mca orte_tmpdir_base /dev/shm --hostfile {mpi_hosts_file}"\n'
f'GATHER="{salishsea_cmd} gather"\n'
)
return defns
Expand Down
7 changes: 6 additions & 1 deletion tests/workers/test_run_ww3.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def config(base_config, tmp_path):
f"""\
wave forecasts:
run prep dir: {run_prep_dir}
mpi hosts file: ${{HOME}}/mpi_hosts.wwatch3
wwatch3 exe path: wwatch3-5.16/exe
salishsea cmd: salishsea
results:
Expand Down Expand Up @@ -146,6 +147,10 @@ def test_run_prep_dir(self, prod_config):
run_prep_dir = prod_config["wave forecasts"]["run prep dir"]
assert run_prep_dir == "/nemoShare/MEOPAR/nowcast-sys/wwatch3-runs"

def test_mpi_hosts_file(self, prod_config):
mpi_hosts_file = prod_config["wave forecasts"]["mpi hosts file"]
assert mpi_hosts_file == "${HOME}/mpi_hosts.wwatch3"

def test_wwatch3_exe(self, prod_config):
wwatch3_exe_path = prod_config["wave forecasts"]["wwatch3 exe path"]
assert wwatch3_exe_path == "/nemoShare/MEOPAR/nowcast-sys/wwatch3-5.16/exe"
Expand Down Expand Up @@ -500,7 +505,7 @@ def test_definitions(self, run_type, config):
WORK_DIR="wwatch3-runs/tmp_run_dir"
RESULTS_DIR="wwatch3-{run_type}/29mar17"
WW3_EXE="wwatch3-5.16/exe"
MPIRUN="mpirun --mca btl ^openib --mca orte_tmpdir_base /dev/shm --hostfile ${{HOME}}/mpi_hosts"
MPIRUN="mpirun --mca btl ^openib --mca orte_tmpdir_base /dev/shm --hostfile ${{HOME}}/mpi_hosts.wwatch3"
GATHER="salishsea gather"
"""

Expand Down

0 comments on commit 96f8cc4

Please sign in to comment.