Skip to content

Commit 93e74f8

Browse files
committed
rename PServerUtil to PServerController
1 parent 7783982 commit 93e74f8

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

paddle/pserver/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ set(PSERVER_SOURCES
2525
ParameterClient2.cpp
2626
ParameterServer2.cpp
2727
SparseParameterDistribution.cpp
28-
PServerUtil.cpp)
28+
PServerController.cpp)
2929

3030
set(PSERVER_HEADERS
3131
BaseClient.h
3232
ParameterClient2.h
3333
ParameterServer2.h
3434
SparseParameterDistribution.h
35-
PServerUtil.h)
35+
PServerController.h)
3636

3737
add_library(paddle_pserver STATIC
3838
${PSERVER_SOURCES})

paddle/pserver/PServerUtil.cpp renamed to paddle/pserver/PServerController.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

15-
#include "PServerUtil.h"
15+
#include "PServerController.h"
1616

1717
namespace paddle {
1818

19-
PServerUtil::PServerUtil(const ParameterServerConfig& config) {
19+
PServerController::PServerController(const ParameterServerConfig& config) {
2020
// round robin to load balance RDMA server ENGINE
2121
std::vector<std::string> devices;
2222
int rdmaCpu = 0;
@@ -58,9 +58,9 @@ PServerUtil::PServerUtil(const ParameterServerConfig& config) {
5858
}
5959
}
6060

61-
PServerUtil::~PServerUtil() { this->join(); }
61+
PServerController::~PServerController() { this->join(); }
6262

63-
ParameterServerConfig* PServerUtil::initConfig() {
63+
ParameterServerConfig* PServerController::initConfigByGflags() {
6464
ParameterServerConfig* config = new ParameterServerConfig();
6565
config->set_nics(FLAGS_nics);
6666
config->set_port(FLAGS_port);
@@ -69,16 +69,17 @@ ParameterServerConfig* PServerUtil::initConfig() {
6969
return config;
7070
}
7171

72-
PServerUtil* PServerUtil::createWithGflags() {
73-
auto& pServerConfig = *paddle::PServerUtil::initConfig();
72+
PServerController* PServerController::createByGflags() {
73+
auto& pServerConfig = *paddle::PServerController::initConfigByGflags();
7474
return create(pServerConfig);
7575
}
7676

77-
PServerUtil* PServerUtil::create(const ParameterServerConfig& config) {
78-
return new PServerUtil(config);
77+
PServerController* PServerController::create(
78+
const ParameterServerConfig& config) {
79+
return new PServerController(config);
7980
}
8081

81-
void PServerUtil::start() {
82+
void PServerController::start() {
8283
LOG(INFO) << "pserver sizes : " << pservers_.size();
8384
int i = 0;
8485
for (const auto& pserver : pservers_) {
@@ -88,7 +89,7 @@ void PServerUtil::start() {
8889
}
8990
}
9091

91-
void PServerUtil::join() {
92+
void PServerController::join() {
9293
LOG(INFO) << "pserver sizes : " << pservers_.size();
9394
int i = 0;
9495
for (const auto& pserver : pservers_) {

paddle/pserver/PServerUtil.h renamed to paddle/pserver/PServerController.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@ limitations under the License. */
2121

2222
namespace paddle {
2323

24-
class PServerUtil {
24+
class PServerController {
2525
public:
26-
DISABLE_COPY(PServerUtil);
26+
DISABLE_COPY(PServerController);
2727

2828
/**
2929
* @brief Ctor, Create a PServerUtil from ParameterServerConfig.
3030
*/
31-
explicit PServerUtil(const ParameterServerConfig& config);
31+
explicit PServerController(const ParameterServerConfig& config);
3232

3333
/**
3434
* @brief Dtor.
3535
*/
36-
~PServerUtil();
36+
~PServerController();
3737

3838
/**
3939
* @brief create PServerUtil from gflags, this is used for
4040
* compatibility with the old usage of configuration by gflags.
4141
*/
42-
static PServerUtil* createWithGflags();
42+
static PServerController* createByGflags();
4343

4444
/**
4545
* @brief create PServerUtil with ParameterServerConfig, remove gflags
4646
* from ParameterServer. Init all pservers thread according to the config.
4747
*/
48-
static PServerUtil* create(const ParameterServerConfig& config);
48+
static PServerController* create(const ParameterServerConfig& config);
4949

5050
/**
5151
* @brief start all pserver thread in this PServerUtil.
@@ -64,7 +64,7 @@ class PServerUtil {
6464
* @brief create ParameterServerConfig from gflags, this is used for
6565
* compatibility with the old usage of configuration by gflags.
6666
*/
67-
static ParameterServerConfig* initConfig();
67+
static ParameterServerConfig* initConfigByGflags();
6868
};
6969

7070
} // namespace paddle

paddle/pserver/ParameterServer2Main.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

1515
#include <fstream>
16-
#include "PServerUtil.h"
17-
#include "paddle/trainer/ParamUtil.h"
16+
#include "PServerController.h"
1817

1918
using namespace paddle; // NOLINT
2019

2120
int main(int argc, char** argv) {
2221
initMain(argc, argv);
2322

24-
std::unique_ptr<PServerUtil> pServerPtr(
25-
paddle::PServerUtil::createWithGflags());
23+
std::unique_ptr<PServerController> pServerPtr(
24+
paddle::PServerController::createByGflags());
2625
pServerPtr->start();
2726
pServerPtr->join();
2827

paddle/trainer/TrainerMain.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

1515
#include <fenv.h>
16-
#include "paddle/pserver/PServerUtil.h"
16+
#include "paddle/pserver/PServerController.h"
1717
#include "paddle/utils/Excepts.h"
1818
#include "paddle/utils/PythonUtil.h"
1919

@@ -37,9 +37,9 @@ int main(int argc, char** argv) {
3737
initMain(argc, argv);
3838
initPython(argc, argv);
3939

40-
std::unique_ptr<PServerUtil> pServerPtr(nullptr);
40+
std::unique_ptr<PServerController> pServerPtr(nullptr);
4141
if (FLAGS_start_pserver) {
42-
pServerPtr.reset(paddle::PServerUtil::createWithGflags());
42+
pServerPtr.reset(paddle::PServerController::createByGflags());
4343
pServerPtr->start();
4444
}
4545
Trainer trainer;

0 commit comments

Comments
 (0)