From bb3eff6c538be5b9770e44ef531029f6e13d35d9 Mon Sep 17 00:00:00 2001 From: Jeremy McGibbon Date: Tue, 28 Jul 2020 14:18:19 -0700 Subject: [PATCH] Run MPI tests on circleci, fix tests (#5) When fv3util was split into a separate repo, the MPI tests were disabled. This PR re-enables them and fixes the test code to reflect internal API changes. --- .circleci/config.yml | 10 ++++++++-- tests/mpi/test_mpi_halo_update.py | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c964ac2..4beed0d9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,6 +18,11 @@ jobs: steps: - checkout + - run: + name: install MPI + command: | + sudo apt-get update + sudo apt-get install libopenmpi3 # Download and cache dependencies - restore_cache: @@ -31,6 +36,7 @@ jobs: python3 -m venv venv . venv/bin/activate pip3 install -r requirements.txt + pip3 install mpi4py==3.0.3 - save_cache: paths: - ./venv @@ -39,8 +45,8 @@ jobs: name: run tests command: | . venv/bin/activate - pip3 install -e . - pytest tests + pip3 install . + make test test_mpi workflows: version: 2 diff --git a/tests/mpi/test_mpi_halo_update.py b/tests/mpi/test_mpi_halo_update.py index 9791674d..325d3d2b 100644 --- a/tests/mpi/test_mpi_halo_update.py +++ b/tests/mpi/test_mpi_halo_update.py @@ -326,7 +326,7 @@ def test_zeros_halo_update( communicator.halo_update(quantity, n_points_update) boundaries = boundary_dict[communicator.rank % ranks_per_tile] for boundary in boundaries: - boundary_slice = fv3util.boundary._get_boundary_slice( + boundary_slice = fv3util._boundary_utils.get_boundary_slice( quantity.dims, quantity.origin, quantity.extent, @@ -366,7 +366,7 @@ def test_zeros_vector_halo_update( communicator.vector_halo_update(y_quantity, x_quantity, n_points_update) boundaries = boundary_dict[communicator.rank % ranks_per_tile] for boundary in boundaries: - boundary_slice = fv3util.boundary._get_boundary_slice( + boundary_slice = fv3util._boundary_utils.get_boundary_slice( x_quantity.dims, x_quantity.origin, x_quantity.extent,