Skip to content

Commit

Permalink
Use the mesh mpi_comm in case the mesh has been initialized on MPI.co…
Browse files Browse the repository at this point in the history
…mm_self
  • Loading branch information
johannesring committed Sep 5, 2023
1 parent 66891f0 commit 0945257
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fsipy/simulations/simulation_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0945257

Please sign in to comment.