Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
5aaaef44
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5aaaef44
编写于
1月 06, 2017
作者:
Q
qiaolongfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename PServerController to ParameterServerController
上级
3f6c2b36
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
31 addition
and
28 deletion
+31
-28
paddle/pserver/CMakeLists.txt
paddle/pserver/CMakeLists.txt
+2
-2
paddle/pserver/ParameterServer2Main.cpp
paddle/pserver/ParameterServer2Main.cpp
+3
-3
paddle/pserver/ParameterServerController.cpp
paddle/pserver/ParameterServerController.cpp
+9
-8
paddle/pserver/ParameterServerController.h
paddle/pserver/ParameterServerController.h
+14
-12
paddle/trainer/TrainerMain.cpp
paddle/trainer/TrainerMain.cpp
+3
-3
未找到文件。
paddle/pserver/CMakeLists.txt
浏览文件 @
5aaaef44
...
...
@@ -25,14 +25,14 @@ set(PSERVER_SOURCES
ParameterClient2.cpp
ParameterServer2.cpp
SparseParameterDistribution.cpp
PServerController.cpp
)
P
arameter
ServerController.cpp
)
set
(
PSERVER_HEADERS
BaseClient.h
ParameterClient2.h
ParameterServer2.h
SparseParameterDistribution.h
PServerController.h
)
P
arameter
ServerController.h
)
add_library
(
paddle_pserver STATIC
${
PSERVER_SOURCES
}
)
...
...
paddle/pserver/ParameterServer2Main.cpp
浏览文件 @
5aaaef44
...
...
@@ -13,15 +13,15 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include <fstream>
#include "PServerController.h"
#include "P
arameter
ServerController.h"
using
namespace
paddle
;
// NOLINT
int
main
(
int
argc
,
char
**
argv
)
{
initMain
(
argc
,
argv
);
std
::
unique_ptr
<
PServerController
>
pServerPtr
(
paddle
::
PServerController
::
createByGflags
());
std
::
unique_ptr
<
P
arameter
ServerController
>
pServerPtr
(
paddle
::
P
arameter
ServerController
::
createByGflags
());
pServerPtr
->
start
();
pServerPtr
->
join
();
...
...
paddle/pserver/PServerController.cpp
→
paddle/pserver/P
arameter
ServerController.cpp
浏览文件 @
5aaaef44
...
...
@@ -12,11 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include "PServerController.h"
#include "P
arameter
ServerController.h"
namespace
paddle
{
PServerController
::
PServerController
(
const
ParameterServerConfig
&
config
)
{
ParameterServerController
::
ParameterServerController
(
const
ParameterServerConfig
&
config
)
{
// round robin to load balance RDMA server ENGINE
std
::
vector
<
std
::
string
>
devices
;
int
rdmaCpu
=
0
;
...
...
@@ -58,9 +59,9 @@ PServerController::PServerController(const ParameterServerConfig& config) {
}
}
P
ServerController
::~
P
ServerController
()
{
this
->
join
();
}
P
arameterServerController
::~
Parameter
ServerController
()
{
this
->
join
();
}
P
ServerController
*
P
ServerController
::
createByGflags
()
{
P
arameterServerController
*
Parameter
ServerController
::
createByGflags
()
{
ParameterServerConfig
config
;
config
.
set_nics
(
FLAGS_nics
);
...
...
@@ -72,12 +73,12 @@ PServerController* PServerController::createByGflags() {
return
create
(
config
);
}
P
ServerController
*
P
ServerController
::
create
(
P
arameterServerController
*
Parameter
ServerController
::
create
(
const
ParameterServerConfig
&
config
)
{
return
new
PServerController
(
config
);
return
new
P
arameter
ServerController
(
config
);
}
void
PServerController
::
start
()
{
void
P
arameter
ServerController
::
start
()
{
LOG
(
INFO
)
<<
"pserver sizes : "
<<
pservers_
.
size
();
int
i
=
0
;
for
(
const
auto
&
pserver
:
pservers_
)
{
...
...
@@ -87,7 +88,7 @@ void PServerController::start() {
}
}
void
PServerController
::
join
()
{
void
P
arameter
ServerController
::
join
()
{
LOG
(
INFO
)
<<
"pserver sizes : "
<<
pservers_
.
size
();
int
i
=
0
;
for
(
const
auto
&
pserver
:
pservers_
)
{
...
...
paddle/pserver/PServerController.h
→
paddle/pserver/P
arameter
ServerController.h
浏览文件 @
5aaaef44
...
...
@@ -21,39 +21,41 @@ limitations under the License. */
namespace
paddle
{
class
PServerController
final
{
class
P
arameter
ServerController
final
{
public:
DISABLE_COPY
(
PServerController
);
DISABLE_COPY
(
P
arameter
ServerController
);
/**
* @brief Ctor, Create a P
ServerUtil
from ParameterServerConfig.
* @brief Ctor, Create a P
arameterServerController
from ParameterServerConfig.
*/
explicit
PServerController
(
const
ParameterServerConfig
&
config
);
explicit
P
arameter
ServerController
(
const
ParameterServerConfig
&
config
);
/**
* @brief Dtor.
*/
~
PServerController
();
~
P
arameter
ServerController
();
/**
* @brief create P
ServerUtil
from gflags, this is used for
* @brief create P
arameterServerController
from gflags, this is used for
* compatibility with the old usage of configuration by gflags.
*/
static
PServerController
*
createByGflags
();
static
P
arameter
ServerController
*
createByGflags
();
/**
* @brief create PServerUtil with ParameterServerConfig, remove gflags
* from ParameterServer. Init all pservers thread according to the config.
* @brief create ParameterServerController with ParameterServerConfig, remove
* gflags from ParameterServer. Init all pservers thread according to the
* config.
*/
static
PServerController
*
create
(
const
ParameterServerConfig
&
config
);
static
P
arameter
ServerController
*
create
(
const
ParameterServerConfig
&
config
);
/**
* @brief start all pserver thread in this P
ServerUtil
.
* @brief start all pserver thread in this P
arameterServerController
.
*/
void
start
();
/**
* @brief join and wait for all pserver thread in this PServerUtil.
* @brief join and wait for all pserver thread in this
* ParameterServerController.
*/
void
join
();
...
...
paddle/trainer/TrainerMain.cpp
浏览文件 @
5aaaef44
...
...
@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include <fenv.h>
#include "paddle/pserver/PServerController.h"
#include "paddle/pserver/P
arameter
ServerController.h"
#include "paddle/utils/Excepts.h"
#include "paddle/utils/PythonUtil.h"
...
...
@@ -37,9 +37,9 @@ int main(int argc, char** argv) {
initMain
(
argc
,
argv
);
initPython
(
argc
,
argv
);
std
::
unique_ptr
<
PServerController
>
pServerPtr
(
nullptr
);
std
::
unique_ptr
<
P
arameter
ServerController
>
pServerPtr
(
nullptr
);
if
(
FLAGS_start_pserver
)
{
pServerPtr
.
reset
(
paddle
::
PServerController
::
createByGflags
());
pServerPtr
.
reset
(
paddle
::
P
arameter
ServerController
::
createByGflags
());
pServerPtr
->
start
();
}
Trainer
trainer
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录