Skip to content

Commit cb03b52

Browse files
committed
compiler: Purge MPI dual mode
1 parent 077d7a7 commit cb03b52

1 file changed

Lines changed: 11 additions & 19 deletions

File tree

devito/mpi/halo_scheme.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,6 @@ def classify(exprs, ispace):
573573
Produce the mapper `Function -> HaloSchemeEntry`, which describes the necessary
574574
halo exchanges in the given Scope.
575575
"""
576-
577-
# Some MPI modes require pulling the `loc_indices` from the reads, others
578-
# from the writes. It essentially depends on whether the halo exchange is
579-
# performed before (reads) or after (writes) the OWNED region is computed
580-
loc_indices_from_reads = configuration['mpi'] not in ('dual',)
581-
582576
scope = Scope(exprs)
583577

584578
mapper = {}
@@ -618,15 +612,17 @@ def classify(exprs, ispace):
618612
else:
619613
v[(d, LEFT)] = STENCIL
620614
v[(d, RIGHT)] = STENCIL
621-
elif loc_indices_from_reads:
615+
else:
622616
v[(d, i[d])] = NONE
623617

624618
# Does `i` actually require a halo exchange?
625619
if not any(hl is STENCIL for hl in v.values()):
626620
continue
627621

628622
# Derive diagonal halo exchanges from the previous analysis
629-
combs = list(product([LEFT, CENTER, RIGHT], repeat=len(f._dist_dimensions)))
623+
combs = list(
624+
product([LEFT, CENTER, RIGHT], repeat=len(f._dist_dimensions))
625+
)
630626
combs.remove((CENTER,)*len(f._dist_dimensions))
631627
for c in combs:
632628
key = (f._dist_dimensions, c)
@@ -651,13 +647,6 @@ def classify(exprs, ispace):
651647
if not halo_labels:
652648
continue
653649

654-
# Augment `halo_labels` with `loc_indices`-related information if necessary
655-
if not loc_indices_from_reads:
656-
for i in scope.writes.get(f, []):
657-
for d in i.findices:
658-
if not f.grid.is_distributed(d):
659-
halo_labels[(d, i[d])].add(NONE)
660-
661650
# Separate halo-exchange Dimensions from `loc_indices`
662651
raw_loc_indices, halos = defaultdict(list), []
663652
for (d, s), hl in halo_labels.items():
@@ -666,15 +655,18 @@ def classify(exprs, ispace):
666655
if not hl:
667656
continue
668657
elif len(hl) > 1:
669-
raise HaloSchemeException("Inconsistency found while building a halo "
670-
f"scheme for `{f}` along Dimension `{d}`")
658+
raise HaloSchemeException(
659+
"Inconsistency found while building a halo scheme for "
660+
f"`{f}` along Dimension `{d}`")
671661
elif hl.pop() is STENCIL:
672662
halos.append(Halo(d, s))
673663
elif d._defines & set(ispace.itdims):
674664
raw_loc_indices[d].append(s)
675665

676-
loc_indices, loc_dirs = process_loc_indices(raw_loc_indices,
677-
ispace.directions)
666+
loc_indices, loc_dirs = process_loc_indices(
667+
raw_loc_indices, ispace.directions
668+
)
669+
678670
mapper[f] = HaloSchemeEntry(loc_indices, loc_dirs, halos, dims)
679671

680672
return mapper

0 commit comments

Comments
 (0)