Esempio n. 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))
Esempio n. 2
0
def test_find_recvs():
    z, recv_x, recv_x_plus_one, send_x, x_plus_one, from_node, send_x_plus_one = \
        create_send_recv_graph()

    assert set([recv_x]) == set(find_recvs(x_plus_one))
    assert set([recv_x]) == set(find_recvs(recv_x))
    assert len(find_recvs(from_node)) == 0
    assert set([recv_x]) == set(find_recvs(send_x_plus_one))
    assert set([recv_x_plus_one, recv_x]) == set(find_recvs(recv_x_plus_one))
    assert set([recv_x_plus_one, recv_x]) == set(find_recvs(z))