我有多个虚拟机,我想使用这些虚拟机执行并行处理。我写了一个程序,它使用ssh连接到VM。应该通过VM上的ssh执行mpiexec命令。 但是,这种情况并没有发生,我甚至没有收到错误消息
ssh=paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ips_in_file[0]) # connecting to the VM
cmd1="mpiexec --wdir /export/validation_files/ -f /export/validation_files/freeVMs.txt -n "+str(numVMs)+" python mulpar_new.py "+ s+" cmd>>matrix_result.txt"
ssh.exec_command(cmd1)
我不认为mpiexec正在执行 我做错了什么?
答案 0 :(得分:0)
包含mpiexec的路径,您可以使用VM上的以下命令获取它
which mpiexec
而不是
cmd1="mpiexec --wdir /export/validation_files/ -f /export/validation_files/freeVMs.txt -n "+str(numVMs)+" python mulpar_new.py "+ s+" cmd>>matrix_result.txt"
使用
cmd1="<path to mpiexec>mpiexec --wdir /export/validation_files/ -f /export/validation_files/freeVMs.txt -n "+str(numVMs)+" python mulpar_new.py "+ s+" cmd>>matrix_result.txt"