Skip to content

DistributedRecv reachable from multiple parts results in multiple receives for the same tag/rank pair #378

Description

@kaushikcfd

Consider the MWE:

import pytato as pt


size = 4
rank = 2
send_rank = 3
recv_rank = 1


x = pt.make_placeholder("x", 10, "float64")
recv = pt.make_distributed_recv(
            src_rank=recv_rank, comm_tag=42,
            shape=x.shape, dtype=x.dtype)
y = x + recv

send1 = pt.staple_distributed_send(
       x, dest_rank=send_rank, comm_tag=43,
       stapled_to=y)

send2 = pt.staple_distributed_send(
    send1 + recv, dest_rank=send_rank, comm_tag=44,
    stapled_to=send1)

out = pt.make_dict_of_named_arrays({"out": send1 + send2})

parts = pt.find_distributed_partition(out)
pt.show_dot_graph(parts)

Notice how there is only one receive-node, but the partition is emitted as --
code

This is definitely a bug in pt.find_distributed_partition's _PartIdTagAssigner which introduces another receive-node.

I'm not too sure about the implementation in execute_partition, but I guess this could lead to deadlocks?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions