Search code examples
sshparallel-processingparamikompiexec

can't execute mpiexec command through ssh


I have multiple VMs and I want to execute parallel processing using these VMs. I wrote a program that uses ssh to connect to the VMs. The mpiexec command should be executed through ssh on the VMs. But, that is not happening and I don't even get an error message

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)

I don't think mpiexec is executing What am I doing wrong ?


Solution

  • Include path to mpiexec, you can get it using the following command on VM

        which mpiexec 
    

    Instead of

       cmd1="mpiexec --wdir /export/validation_files/ -f /export/validation_files/freeVMs.txt -n "+str(numVMs)+" python mulpar_new.py "+ s+" cmd>>matrix_result.txt"
    

    Use

       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"