你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-04 11:36:52 +08:00
Fix bug from assuming no MPI neighbour would always be -1
这个提交包含在:
@@ -1,5 +1,5 @@
|
||||
# Copyright (C) 2015-2025: The University of Edinburgh, United Kingdom
|
||||
# Authors: Craig Warren, Antonis Giannopoulos, John Hartley,
|
||||
# Authors: Craig Warren, Antonis Giannopoulos, John Hartley,
|
||||
# and Nathan Mannall
|
||||
#
|
||||
# This file is part of gprMax.
|
||||
@@ -370,7 +370,7 @@ class MPIGrid(FDTDGrid):
|
||||
dir: Direction of halo to swap.
|
||||
"""
|
||||
neighbour = self.neighbours[dim][dir]
|
||||
if neighbour != -1:
|
||||
if neighbour >= 0:
|
||||
send_request = self.comm.Isend([array, self.send_halo_map[dim][dir]], neighbour)
|
||||
recv_request = self.comm.Irecv([array, self.recv_halo_map[dim][dir]], neighbour)
|
||||
self.send_requests.append(send_request)
|
||||
@@ -637,7 +637,7 @@ class MPIGrid(FDTDGrid):
|
||||
has_neighbour: True if the current rank has a neighbour in
|
||||
the specified dimension and direction.
|
||||
"""
|
||||
return self.neighbours[dim][dir] != -1
|
||||
return self.neighbours[dim][dir] >= 0
|
||||
|
||||
def set_halo_map(self):
|
||||
"""Create MPI DataTypes for field array halo exchanges."""
|
||||
|
@@ -328,7 +328,7 @@ class MPISnapshot(Snapshot[MPIGrid]):
|
||||
self.neighbours[Dim.Z] = self.comm.Shift(direction=Dim.Z, disp=1)
|
||||
|
||||
def has_neighbour(self, dimension: Dim, direction: Dir) -> bool:
|
||||
return self.neighbours[dimension][direction] != -1
|
||||
return self.neighbours[dimension][direction] >= 0
|
||||
|
||||
def store(self):
|
||||
"""Store (in memory) electric and magnetic field values for snapshot.
|
||||
|
在新工单中引用
屏蔽一个用户