Skip to content

Commit 3c71bf3

Browse files
committed
Immediately pause on register
1 parent 1d537c4 commit 3c71bf3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler_opt/rl/compilation_runner.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import subprocess
2323
import threading
2424
import time
25-
from typing import Dict, List, Optional, Tuple, Union
25+
from typing import Dict, List, Optional, Tuple
2626

2727
from absl import flags
2828
from compiler_opt.distributed.worker import Worker, WorkerFuture
@@ -135,7 +135,10 @@ def register_process(self, p: 'subprocess.Popen[bytes]'):
135135
kill_process_ignore_exceptions, (p,)),
136136
time_left=self._timeout,
137137
start_time=time.time())
138-
self._processes[p.pid].timeout.start()
138+
if self._paused:
139+
os.kill(p.pid, signal.SIGSTOP)
140+
else:
141+
self._processes[p.pid].timeout.start()
139142
return
140143
kill_process_ignore_exceptions(p)
141144

0 commit comments

Comments
 (0)