MCPcopy Index your code
hub / github.com/apache/tvm / kill

Method kill

python/tvm/support/popen_pool.py:128–158  ·  view source on GitHub ↗

Kill the current running process and cleanup. Note ---- The worker can start a new process when send is called again.

(self)

Source from the content-addressed store, hash-verified

126 pass
127
128 def kill(self):
129 """Kill the current running process and cleanup.
130
131 Note
132 ----
133 The worker can start a new process when send is called again.
134 """
135 if self._proc is not None:
136 # allow gracefully shutdown
137 try:
138 self._writer.close()
139 except OSError:
140 pass
141 try:
142 self._reader.close()
143 except OSError:
144 pass
145 # kill all child processes recursively
146 try:
147 kill_child_processes(self._proc.pid)
148 except TypeError:
149 pass
150 try:
151 self._proc.kill()
152 except OSError:
153 pass
154
155 # Join the child process to avoid zombie processes
156 self.join(timeout=1.0)
157 self._proc = None
158 self._remaining_uses = None
159
160 def _start(self):
161 """Start a new subprocess if nothing is available"""

Callers 9

__del__Method · 0.95
sendMethod · 0.95
_child_process_errorMethod · 0.95
recvMethod · 0.95
kill_child_processesFunction · 0.45
shutdownMethod · 0.45
__del__Method · 0.45
_run_in_fresh_processFunction · 0.45
__del__Method · 0.45

Calls 3

joinMethod · 0.95
kill_child_processesFunction · 0.85
closeMethod · 0.65

Tested by 3

__del__Method · 0.36
_run_in_fresh_processFunction · 0.36
__del__Method · 0.36