Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
f82cb635
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看板
提交
f82cb635
编写于
4月 27, 2018
作者:
Q
qiaolongfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
optimize code, add more log
上级
98a2179f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
5 deletion
+8
-5
paddle/fluid/operators/detail/grpc_server.cc
paddle/fluid/operators/detail/grpc_server.cc
+1
-1
paddle/fluid/operators/listen_and_serv_op.cc
paddle/fluid/operators/listen_and_serv_op.cc
+7
-4
未找到文件。
paddle/fluid/operators/detail/grpc_server.cc
浏览文件 @
f82cb635
...
@@ -336,9 +336,9 @@ void AsyncGRPCServer::HandleRequest(::grpc::ServerCompletionQueue* cq,
...
@@ -336,9 +336,9 @@ void AsyncGRPCServer::HandleRequest(::grpc::ServerCompletionQueue* cq,
switch
(
base
->
Status
())
{
switch
(
base
->
Status
())
{
case
PROCESS
:
{
case
PROCESS
:
{
VLOG
(
4
)
<<
cq_name
<<
" PROCESS status:"
<<
base
->
Status
();
TryToRegisterNewOne
();
TryToRegisterNewOne
();
base
->
Process
();
base
->
Process
();
VLOG
(
4
)
<<
cq_name
<<
" PROCESS status:"
<<
base
->
Status
();
break
;
break
;
}
}
case
FINISH
:
{
case
FINISH
:
{
...
...
paddle/fluid/operators/listen_and_serv_op.cc
浏览文件 @
f82cb635
...
@@ -188,9 +188,11 @@ void ListenAndServOp::RunSyncLoop(framework::Executor *executor,
...
@@ -188,9 +188,11 @@ void ListenAndServOp::RunSyncLoop(framework::Executor *executor,
}
}
static
void
AsyncUpdateThread
(
static
void
AsyncUpdateThread
(
const
bool
&
exit_flag
,
const
std
::
shared_ptr
<
detail
::
ReceivedQueue
>
&
queue
,
const
std
::
string
&
var_name
,
const
bool
&
exit_flag
,
const
std
::
shared_ptr
<
detail
::
ReceivedQueue
>
&
queue
,
framework
::
Executor
*
executor
,
framework
::
Executor
*
executor
,
framework
::
ExecutorPrepareContext
*
prepared
)
{
framework
::
ExecutorPrepareContext
*
prepared
)
{
VLOG
(
3
)
<<
"update thread for "
<<
var_name
<<
" started"
;
while
(
!
exit_flag
)
{
while
(
!
exit_flag
)
{
const
detail
::
ReceivedMessage
v
=
queue
->
Pop
();
const
detail
::
ReceivedMessage
v
=
queue
->
Pop
();
auto
recv_var_name
=
v
.
first
;
auto
recv_var_name
=
v
.
first
;
...
@@ -206,6 +208,7 @@ static void AsyncUpdateThread(
...
@@ -206,6 +208,7 @@ static void AsyncUpdateThread(
LOG
(
ERROR
)
<<
"run sub program error "
<<
e
.
what
();
LOG
(
ERROR
)
<<
"run sub program error "
<<
e
.
what
();
}
}
}
}
VLOG
(
3
)
<<
"update thread for "
<<
var_name
<<
" ended"
;
}
}
void
ListenAndServOp
::
RunAsyncLoop
(
framework
::
Executor
*
executor
,
void
ListenAndServOp
::
RunAsyncLoop
(
framework
::
Executor
*
executor
,
...
@@ -246,7 +249,6 @@ void ListenAndServOp::RunAsyncLoop(framework::Executor *executor,
...
@@ -246,7 +249,6 @@ void ListenAndServOp::RunAsyncLoop(framework::Executor *executor,
grad_to_prepared_ctx
[
id_to_grad
[
block_list
[
i
]]]
=
optimize_prepared
[
i
];
grad_to_prepared_ctx
[
id_to_grad
[
block_list
[
i
]]]
=
optimize_prepared
[
i
];
}
}
VLOG
(
3
)
<<
"RunAsyncLoop into while"
;
bool
exit_flag
=
false
;
bool
exit_flag
=
false
;
VLOG
(
3
)
<<
"start async optimize threads"
;
VLOG
(
3
)
<<
"start async optimize threads"
;
...
@@ -255,11 +257,12 @@ void ListenAndServOp::RunAsyncLoop(framework::Executor *executor,
...
@@ -255,11 +257,12 @@ void ListenAndServOp::RunAsyncLoop(framework::Executor *executor,
std
::
string
grad_name
=
iter
->
first
;
std
::
string
grad_name
=
iter
->
first
;
fs
.
push_back
(
framework
::
Async
([
grad_name
,
&
exit_flag
,
&
executor
,
fs
.
push_back
(
framework
::
Async
([
grad_name
,
&
exit_flag
,
&
executor
,
&
grad_to_queue
,
&
grad_to_prepared_ctx
]()
{
&
grad_to_queue
,
&
grad_to_prepared_ctx
]()
{
AsyncUpdateThread
(
exit_flag
,
grad_to_queue
[
grad_name
],
executor
,
AsyncUpdateThread
(
grad_name
,
exit_flag
,
grad_to_queue
[
grad_name
]
,
grad_to_prepared_ctx
[
grad_name
].
get
());
executor
,
grad_to_prepared_ctx
[
grad_name
].
get
());
}));
}));
}
}
VLOG
(
3
)
<<
"RunAsyncLoop into while"
;
while
(
!
exit_flag
)
{
while
(
!
exit_flag
)
{
const
detail
::
ReceivedMessage
v
=
rpc_service_
->
Get
();
const
detail
::
ReceivedMessage
v
=
rpc_service_
->
Get
();
auto
recv_var_name
=
v
.
first
;
auto
recv_var_name
=
v
.
first
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录