fix the bug of non-exit, test=develop (#27350)

revert-27520-disable_pr
lilong12 5 years ago committed by GitHub
parent d773c6c94e
commit 9f9d15e285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -441,6 +441,7 @@ class SectionWorker : public DeviceWorker {
skip_vars_ = skip_vars;
}
static void ResetBatchId() { batch_id_ = 0; }
static void ResetThreadCompletedFlag() { threads_completed = false; }
static std::atomic<int> cpu_id_;

@ -251,6 +251,7 @@ void PipelineTrainer::Finalize() {
}
root_scope_->DropKids();
SectionWorker::ResetBatchId();
SectionWorker::ResetThreadCompletedFlag();
}
Scope* PipelineTrainer::GetWorkerScope(int thread_id) {

@ -196,7 +196,6 @@ void SectionWorker::TrainFiles() {
if (threads_completed) {
VLOG(3) << "thread " << thread_id_ << " completed.";
lk.unlock();
threads_completed = false;
return;
}
lk.unlock();
@ -459,7 +458,6 @@ void SectionWorker::TrainFilesWithProfiler() {
<< ", mean_time: " << op_total_time[i] / op_count[i];
}
VLOG(0) << "================================";
threads_completed = false;
return;
}
lk.unlock();

Loading…
Cancel
Save