This repository was archived by the owner on Jul 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Mpirun stuff
Dylan Christopherson edited this page Aug 3, 2018
·
24 revisions
which mpirun
lscpu //Find out about the hardware you're using
mpirun -np 3 /full/path/to/file/hello_c
mpirun -np 3 --display-map /full/path/to/file/hello_c
mpirun -np 3 --oversubscribe /full/path/to/file/hello_c
mpirun -np 2 -host hostName file
mpirun -np 2 fileName : -np 2 fileName //Run two files
https://www.open-mpi.org/faq/?category=running#mpirun-hostfile Create a file and add the name of the hosts into it. My host file is called "myhosts". In it, I just have the hostname of my raspberry pi.
mpirun -np 8 --hostfile myhosts fileName
You can use mpirun in files too to run multiple commands or refer to multiple files:
mpirun --app my_appfile
In my_appfile:
-np 2 fileName
-np 2 anotherName
A great way to check where your tests/jobs are running is to create a runs on script:
runsOn.sh
#!/bin/sh
echo "Machine test: $HOSTNAME"
Example of an MCA parameter (See the "backbone" section for more info)
mpirun -np 4 -mca plm_rsh_args "-p2222" ls //Allows the use of port 2222 for ssh instead of the default 22
Locate the openmpi-default-hostfile file. It's located where Open MPI was build. All of the Open MPI commands will be located in /bin of this folder while the hostfile is located in the /etc folder that is at the same level as the /bin folder. Add the ip address or hostname to it.
Example:
<IP address>:4 //OR
frutilla