Unify server and scheduler exit funcition

This commit is contained in:
ZPaC 2022-01-28 15:38:02 +08:00
parent f6e83e0383
commit 3db62b79ea
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: