Skip to content

Commit

Permalink
mpi: fix no-grid function halo exchange
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jul 12, 2024
1 parent 60ea7b7 commit de4837d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions devito/types/dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,10 @@ def _C_get_field(self, region, dim, side=None):

def _halo_exchange(self):
"""Perform the halo exchange with the neighboring processes."""
if not MPI.Is_initialized() or MPI.COMM_WORLD.size == 1 or \
not configuration['mpi']:
if not MPI.Is_initialized() or \
MPI.COMM_WORLD.size == 1 or \
not configuration['mpi'] or \
self.grid is None:
# Nothing to do
return
if MPI.COMM_WORLD.size > 1 and self._distributor is None:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_tensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ def test_tensor_matmul(func1, func2, out_type):


@pytest.mark.parametrize('func1, func2, out_type', [
(VectorFunction, TensorFunction, VectorFunction),
(VectorTimeFunction, TensorFunction, VectorTimeFunction),
(VectorFunction, TensorTimeFunction, VectorTimeFunction),
(VectorTimeFunction, TensorTimeFunction, VectorTimeFunction)])
(VectorFunction, TensorFunction, TensorFunction),
(VectorTimeFunction, TensorFunction, TensorTimeFunction),
(VectorFunction, TensorTimeFunction, TensorTimeFunction),
(VectorTimeFunction, TensorTimeFunction, TensorTimeFunction)])
def test_tensor_matmul_T(func1, func2, out_type):
grid = Grid(tuple([5]*3))
f1 = func1(name="f1", grid=grid)
Expand Down

0 comments on commit de4837d

Please sign in to comment.