示例#1
0
def test_find_recvs_scatter_gather():
    scatter_send_x, scatter_recv_a, scatter_recv_b, gather_send_a, gather_send_b, \
        gather_recv_x_plus_one = create_scatter_gather_graph()

    assert set([scatter_recv_a]) == set(find_recvs(gather_send_a))
    assert set([scatter_recv_b]) == set(find_recvs(gather_send_b))
    assert len(find_recvs(scatter_send_x)) == 0
    assert set([gather_recv_x_plus_one, scatter_recv_a]) == set(find_recvs(gather_recv_x_plus_one))
    assert set([scatter_recv_a]) == set(find_recvs(scatter_recv_a))
示例#2
0
def test_comm_path_exists_scatter_gather():
    scatter_send_x, scatter_recv_a, scatter_recv_b, gather_send_a, gather_send_b, \
        gather_recv_x_plus_one = create_scatter_gather_graph()

    assert comm_path_exists(scatter_recv_a, scatter_send_x)
    assert comm_path_exists(gather_recv_x_plus_one, gather_send_a)
    assert comm_path_exists(gather_recv_x_plus_one, scatter_send_x)
    assert comm_path_exists(scatter_recv_b, scatter_send_x)
    assert not comm_path_exists(gather_recv_x_plus_one, gather_send_b)
    assert not comm_path_exists(gather_send_a, gather_recv_x_plus_one)