def manage_test_process(queue, f, cpopen):
if queue:
if cpopen is not None:
if cpopen.poll() is None:
return cpopen # not finish
print("OK create new process")
my_env = os.environ.copy()
my_env["CUDA_VISIBLE_DEVICES"] = "" # test on CPU
argument = queue.pop()
popen = subprocess.Popen(argument, stdout=f, stderr=f, env=my_env)
return popen
else:
return cpopen
评论列表
文章目录