Skip to content

Commit ba00b18

Browse files
committed
mpi: better naming
1 parent ad3c629 commit ba00b18

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

devito/core/operator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ def _specialize_clusters(cls, clusters, **kwargs):
318318

319319
# Fetch passes to be called
320320
passes_mapper = cls._make_clusters_passes_mapper(**kwargs)
321-
print(passes)
322321

323322
# Call passes
324323
for i in passes:

devito/data/data.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _local(self):
154154

155155
def _global(self, glb_idx, decomposition):
156156
"""A "global" view of ``self`` over a given Decomposition."""
157-
if self._is_mpi_distributed:
157+
if self._is_decomposed:
158158
raise ValueError("Cannot derive a decomposed view from a decomposed Data")
159159
if len(decomposition) != self.ndim:
160160
raise ValueError("`decomposition` should have ndim=%d entries" % self.ndim)
@@ -180,9 +180,9 @@ def wrapper(data, *args, **kwargs):
180180
if is_gather and all(i == slice(None, None, 1) for i in glb_idx):
181181
comm_type = gather
182182
elif len(args) > 1 and isinstance(args[1], Data) \
183-
and args[1]._is_mpi_distributed:
183+
and args[1]._is_decomposed:
184184
comm_type = index_by_index
185-
elif data._is_mpi_distributed:
185+
elif data._is_decomposed:
186186
for i in as_tuple(glb_idx):
187187
if isinstance(i, slice) and i.step is not None and i.step < 0:
188188
comm_type = index_by_index
@@ -196,7 +196,7 @@ def wrapper(data, *args, **kwargs):
196196
return wrapper
197197

198198
@property
199-
def _is_mpi_distributed(self):
199+
def _is_decomposed(self):
200200
is_mpi = self._is_distributed and configuration['mpi']
201201
if is_mpi:
202202
is_mpi = is_mpi and self._distributor.comm.size > 2
@@ -344,7 +344,7 @@ def __setitem__(self, glb_idx, val, comm_type):
344344
super().__setitem__(loc_idx, val)
345345
else:
346346
super().__setitem__(glb_idx, val)
347-
elif isinstance(val, Data) and val._is_mpi_distributed:
347+
elif isinstance(val, Data) and val._is_decomposed:
348348
if comm_type is index_by_index:
349349
glb_idx, val = self._process_args(glb_idx, val)
350350
val_idx = as_tuple([slice(i.glb_min, i.glb_max+1, 1) for
@@ -364,14 +364,14 @@ def __setitem__(self, glb_idx, val, comm_type):
364364
or data_global[j].size == 0
365365
if not skip:
366366
self.__setitem__(idx_global[j], data_global[j])
367-
elif self._is_mpi_distributed:
367+
elif self._is_decomposed:
368368
# `val` is decomposed, `self` is decomposed -> local set
369369
super().__setitem__(glb_idx, val)
370370
else:
371371
# `val` is decomposed, `self` is replicated -> gatherall-like
372372
raise NotImplementedError
373373
elif isinstance(val, np.ndarray):
374-
if self._is_mpi_distributed:
374+
if self._is_decomposed:
375375
# `val` is replicated, `self` is decomposed -> `val` gets decomposed
376376
glb_idx = self._normalize_index(glb_idx)
377377
glb_idx, val = self._process_args(glb_idx, val)
@@ -404,7 +404,7 @@ def __setitem__(self, glb_idx, val, comm_type):
404404
pass
405405
super().__setitem__(glb_idx, val)
406406
elif isinstance(val, Iterable):
407-
if self._is_mpi_distributed:
407+
if self._is_decomposed:
408408
raise NotImplementedError("With MPI, data can only be set "
409409
"via scalars, numpy arrays or "
410410
"other data ")
@@ -481,7 +481,7 @@ def _index_glb_to_loc(self, glb_idx):
481481
if len(glb_idx) > self.ndim:
482482
# Maybe user code is trying to add a new axis (see np.newaxis),
483483
# so the resulting array will be higher dimensional than `self`
484-
if self._is_mpi_distributed:
484+
if self._is_decomposed:
485485
raise ValueError("Cannot increase dimensionality of MPI-distributed Data")
486486
else:
487487
# As by specification, we are forced to ignore modulo indexing
@@ -497,7 +497,7 @@ def _index_glb_to_loc(self, glb_idx):
497497
try:
498498
v = convert_index(i, dec, mode='glb_to_loc')
499499
except TypeError:
500-
if self._is_mpi_distributed:
500+
if self._is_decomposed:
501501
raise NotImplementedError("Unsupported advanced indexing with "
502502
"MPI-distributed Data")
503503
v = i

devito/finite_differences/differentiable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ def _diff2sympy(obj):
10881088
# Interpolation for finite differences
10891089
@singledispatch
10901090
def interp_for_fd(expr, x0, **kwargs):
1091-
return expr._evaluate(expand=True)
1091+
return expr
10921092

10931093

10941094
@interp_for_fd.register(sympy.Derivative)

0 commit comments

Comments
 (0)