From be5c7051d6870bc441a05ec93b949fd3da41504c Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Sun, 22 Sep 2024 22:44:39 -0700 Subject: [PATCH] Fix AMReX Init for `test_wake` --- tests/python/test_wake.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/python/test_wake.py b/tests/python/test_wake.py index 8b80090f9..5bcef8376 100644 --- a/tests/python/test_wake.py +++ b/tests/python/test_wake.py @@ -6,16 +6,16 @@ np.set_printoptions(threshold=sys.maxsize) from conftest import basepath +import impactx from amrex.space3d import PODVector_real_std # Import amrex array -from impactx import ImpactX, amr, wakeconvolution +from impactx import ImpactX, wakeconvolution def test_wake(save_png=True): - amr.initialize([]) try: sim = ImpactX() sim.n_cell = [16, 24, 32] - sim.load_inputs_file(basepath + "/../../examples/chicane/input_chicane_csr.in") + sim.load_inputs_file(basepath + "/examples/chicane/input_chicane_csr.in") sim.slice_step_diagnostics = False sim.init_grids() @@ -139,4 +139,8 @@ def test_wake(save_png=True): if __name__ == "__main__": + # Call MPI_Init and MPI_Finalize only once: + if impactx.Config.have_mpi: + from mpi4py import MPI # noqa + test_wake()