
Preface
This book explains how to build and operate a powerful eight or 16-node Pi2 or Pi3 supercomputer. You will be provided detailed systematic instructions on installing the Linux/Ubuntu operating system on your PC, and its use in configuring, communicating with, and ultimately operating your Pi supercomputer.
Initially, you will learn how to write and run a serial and a Message Passing Interface (MPI) π code on your PC, which is then used as a one-node supercomputer. Armed with this knowledge, you will then configure a Pi one-node, 4-core supercomputer on which you subsequently run the previous mentioned MPI π code. Next, you will assemble a two-node, 8-core Pi supercomputer on which, again, you will execute said MPI π code, and finally, you will construct an eight or 16-node Pi supercomputer, which you will employ to solve complex calculations incorporating the MPI construct.
What this book covers
Chapter 1, Getting Started with Supercomputing, provides an overall perspective on the concept of supercomputing. The chapter discusses Von Neumann’s architecture, Flynn’s classical taxonomy, a historical perspective on supercomputing, serial and parallel computing techniques, and justifications – including an analytical perspective – for greater processing speeds.
Chapter 2, One Node Supercomputing, discusses how to do supercomputing on one node, in this instance, your PC. You will be instructed how to install Linux/Ubuntu on your PC, which you will then use to run a serial and MPI π code. Next, you will learn about the critical for
loop construct that is used to assign tasks among the cores/processes. Finally, you will write/copy, and run/generate π from the MPI Euler, Leibniz, and Nilakantha infinite series.
Chapter 3, Preparing the Initial Two Nodes, discusses how to build a two-node Pi supercomputer. Initially, you will be presented with a list of parts. You will then learn about the origin of the Pi microcomputer, and its technical specs. Next, you will be shown how to configure the master node in preparation for transferring the requisite MPI test codes from your PC to the master node. Finally, you will configure the first slave node in preparation for the creation a two-node (master and slave1) supercomputer.
Chapter 4, Static IP Address and Hosts File Setup, discusses how to configure the static IP address of the master, slave1, and network switch. Next, you will learn how to set up the hosts
file.
Chapter 5, Creating a Common User for All Nodes, discusses how to create a new user for the master node, how to create a password for the new user on the master node, how to create a new user for the slave1 node, and how to create a password for the new user on the slave1 node. In addition, you will learn how to generate a special key on the master node, which is required for seamless transitioning between the nodes without using a password. You will then learn how to copy the special key from the master node to the slave1 node. Next, you will edit the .bashrc
file on the master node to facilitate seamless special key access to all the nodes. Finally, you will learn how to use the which
command.
Chapter 6, Creating a Mountable Drive on the Master Node, discusses how to use the mkdir
command to make a directory/folder, the chown
command for changing ownership of the export
drive from the root user to a new user, and the rpcbind
command, which allows the master Pi to export the export
drive on the master to slave nodes. You will learn how to edit the exports file, which at facilitates exporting the export
drive on the master node to the slave nodes, use the nfs-kernel-server
command; edit the bootup script rc.local
, which will make the export
drive on the master node mountable for use by the slave nodes; use the mount
command to manually mount the export
drive containing the MPI codes; use the cat
command to display the content of a file; use the cp -a
command to copy files/codes to the export
drive; and use the -H
command to task any or all nodes; and cores to work on a given problem.
Chapter 7, Configuring the Eight Nodes, discusses how to configure the eight or 16-node Pi supercomputer. You will be shown how to edit the fstab
file on the slave1 node to set up an automatic mount
command, the rc.local
file on the slave1 node to automatically mount the export
drive containing the MPI test code
folder, the hosts
files on the master and slave1 nodes to reflect the temporary IP address, and host names on the remaining six or fourteen slave nodes. You will then be shown how to use the SD formatter for Windows to format the remaining slave SD cards, and win32 Disk Imager to copy the slave1 SD card image to the remaining slave nodes in the cluster. You will then edit/update, once again, the hosts
file on the master and slaves to reflect their actual IP addresses, edit the interfaces
file on the super cluster nodes, and finally, update the MAC and IP address on the network switch for the remaining slave nodes.
Chapter 8, Testing the Super Cluster, discusses how to use the shutdown -h now
command to shut down your Pi computer, the -H
command to solve the MPI π
function in record time, and create convenience bash
files to enhance the user experience while operating the supercomputer.
Chapter 9, Real-World Math Application, discusses how to write and run serial and MPI Taylor series, sine
, cosine
, tangent
, and the natural log
functions.
Chapter 10, Real-World Physics Application, discusses how to write and run the MPI code for a vibrating string.
Chapter 11, Real-World Engineering Application, discusses how to write and run a serial and MPI sawtooth Fourier series code.
What you need for this book
You will need Linux/Ubuntu OS installed on your PC with the option to access the Windows OS, and a basic working knowledge of the C language.
Who this book is for
This book targets hobbyists and enthusiasts who want to explore building supercomputers with microcomputers. Researchers will also find this book useful. Prior programming knowledge is necessary; knowledge of supercomputers is not.
Conventions
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning. Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "How to use the shutdown -h now
command to shut"
Any command-line input or output is written as follows:
alpha@Mst0:/beta/gamma $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2 MPI_08_b
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "On a Windows 7 machine, click on Systems & Security, then click on System, then DeviceManager, and click on Processor."
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail feedback@packtpub.com
, and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Downloading the example code
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
- Log in or register to our website using your e-mail address and password.
- Hover the mouse pointer on the SUPPORT tab at the top.
- Click on Code Downloads & Errata.
- Enter the name of the book in the Search box.
- Select the book for which you're looking to download the code files.
- Choose from the drop-down menu where you purchased this book from.
- Click on Code Download.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
- WinRAR / 7-Zip for Windows
- Zipeg / iZip / UnRarX for Mac
- 7-Zip / PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Build-Supercomputers-with-Raspberry-Pi-3. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Downloading the color images of this book
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from http://www.packtpub.com/sites/default/files/downloads/BuildSupercomputerswithRaspberryPi3_ColorImages.pdf.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—may be a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy. Please contact us at copyright@packtpub.com
with a link to the suspected pirated material. We appreciate your help in protecting our author and our ability to bring you valuable content.
Questions
If you have a problem with any aspect of this book, you can contact us at questions@packtpub.com
, and we will do our best to address the problem.