From 0945257e0563374b50cad32bcccfc93e29eb8e67 Mon Sep 17 00:00:00 2001 From: johannesring Date: Tue, 5 Sep 2023 23:26:41 +0200 Subject: [PATCH] Use the mesh mpi_comm in case the mesh has been initialized on MPI.comm_self --- src/fsipy/simulations/simulation_common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fsipy/simulations/simulation_common.py b/src/fsipy/simulations/simulation_common.py index 6b9f6ff9..ca21ca0c 100644 --- a/src/fsipy/simulations/simulation_common.py +++ b/src/fsipy/simulations/simulation_common.py @@ -26,7 +26,7 @@ def load_mesh_and_data(mesh_path: str) -> Tuple[Mesh, MeshFunction, MeshFunction mesh = Mesh() # Open the HDF5 file in read-only mode - hdf5 = HDF5File(MPI.comm_world, mesh_path, "r") + hdf5 = HDF5File(mesh.mpi_comm(), mesh_path, "r") # Read mesh data hdf5.read(mesh, "/mesh", False) @@ -74,7 +74,7 @@ def print_mesh_summary(mesh: Mesh) -> None: } # Gather local information from all processors to processor 0 - comm = MPI.comm_world + comm = mesh.mpi_comm() gathered_info = comm.gather(local_info, 0) num_cells_per_processor = comm.gather(local_info["num_cells"], 0) @@ -240,7 +240,7 @@ def calculate_and_print_flow_properties(dt: float, mesh: Mesh, v: Function, inle local_V_min = V_vector.min() local_V_max = V_vector.max() - comm = MPI.comm_world + comm = mesh.mpi_comm() # Gather data from all processes V_mean = comm.gather(local_V_mean, 0) V_min = comm.gather(local_V_min, 0)