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

Function cleanup_proc

tools/distgraphlaunch.py:20–35  ·  view source on GitHub ↗

This process tries to clean up the remote training tasks.

(get_all_remote_pids, conn)

Source from the content-addressed store, hash-verified

18
19
20def cleanup_proc(get_all_remote_pids, conn):
21 """This process tries to clean up the remote training tasks."""
22 print("cleanupu process runs")
23 # This process should not handle SIGINT.
24 signal.signal(signal.SIGINT, signal.SIG_IGN)
25
26 data = conn.recv()
27 # If the launch process exits normally, this process doesn't need to do anything.
28 if data == "exit":
29 sys.exit(0)
30 else:
31 remote_pids = get_all_remote_pids()
32 # Otherwise, we need to ssh to each machine and kill the training jobs.
33 for (ip, port), pids in remote_pids.items():
34 kill_process(ip, port, pids)
35 print("cleanup process exits")
36
37
38def kill_process(ip, port, pids):

Callers

nothing calls this directly

Calls 3

get_all_remote_pidsFunction · 0.70
kill_processFunction · 0.70
itemsMethod · 0.45

Tested by

no test coverage detected