dmlc--dgl
c1ff4c9b41
* [DistTest] add basic pipeline for dist test across machines * move launch remote cmd to separate file * add test for rpc * fix function naming rule Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
29 行
836 B
C++
29 行
836 B
C++
#ifndef DIST_TEST_RPC_BASE_H_
|
|
#define DIST_TEST_RPC_BASE_H_
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
#include "../../../src/rpc/rpc_msg.h"
|
|
#include "../../../src/rpc/tensorpipe/tp_communicator.h"
|
|
#include "../../cpp/common.h"
|
|
|
|
namespace {
|
|
const int kNumSender = 30;
|
|
const int kNumReceiver = 10;
|
|
const int kNumMessage = 1024;
|
|
const int kPort = 50090;
|
|
const int kSizeTensor = 10 * 1024;
|
|
const int kNumTensor = 30;
|
|
|
|
std::shared_ptr<tensorpipe::Context> InitTPContext() {
|
|
auto context = std::make_shared<tensorpipe::Context>();
|
|
auto transportContext = tensorpipe::transport::uv::create();
|
|
context->registerTransport(0 /* priority */, "tcp", transportContext);
|
|
auto basicChannel = tensorpipe::channel::basic::create();
|
|
context->registerChannel(0 /* low priority */, "basic", basicChannel);
|
|
return context;
|
|
}
|
|
} // namespace
|
|
|
|
#endif |