-
Notifications
You must be signed in to change notification settings - Fork 4
Mpirun stuff
which mpirun //Makes sure mpirun is in your path
lscpu //Find out about the hardware you're using (You can find # of cores)
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 --host hostName,hostName2 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 built. 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. Note, check /usr/local/bin and /usr/local/etc. Those are the most likely places the /bin and /etc folders will be.
Example:
<IP address>:4 //OR
frutilla