我想在超级计算机节点的 3 个独立核心处理器上执行 3 个独立的 bash 命令。我有一个 python 脚本,它通过 os.system 将 bash 命令发送到命令行,但是在转到 python 脚本的下一行之前,它似乎执行了 bash 命令以完成。我只想一个接一个地将bash命令发送到命令行。
for i in range(0, len(core), 8) :
os.system("bpsh "+str(1)+" nohup python /home/tree_df_unchuncked.py "+str(' '.join(core[i]))+" 0.01"+" y")
os.system("bpsh "+str(1)+" nohup python /home/tree_df_unchuncked.py "+str(' '.join(core[i+1]))+" 0.01"+" y")
os.system("bpsh "+str(1)+" nohup python /home/tree_df_unchuncked.py "+str(' '.join(core[i+2]))+" 0.01"+" y")