File tree Expand file tree Collapse file tree 2 files changed +11
-19
lines changed Expand file tree Collapse file tree 2 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -60,18 +60,16 @@ PServerController::PServerController(const ParameterServerConfig& config) {
60
60
61
61
PServerController::~PServerController () { this ->join (); }
62
62
63
- ParameterServerConfig* PServerController::initConfigByGflags () {
64
- ParameterServerConfig* config = new ParameterServerConfig ();
65
- config->set_nics (FLAGS_nics);
66
- config->set_port (FLAGS_port);
67
- config->set_ports_num (FLAGS_ports_num);
68
- config->set_rdma_tcp (FLAGS_rdma_tcp);
69
- return config;
70
- }
71
-
72
63
PServerController* PServerController::createByGflags () {
73
- auto & pServerConfig = *paddle::PServerController::initConfigByGflags ();
74
- return create (pServerConfig);
64
+ ParameterServerConfig config;
65
+
66
+ config.set_nics (FLAGS_nics);
67
+ config.set_rdma_tcp (FLAGS_rdma_tcp);
68
+ config.set_port (FLAGS_port);
69
+ config.set_ports_num (FLAGS_ports_num);
70
+ config.set_ports_num_for_sparse (FLAGS_ports_num_for_sparse);
71
+
72
+ return create (config);
75
73
}
76
74
77
75
PServerController* PServerController::create (
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ limitations under the License. */
21
21
22
22
namespace paddle {
23
23
24
- class PServerController {
24
+ class PServerController final {
25
25
public:
26
26
DISABLE_COPY (PServerController);
27
27
@@ -58,13 +58,7 @@ class PServerController {
58
58
void join ();
59
59
60
60
private:
61
- std::vector<std::shared_ptr<ParameterServer2>> pservers_;
62
-
63
- /* *
64
- * @brief create ParameterServerConfig from gflags, this is used for
65
- * compatibility with the old usage of configuration by gflags.
66
- */
67
- static ParameterServerConfig* initConfigByGflags ();
61
+ std::vector<std::unique_ptr<ParameterServer2>> pservers_;
68
62
};
69
63
70
64
} // namespace paddle
You can’t perform that action at this time.
0 commit comments