This project provides scripts and tutorial to install OpenMPI and OpenMP on a Ubuntu Linux.
- Ubuntu Linux 18.04 LTS Server Edition - Amzon AMI ami-0f65671a86f061fcd
- SSH Key
- 1 Master Node, here you have to generate the ssh-key and update the script.
- N Slaves, here you have to run the script using the keys generated on the master node.
Execute che command ssh-keygen
.
Note. By using this command without parameters the key is stored in the folder .ssh, in the file id_rsa e id_rsa.pub.
Change the file install.sh with the generated key.
Run the script on you machine source install.sh
.
The program will create a new user pcpc and exchanges the given ssh keys.
After the installation manually connect on each node to share youy SSH id.
- user: pcpc
- vim
- htop
- OpenMPI 4.0
- OpenMP included in the GNU GCC (last version)
You can test your local environment using the program test.c.
- Compile the program:
mpicc -fopenmp test.c -o test
- Run the porgram:
mpirun -np 2 ./test
You can run directly on an homogeneous cluster machine that has been built using the same install script. You can run: mpirun -np 2 --hostfile hfile ./test
.
An example host-file is:
# This is an example hostfile. Comments begin with #
#
# The following node is a single processor machine:
foo.example.com
# The following node is a dual-processor machine:
bar.example.com slots=2
# The following node is a quad-processor machine, and we absolutely
# want to disallow over-subscribing it:
yow.example.com slots=4 max-slots=4
- Matteo D'Auria (University of Salerno)
- Carmine Spagnuolo (University of Salerno)