Browse Source

signal int handler

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
tags/v1.2.0-rc1
zhoufeng 4 years ago
parent
commit
3a4eda82aa
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      mindspore/ccsrc/runtime/device/ascend/signal_util.cc

+ 3
- 1
mindspore/ccsrc/runtime/device/ascend/signal_util.cc View File

@@ -46,6 +46,8 @@ void SignalGuard::RegisterHandlers() {

void SignalGuard::IntHandler(int, siginfo_t *, void *) {
kernel::AscendKernelBuildClient::Instance().Close();
MS_LOG_EXCEPTION << "KeyboardInterrupt";
int this_pid = getpid();
MS_LOG(WARNING) << "Process " << this_pid << " receive KeyboardInterrupt signal.";
(void)kill(this_pid, SIGTERM);
}
} // namespace mindspore

Loading…
Cancel
Save