MCPcopy
hub / github.com/dmlc/dgl / get_killed_pids

Function get_killed_pids

tools/launch.py:76–93  ·  view source on GitHub ↗

Get the process IDs that we want to kill but are still alive.

(ip, port, killed_pids)

Source from the content-addressed store, hash-verified

74
75
76def get_killed_pids(ip, port, killed_pids):
77 """Get the process IDs that we want to kill but are still alive."""
78 killed_pids = [str(pid) for pid in killed_pids]
79 killed_pids = ",".join(killed_pids)
80 ps_cmd = (
81 "ssh -o StrictHostKeyChecking=no -p "
82 + str(port)
83 + " "
84 + ip
85 + " 'ps -p {} -h'".format(killed_pids)
86 )
87 res = subprocess.run(ps_cmd, shell=True, stdout=subprocess.PIPE)
88 pids = []
89 for p in res.stdout.decode("utf-8").split("\n"):
90 l = p.split()
91 if len(l) > 0:
92 pids.append(int(l[0]))
93 return pids
94
95
96def execute_remote(

Callers 1

kill_processFunction · 0.70

Calls 5

formatMethod · 0.80
appendMethod · 0.80
joinMethod · 0.45
runMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected