test_cpp.py 778 Bytes
Newer Older
1
2
import os
import unittest
3

4
5
6
from utils import execute_remote, get_ips


7
@unittest.skipIf(os.name == "nt", reason="Do not support windows yet")
8
def test_tensorpipe_comm():
9
10
11
12
    base_dir = os.environ.get("DIST_DGL_TEST_CPP_BIN_DIR", ".")
    ip_config = os.environ.get("DIST_DGL_TEST_IP_CONFIG", "ip_config.txt")
    client_bin = os.path.join(base_dir, "rpc_client")
    server_bin = os.path.join(base_dir, "rpc_server")
13
14
15
16
    ips = get_ips(ip_config)
    num_machines = len(ips)
    procs = []
    for ip in ips:
17
18
19
        procs.append(
            execute_remote(server_bin + " " + str(num_machines) + " " + ip, ip)
        )
20
21
22
23
24
    for ip in ips:
        procs.append(execute_remote(client_bin + " " + ip_config, ip))
    for p in procs:
        p.join()
        assert p.exitcode == 0