From 8ea4dcdeadecee539cbd8548a0a8bca1c5c6d4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=85=E5=9B=BD=E9=91=AB?= <745324460@qq.com> Date: Sat, 8 Oct 2022 11:34:49 +0000 Subject: [PATCH] update Tools/ascend_distribute/process_monitor.py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 傅国鑫 <745324460@qq.com> --- Tools/ascend_distribute/process_monitor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tools/ascend_distribute/process_monitor.py b/Tools/ascend_distribute/process_monitor.py index 8966a8124..126af9bd8 100644 --- a/Tools/ascend_distribute/process_monitor.py +++ b/Tools/ascend_distribute/process_monitor.py @@ -85,10 +85,17 @@ def find_all_process(parent_process, sub_parent_dict): return all_sub_parent +def kill_all_process(all_sub_parent): + for sub_parent in all_sub_parent: + for process in sub_parent: + os.kill(process, signal.SIGKILL) + + def main(): parent_process = get_parent_process() sub_parent_dict = get_all_process() all_sub_parent = find_all_process(parent_process, sub_parent_dict) + kill_all_process(all_sub_parent) if __name__ == '__main__': -- Gitee