Browse Source

fix executor last task not clear

pull/14163/head
kswang 4 years ago
parent
commit
32b19aef59
2 changed files with 7 additions and 1 deletions
  1. +6
    -1
      mindspore/ccsrc/backend/session/executor.cc
  2. +1
    -0
      mindspore/ccsrc/backend/session/executor.h

+ 6
- 1
mindspore/ccsrc/backend/session/executor.cc View File

@@ -217,12 +217,17 @@ void Executor::OnEvent(const ExecutorEvent &event) {
if (event == ExecutorEvent::kRunGraphFinished) { if (event == ExecutorEvent::kRunGraphFinished) {
OnRunGraphFinished(); OnRunGraphFinished();
} else if (event == ExecutorEvent::kClear) { } else if (event == ExecutorEvent::kClear) {
WorkerJoin();
OnClear();
} else if (event == ExecutorEvent::kException) { } else if (event == ExecutorEvent::kException) {
OnException(); OnException();
} }
} }


void Executor::OnClear() {
WorkerJoin();
ClearDoneTasks();
}

void Executor::OnException() { void Executor::OnException() {
std::vector<std::shared_ptr<Task>> new_done_tasks; std::vector<std::shared_ptr<Task>> new_done_tasks;
{ {


+ 1
- 0
mindspore/ccsrc/backend/session/executor.h View File

@@ -176,6 +176,7 @@ class Executor {
bool IsTaskReady(const std::shared_ptr<RunGraphTask> &task); bool IsTaskReady(const std::shared_ptr<RunGraphTask> &task);
void WaitLockedInputs(const SessionPtr &session, const std::shared_ptr<RunGraphTask> &task); void WaitLockedInputs(const SessionPtr &session, const std::shared_ptr<RunGraphTask> &task);
void OnWorkerExit(); void OnWorkerExit();
void OnClear();
void OnRunGraphFinished(); void OnRunGraphFinished();
void OnException(); void OnException();
void ClearDoneTasks(); void ClearDoneTasks();


Loading…
Cancel
Save