'How do I run Open MPI jobs on two VMs?
I'm trying to run the hello_ompi program on two Ubuntu virtual machines on my computer.
This program can be found here.
The VMs have two processors and one core per processor. The installed OS is Ubuntu 20.04.3-LTS 64 bit.
The hostfile I'm using is as follows:
192.168.xxx.xxx
192.168.xxx.xxx
I tried:
mpirun -n 2 --hostfile my_hostfile hello_ompi
The ouptut was:
--------------------------------------------------------------------------
mpirun was unable to find the specified executable file, and therefore
did not launch the job. This error was first reported for process
rank 0; it may have occurred for other processes as well.
NOTE: A common cause for this error is misspelling a mpirun command
line parameter option (remember that mpirun interprets the first
unrecognized command line token as the executable).
Node: 192.168.xxx.xxx
Executable: hello_ompi
--------------------------------------------------------------------------
Solution 1:[1]
I realized that the executable needs to be in a directory that is identical to that of the host node. i.e. if on the host node path to the executable is:
/home/youruser/somedir/executable.c
Then on all of the machines in the hostfile the executable must be in the exact same directory on those machines.
The command ran perfectly once I corrected this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Violet |
