!29652 Unify server and scheduler exit funcition

Merge pull request !29652 from ZPaC/1.6-unify-exit-for-server-sched
This commit is contained in:
i-robot 2022-01-29 09:33:05 +00:00 committed by Gitee
commit d18c6f630f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 3 deletions

View File

@ -35,7 +35,6 @@ void Scheduler::Run() {
if (!scheduler_node_->Stop()) {
MS_LOG(WARNING) << "Scheduler stop failed.";
}
exit(1);
}
} // namespace ps
} // namespace mindspore

View File

@ -616,7 +616,7 @@ class Model:
outputs = train_network(*inputs)
cb_params.net_outputs = outputs
list_callback.step_end(run_context)
if _is_role_pserver():
if _is_role_pserver() or _is_role_sched():
os._exit(0)
dataset_helper.continue_send()
@ -680,7 +680,7 @@ class Model:
self._loss_scale_manager.update_loss_scale(overflow)
list_callback.step_end(run_context)
if _is_role_pserver():
if _is_role_pserver() or _is_role_sched():
os._exit(0)
should_stop = should_stop or run_context.get_stop_requested()
if should_stop: