Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
63cd5fb0
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
63cd5fb0
编写于
3月 30, 2018
作者:
Q
Qiao Longfei
提交者:
GitHub
3月 30, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9523 from jacquesqiao/fix-test_send_recv
fix send_recv_op_test
上级
527e6585
9583dc3b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
7 deletion
+7
-7
paddle/fluid/operators/detail/grpc_server.cc
paddle/fluid/operators/detail/grpc_server.cc
+5
-5
paddle/fluid/operators/listen_and_serv_op.cc
paddle/fluid/operators/listen_and_serv_op.cc
+0
-1
paddle/fluid/operators/send_recv_op_test.cc
paddle/fluid/operators/send_recv_op_test.cc
+2
-1
未找到文件。
paddle/fluid/operators/detail/grpc_server.cc
浏览文件 @
63cd5fb0
...
@@ -174,13 +174,13 @@ void AsyncGRPCServer::ShutdownQueue() {
...
@@ -174,13 +174,13 @@ void AsyncGRPCServer::ShutdownQueue() {
std
::
unique_lock
<
std
::
mutex
>
lock
(
cq_mutex_
);
std
::
unique_lock
<
std
::
mutex
>
lock
(
cq_mutex_
);
cq_send_
->
Shutdown
();
cq_send_
->
Shutdown
();
cq_get_
->
Shutdown
();
cq_get_
->
Shutdown
();
is_shut_down_
=
true
;
}
}
// This URL explains why shutdown is complicate:
// This URL explains why shutdown is complicate:
void
AsyncGRPCServer
::
ShutDown
()
{
void
AsyncGRPCServer
::
ShutDown
()
{
server_
->
Shutdown
()
;
is_shut_down_
=
true
;
ShutdownQueue
();
ShutdownQueue
();
server_
->
Shutdown
();
}
}
void
AsyncGRPCServer
::
TryToRegisterNewSendOne
()
{
void
AsyncGRPCServer
::
TryToRegisterNewSendOne
()
{
...
@@ -213,14 +213,14 @@ void AsyncGRPCServer::HandleRequest(::grpc::ServerCompletionQueue* cq,
...
@@ -213,14 +213,14 @@ void AsyncGRPCServer::HandleRequest(::grpc::ServerCompletionQueue* cq,
bool
ok
=
false
;
bool
ok
=
false
;
while
(
true
)
{
while
(
true
)
{
if
(
!
cq
->
Next
(
&
tag
,
&
ok
))
{
if
(
!
cq
->
Next
(
&
tag
,
&
ok
))
{
LOG
(
INFO
)
<<
cq_name
<<
"
get
CompletionQueue shutdown!"
;
LOG
(
INFO
)
<<
cq_name
<<
" CompletionQueue shutdown!"
;
break
;
break
;
}
}
PADDLE_ENFORCE
(
tag
);
PADDLE_ENFORCE
(
tag
);
// FIXME(typhoonzero): de-couple the barriers with recv_op
// FIXME(typhoonzero): de-couple the barriers with recv_op
if
(
cq_name
==
"cq_get"
)
WaitCond
(
1
);
if
(
!
is_shut_down_
&&
cq_name
==
"cq_get"
)
WaitCond
(
1
);
if
(
cq_name
==
"cq_send"
)
WaitCond
(
0
);
if
(
!
is_shut_down_
&&
cq_name
==
"cq_send"
)
WaitCond
(
0
);
RequestBase
*
base
=
(
RequestBase
*
)
tag
;
RequestBase
*
base
=
(
RequestBase
*
)
tag
;
// reference:
// reference:
...
...
paddle/fluid/operators/listen_and_serv_op.cc
浏览文件 @
63cd5fb0
...
@@ -88,7 +88,6 @@ class ListenAndServOp : public framework::OperatorBase {
...
@@ -88,7 +88,6 @@ class ListenAndServOp : public framework::OperatorBase {
void
Stop
()
override
{
void
Stop
()
override
{
rpc_service_
->
Push
(
LISTEN_TERMINATE_MESSAGE
);
rpc_service_
->
Push
(
LISTEN_TERMINATE_MESSAGE
);
rpc_service_
->
ShutDown
();
server_thread_
->
join
();
server_thread_
->
join
();
}
}
...
...
paddle/fluid/operators/send_recv_op_test.cc
浏览文件 @
63cd5fb0
...
@@ -122,7 +122,8 @@ void StartServerNet(bool is_sparse) {
...
@@ -122,7 +122,8 @@ void StartServerNet(bool is_sparse) {
// sub program run in listen_and_serv_op, for simple test we use sum
// sub program run in listen_and_serv_op, for simple test we use sum
f
::
ProgramDesc
program
;
f
::
ProgramDesc
program
;
f
::
BlockDesc
*
optimize_block
=
program
.
MutableBlock
(
0
);
const
auto
&
root_block
=
program
.
Block
(
0
);
auto
*
optimize_block
=
program
.
AppendBlock
(
root_block
);
// X for server side tensors, RX for received tensers, must be of same shape.
// X for server side tensors, RX for received tensers, must be of same shape.
AddOp
(
"sum"
,
{{
"X"
,
{
"x0"
,
"x1"
}}},
{{
"Out"
,
{
"Out"
}}},
{},
optimize_block
);
AddOp
(
"sum"
,
{{
"X"
,
{
"x0"
,
"x1"
}}},
{{
"Out"
,
{
"Out"
}}},
{},
optimize_block
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录