Hardware Reference
In-Depth Information
$ ssh pi@192.168.1.162 'sudo echo "iridispi002" | sudo tee /etc/hostname'
$ ssh pi@192.168.1.163 'sudo echo "iridispi003" | sudo tee /etc/hostname'
$ ssh pi@192.168.1.164 'sudo echo "iridispi004" | sudo tee /etc/hostname'
You should then reboot each worker node.
If you put in the following command again:
$ mpiexec -f machinefile -n 2 ~/mpich_build/examples/cpi
Process 0 of 2 is on raspberrypi
Process 1 of 2 is on iridispi002
pi is approximately 3.1415926544231318, Error is 0.0000000008333387
This shows the master node still called raspberrypi and the first worker called iridis
pi002 , and you see each process running on the separate nodes.
Congratulations! You've built a two-node supercomputer! Continue to build up to 64
(or more!) nodes.
Build More Nodes
You now have a copy of the worker nodes of the machine with all of the installed files
for MPI in a single place. You want to clone this card, because it has the SSH key on it
in the right place. Shut down your Pi ( sudo poweroff ) and eject the card. Put it into
your SD card reader and write the image from your SD Card back to your PC, naming
it wheezy-raspbian_backup_mpi_worker.img .
Eject the card and put a fresh card into the machine. Write the wheezy-
raspbian_backup_mpi_master.img image you created from the PC to your card. Repeat
for each additional node you would like to add.
Use Python Bindings for MPI
Now that your supercomputer is set up, you have options for various Python bindings
for MPI. These instructions will get one of them, mpi4py working (read more about it
at http://mpi4py.scipy.org ) .
Start by installing the package:
$ sudo apt-get install python-mpi4py
You also want to run the demo, so get the source, too:
$ cd ~
$ mkdir mpi4py
$ cd mpi4py
$ wget http://mpi4py.googlecode.com/files/mpi4py-1.3.tar.gz
Search WWH ::




Custom Search