From 8e04ff8ddd797bbe2aed14c9d55ab38e9ca36e8c Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 12 Jan 2023 16:34:59 -0600 Subject: [PATCH] Do not include received arrays in part outputs --- pytato/distributed/partition.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pytato/distributed/partition.py b/pytato/distributed/partition.py index bbe976c99..ad73de6cb 100644 --- a/pytato/distributed/partition.py +++ b/pytato/distributed/partition.py @@ -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. @@ -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(