fix bug with heart beat , test=develop (#20654)

revert-20712-fix_depthwise_conv
tangwei12 6 years ago committed by GitHub
parent 7783d3bd43
commit 04384502a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,14 +84,7 @@ class HeartBeatMonitor {
be_monitored_var);
}
static HeartBeatMonitor* GetInstance() {
if (monitor_ == nullptr) {
PADDLE_THROW(
"HeartBeatMonitor is not inited, call "
"HeartBeatMonitor::Init first");
}
return monitor_.get();
}
static HeartBeatMonitor* GetInstance() { return monitor_.get(); }
void Stop() {
running_ = false;

@ -53,7 +53,11 @@ bool RequestSendHandler::Handle(const std::string& varname,
rpc_server_->IncreaseBatchBarrier(kRequestSend);
} else if (varname == COMPLETE_MESSAGE) {
VLOG(3) << "sync: recv complete message";
HeartBeatMonitor::GetInstance()->Update(trainer_id, "", COMPLETED);
if (HeartBeatMonitor::GetInstance() != nullptr) {
HeartBeatMonitor::GetInstance()->Update(trainer_id, "", COMPLETED);
}
rpc_server_->Complete();
} else {
// Async

Loading…
Cancel
Save