提交 3f6c2b36 编写于 作者: Q qiaolongfei

rm initConfigByGflags of PServerController, use stack value instead

上级 93e74f89
......@@ -60,18 +60,16 @@ PServerController::PServerController(const ParameterServerConfig& config) {
PServerController::~PServerController() { this->join(); }
ParameterServerConfig* PServerController::initConfigByGflags() {
ParameterServerConfig* config = new ParameterServerConfig();
config->set_nics(FLAGS_nics);
config->set_port(FLAGS_port);
config->set_ports_num(FLAGS_ports_num);
config->set_rdma_tcp(FLAGS_rdma_tcp);
return config;
}
PServerController* PServerController::createByGflags() {
auto& pServerConfig = *paddle::PServerController::initConfigByGflags();
return create(pServerConfig);
ParameterServerConfig config;
config.set_nics(FLAGS_nics);
config.set_rdma_tcp(FLAGS_rdma_tcp);
config.set_port(FLAGS_port);
config.set_ports_num(FLAGS_ports_num);
config.set_ports_num_for_sparse(FLAGS_ports_num_for_sparse);
return create(config);
}
PServerController* PServerController::create(
......
......@@ -21,7 +21,7 @@ limitations under the License. */
namespace paddle {
class PServerController {
class PServerController final {
public:
DISABLE_COPY(PServerController);
......@@ -58,13 +58,7 @@ public:
void join();
private:
std::vector<std::shared_ptr<ParameterServer2>> pservers_;
/**
* @brief create ParameterServerConfig from gflags, this is used for
* compatibility with the old usage of configuration by gflags.
*/
static ParameterServerConfig* initConfigByGflags();
std::vector<std::unique_ptr<ParameterServer2>> pservers_;
};
} // namespace paddle
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册