forked from mindspore-Ecosystem/mindspore
14 lines
436 B
Python
14 lines
436 B
Python
import argparse
|
|
import os
|
|
parser = argparse.ArgumentParser(description="Finish FLClient case")
|
|
parser.add_argument("--kill_tag", type=str, default="mindspore-lite-java-flclient")
|
|
|
|
args, _ = parser.parse_known_args()
|
|
kill_tag = args.kill_tag
|
|
|
|
cmd = "pid=`ps -ef|grep " + kill_tag
|
|
cmd += " |grep -v \"grep\" | grep -v \"finish\" |awk '{print $2}'` && "
|
|
cmd += "for id in $pid; do kill -9 $id && echo \"killed $id\"; done"
|
|
|
|
os.system(cmd)
|