Пример #1
0
parser.add_argument('-p',
                    '--port',
                    help='enter server port number',
                    required=False)
parser.add_argument('-i', '--intra_node', action='store_true')
parser.add_argument('-m',
                    '--mem_type',
                    help='host/cuda (default = host)',
                    required=False)
args = parser.parse_args()

## initiate ucp
init_str = ""
server = False
cb_not_done = True
if args.server is None:
    server = True
else:
    server = False
    init_str = args.server

ucp.init()
if server:
    if args.intra_node:
        ucp.set_cuda_dev(1)
    ucp.start_server(talk_to_client, is_coroutine=False)
    while cb_not_done:
        ucp.progress()
else:
    talk_to_server(init_str.encode(), int(args.port))
Пример #2
0
def test_set_cuda_dev_raises():
    with pytest.raises(ValueError, match=msg):
        ucp.set_cuda_dev(0)