Skip to content

Commit

Permalink
Do not include received arrays in part outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Apr 10, 2023
1 parent 13760d9 commit 8e04ff8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pytato/distributed/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ class DistributedGraphPart:
:attr:`name_to_send_node` are usable as input names by other
parts, or in the result of the computation.
- Names specified in :attr:`name_to_recv_node` *must not* occur in
:attr:`output_names`.
- Names specified in :attr:`name_to_send_node` *must* occur in
:attr:`output_names`.
.. attribute:: pid
An identifier for this part of the graph.
Expand Down Expand Up @@ -892,6 +897,11 @@ def get_stored_predecessors(ary: Array) -> FrozenSet[Array]:

outputs_per_part: List[Set[Array]] = [set() for _pid in range(nparts)]
for output_ary in stored_ary_part_outputs:
if output_ary in received_arrays:
# Received arrays already have names and are materialized, must not
# make them part outputs.
continue

outputs_per_part[stored_ary_to_part_id[output_ary]].add(output_ary)

partition = _make_distributed_partition(
Expand Down

0 comments on commit 8e04ff8

Please sign in to comment.