From 8d46d1ddf2dac143bfb009da2205ea68215d5cd8 Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Fri, 15 Jun 2018 17:08:26 +0800 Subject: [PATCH] bug fix --- paddle/fluid/operators/checkpoint_notify_op.cc | 7 ++++--- paddle/fluid/operators/listen_and_serv_op.cc | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/operators/checkpoint_notify_op.cc b/paddle/fluid/operators/checkpoint_notify_op.cc index 1b922e0890..c229cbf498 100644 --- a/paddle/fluid/operators/checkpoint_notify_op.cc +++ b/paddle/fluid/operators/checkpoint_notify_op.cc @@ -39,9 +39,10 @@ class CheckpointNotifyOp : public framework::OperatorBase { detail::RPCClient* rpc_client = detail::RPCClient::GetInstance(); - VLOG(3) << "sending " << ins[i] << " to " << epmap[i] << " to get " - << outs[i] << " back"; - rpc_client->AsyncCheckpointNotify(epmap[i], dir); + for (size_t i = 0; i < epmap.size(); i++) { + VLOG(3) << "sending to " << epmap[i] << " to checkpoint notify ... "; + rpc_client->AsyncCheckpointNotify(epmap[i], dir); + } rpc_client->Wait(); } }; diff --git a/paddle/fluid/operators/listen_and_serv_op.cc b/paddle/fluid/operators/listen_and_serv_op.cc index f235c86ad5..780d47f385 100644 --- a/paddle/fluid/operators/listen_and_serv_op.cc +++ b/paddle/fluid/operators/listen_and_serv_op.cc @@ -300,10 +300,10 @@ void ListenAndServOp::RunImpl(const framework::Scope &scope, } int checkpoint_point_block_id = Attr(kCheckpointBlockId); - auto *ctx = new ExecutorPrepareContext(*program, checkpoint_point_block_id); + auto ctx = executor.Prepare(*program, checkpoint_point_block_id); std::shared_ptr ckpt_pre_context = - std::shared_ptr(ctx); + std::move(ctx); auto f = std::bind(FillRequestCtx, std::placeholders::_1, &recv_scope, &dev_ctx, -- GitLab