Have fun with MPI in C
02 Point-to-Point communication
04 Collective communications
How to create an MPI cluster machine on Amazon AWS?
- 1 Master Node, where we develop and compile our program for all cluster node.
- N Slaves, where we run the MPI program to execute benchmarks.
Our computing environment Ubuntu with OpenMPI
For running our experiment based on MPI and C language we use a Linux machine running the MPI implementation OpenMPI. The OpenMPI installation requires that all machines in the cluster have configured the same user and exchanged the SSH keys.
For this reason, the repository provides installation scripts to build our computing environment on a Ubuntu Linux machine.
- 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.
- Copy on the MASTER node, from your local machine, the pem key:
scp -i "k.pem" k.pem [email protected]:
- Login on the master node:
ssh -i "k.pem" [email protected]
- Clone the repository:
git clone https://github.com/spagnuolocarmine/ubuntu-openmpi-openmp.git
- Generates the installing script for yourt cluster:
source generateInstall.sh, results in a
install.shscript with new ssh-keys for the cluster.
- The password for pcpc is root. If you like change use:
sudo passwd pcpc
- For each SLAVE instance run the install script from the MASTER node:
ssh -i <path-to-pem-file> <connection-string-for-the-EC2-instace> 'bash -s' < install.sh
- user: pcpc pass: root
- vim, an shell text editor.
- htop, an interactive process viewer for Unix systems.
- OpenMPI 4.0.
- OpenMP included in the GNU GCC (last version).
Moreover, during the environment installation the script also exchanges the ssh key for the user pcpc.
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.