Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 9aa9eda

Browse files
authored
distribute analysis key existance check fix (#364)
1 parent cb8027e commit 9aa9eda

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

sdc/distributed_analysis.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,29 @@ def _analyze_assign(self, inst, array_dists, parfor_dists):
199199
elif isinstance(rhs, ir.Expr) and rhs.op in ('getiter', 'iternext'):
200200
# analyze array container access in pair_first
201201
return
202+
202203
elif isinstance(rhs, ir.Arg):
203-
if rhs.name in self.metadata['distributed']:
204+
distributed_key = 'distributed'
205+
threaded_key = 'threaded'
206+
207+
if distributed_key not in self.metadata.keys():
208+
self.metadata[distributed_key] = {}
209+
210+
if threaded_key not in self.metadata.keys():
211+
self.metadata[threaded_key] = {}
212+
213+
if rhs.name in self.metadata[distributed_key]:
204214
if lhs not in array_dists:
205215
array_dists[lhs] = Distribution.OneD
206-
elif rhs.name in self.metadata['threaded']:
216+
217+
elif rhs.name in self.metadata[threaded_key]:
207218
if lhs not in array_dists:
208219
array_dists[lhs] = Distribution.Thread
220+
209221
else:
210222
dprint("replicated input ", rhs.name, lhs)
211223
self._set_REP([inst.target], array_dists)
224+
212225
else:
213226
self._set_REP(inst.list_vars(), array_dists)
214227
return

0 commit comments

Comments
 (0)