@
no1xsyzy 主要是 Popen 貌似有点问题,我是这样写的:
``` python
glps = list(filter(lambda x:'.glp' in x, os.listdir(rootpath+'outputs/')))
num_threads = len(glps)
cmd_list = [['python', '
lithosim_one.py', 'evaluation/lithosim%d/'%i, rootpath+'outputs/'+glps[i]] for i in range(num_threads)]
proc_list = [Popen(cmd, stdout=PIPE, stderr=PIPE) for cmd in cmd_list]
for p in proc_list:
p.wait()
```
假如有 10 个文件要仿真,我的机器是 6 核,它会把 6 个仿完,剩下的 4 个就不继续了,主程序也没有结束。