From 77c6b71ec44e3ba5220576fa528f3600b8784908 Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Thu, 10 May 2018 20:03:13 +0800 Subject: [PATCH] add ckpt to sync loop --- paddle/fluid/operators/listen_and_serv_op.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/paddle/fluid/operators/listen_and_serv_op.cc b/paddle/fluid/operators/listen_and_serv_op.cc index 8acbf82025..7fb7f07a61 100644 --- a/paddle/fluid/operators/listen_and_serv_op.cc +++ b/paddle/fluid/operators/listen_and_serv_op.cc @@ -101,6 +101,7 @@ void ListenAndServOp::RunSyncLoop(framework::Executor *executor, framework::Scope *recv_scope, framework::BlockDesc *prefetch_block) const { auto fan_in = Attr("Fanin"); + auto checkpoint = Attr("Checkpoint"); size_t num_blocks = program->Size(); PADDLE_ENFORCE_GE(num_blocks, 2, @@ -188,6 +189,18 @@ void ListenAndServOp::RunSyncLoop(framework::Executor *executor, for (auto &var : sparse_vars) { var->GetMutable()->mutable_rows()->clear(); } + + /******************** CHECK POINT ***********************/ + std::vector all_vars = recv_scope.LocalVarNames(); + + std::vector::iterator it; + for (it = all_vars.begin(); it != all_vars.end(); it++) { + VLOG(2) << "Checkpoint Var: " << *it; + break; + } + + /******************** CHECK POINT ***********************/ + rpc_service_->SetCond(1); // FIXME(typhoonzero): use another condition to sync wait clients get. rpc_service_->WaitClientGet(fan_in);