Project for Computer Science Research class.
NOTE: This guide is for Linux/OS X only.
Download latest version of MPICH here.
Compiling MPICH 3.1.2
cd /path/to/project && mkdir tmp && cd tmp
/path/to/mpich-3.1.2/configure --prefix=/path/to/project/lib/mpich --disable-fortran CXXFLAGS="-Wall -g -std=c++11" 2>&1 | tee c.txt
make 2>&1 | tee m.txt
make install 2>&1 | tee mi.txt
rm -rf /path/to/project/tmp
This installation guide was referenced from mpich.org.
NOTE: Before being able to build the project, you need to make sure you have C++ 11 set up.
mpicxx -o nova main.cc
Pi Node Setup
More thorough guide is here.
To set up static IP address for each node, replace everything in the interfaces file with the contents below. You will have to change the values to fit your own network. As for our cluster, just changing the XX values with the number of the Pi node will be enough.
sudo vi /etc/network/interfaces
auto lo eth0 iface lo inet loopback iface eth0 inet static address 10.10.53.1XX netmask 255.255.0.0 gateway 10.10.0.254 dns-nameservers 10.90.0.50 10.90.0.48
It's probably a safe bet to reboot the Pi after doing these configurations. Next you will have to generate a new ssh key to allow the master node to communicate with the current node, freely.
ssh-keygenOverwrite the existing one if it asks for it. Otherwise, just press enter for every prompt it asks.
cp id_rsa.pub pi-NReplace N with the number for the Pi node.
- Copy the pi-00 file to the ~/.ssh/ directory.
cat pi-00 >> authorized_keys
Compiling the test prime program:
mpicxx -o prime prime_mpi.cpp
mpiexec ./primeRun it to check if it compiled correctly.
Write a script to update project on all nodes, from master.
- Set up steps and a download link to a .img file with a pre-configured Raspbian OS will be available soon.