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

Function get_killed_pids

tools/distgraphlaunch.py:78–95  ·  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

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