File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
paddle/fluid/operators/distributed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ void RPCServer::WaitBarrier(const std::string& rpc_name) {
56
56
57
57
void RPCServer::IncreaseBatchBarrier (const std::string rpc_name) {
58
58
VLOG (3 ) << " RPCServer begin IncreaseBatchBarrier " << rpc_name;
59
+ // barrier msg should make sure that it's in the right cond(send|recv)
60
+ WaitCond (rpc_name);
59
61
int b = 0 ;
60
62
std::unique_lock<std::mutex> lock (mutex_);
61
63
b = ++barrier_counter_[rpc_name];
@@ -124,7 +126,7 @@ void RPCServer::SetCond(const std::string& rpc_name) {
124
126
}
125
127
126
128
void RPCServer::WaitCond (const std::string& rpc_name) {
127
- VLOG (3 ) << " RPCServer WaitCond " << rpc_name;
129
+ VLOG (3 ) << " RPCServer WaitCond in " << rpc_name;
128
130
int cond = 0 ;
129
131
{
130
132
std::unique_lock<std::mutex> lock (mutex_);
@@ -134,6 +136,7 @@ void RPCServer::WaitCond(const std::string& rpc_name) {
134
136
std::unique_lock<std::mutex> lock (mutex_);
135
137
rpc_cond_.wait (
136
138
lock, [=] { return (cur_cond_.load () == cond || exit_flag_.load ()); });
139
+ VLOG (3 ) << " RPCServer WaitCond out " << rpc_name;
137
140
}
138
141
139
142
void RPCServer::RegisterVar (const std::string& var_name,
You can’t perform that action at this time.
0 commit comments