Skip to content

Commit b736cc3

Browse files
committed
api: fix sparse positon match with -1
1 parent f8cc3ee commit b736cc3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

devito/types/sparse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ def __shape_setup__(cls, **kwargs):
112112
loc_shape = []
113113
assert len(dimensions) == len(shape)
114114
for i, (d, s) in enumerate(zip(dimensions, shape)):
115-
if i == cls._sparse_position:
115+
if i == cls._sparse_position or \
116+
(cls._sparse_position == -1 and i == len(dimensions)-1):
116117
loc_shape.append(glb_npoint[grid.distributor.myrank])
117118
elif d in grid.dimensions:
118119
loc_shape.append(grid.size_map[d].loc)

0 commit comments

Comments
 (0)