Skip to content

Commit ab67838

Browse files
committed
FIX FIX FIX (test_minimum_halo_exchange_v1)
1 parent 4ebd337 commit ab67838

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

devito/mpi/routines.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,13 @@ def _make_copy(self, f, hse, key, swap=False):
367367
name = 'scatter%s' % key
368368

369369
if isinstance(f, Bag):
370-
if hse.bundle is not None:
371-
# `f` is the only component of `hse.bundle` that is
372-
# being communicated
373-
assert f.ncomp == 1
374-
i = hse.bundle.components.index(f.c0)
375-
eqns.append(Eq(*swap(buf[[0] + bdims], hse.bundle[[i] + findices])))
376-
else:
377-
for i, c in enumerate(f.components):
378-
eqns.append(Eq(*swap(buf[[i] + bdims], c[findices])))
370+
for i, c0 in enumerate(f.components):
371+
if hse.bundle is not None:
372+
indices = [hse.bundle.components.index(c0), *findices]
373+
rhs = hse.bundle[indices]
374+
else:
375+
rhs = c0[findices]
376+
eqns.append(Eq(*swap(buf[[i] + bdims], rhs)))
379377
else:
380378
assert f.is_Bundle
381379
for i in range(f.ncomp):

0 commit comments

Comments
 (0)