From b57b880b055a0eab250e5092eb6a5b3e9b1b9ee3 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Mon, 19 Mar 2018 17:15:45 +0800 Subject: [PATCH] Debug --- paddle/fluid/framework/parallel_executor.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 875b5d8ba7a..b5b1e43abfb 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -742,26 +742,29 @@ void ParallelExecutor::Run(const std::vector &fetch_tensors, void ParallelExecutor::RunOp( std::unordered_map> &pending_vars, OpHandle *op) const { - std::vector *> ready_buffer; + std::vector *> *ready_buffer = + new std::vector *>(); for (auto *var : op->outputs_) { - ready_buffer.emplace_back(&pending_vars[var]); + ready_buffer->emplace_back(&pending_vars[var]); } auto op_run = [ready_buffer, op, this] { try { VLOG(10) << op->DebugString(); op->Run(); - for (auto *ready : ready_buffer) { + for (auto *ready : *ready_buffer) { ready->store(true, std::memory_order_release); } + delete ready_buffer; } catch (platform::EnforceNotMet ex) { member_->exception_.reset(new platform::EnforceNotMet(ex)); } catch (...) { LOG(FATAL) << "Unknown exception catched"; } }; - + VLOG(3) << "Enqueue"; member_->pool_.enqueue(op_run); + VLOG(3) << "Done"; } } // namespace framework } // namespace paddle -- GitLab