Book Image

Build Supercomputers with Raspberry Pi 3

By : Carlos R. Morrison
Book Image

Build Supercomputers with Raspberry Pi 3

By: Carlos R. Morrison

Overview of this book

Author Carlos R. Morrison (Staff Scientist, NASA) will empower the uninitiated reader to quickly assemble and operate a Pi3 supercomputer in the shortest possible time. The lifeblood of a supercomputer, the MPI code, is introduced early, and sample MPI code provides additional practice opportunities for you to test the effectiveness of your creation. You will learn how to configure various nodes and switches so that they can effectively communicate with each other. By the end of this book, you will have successfully built a supercomputer and the various applications related to it.
Table of Contents (20 chapters)
Build Supercomputers with Raspberry Pi 3
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Dedication
Preface
6
Creating a Mountable Drive on the Master Node

MPI Fourier series sawtooth signal


We will now generate such a signal by first writing, and running the serial Fourier series sawtooth code, and then apply MPI technique to the sawtooth Fourier series equation depicted here:

The serial sawtooth(x) code is depicted on the following pages. On the master node, write, compile, and run this serial sawtooth(x) code (see the following serial sawtooth(x) code) to get the feel of the program:

/***********************************
* *** Serial sawtooth(x) code *** *
* *
* Fourier series representation *
* of the sawtooth(x) function. *
* *
* Author: Carlos R. Morrison *
* *
* Date: 2/12/2017 *
***********************************/
#include <math.h> // math library
#include <stdio.h>// Standard Input/Output library
int main(void)
{
int j;
unsigned long int i;
double sum0,sum1,A,B,C;
double D[100]={0},x[100]={0},d,dd=10.00,o,oo=10.0*(M_PI/180);
float Amp...