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

Message passing interface


The general structure of MPI programs is depicted here (please visit the links provided in the introduction for a more in-depth discussion on the topic). Your MPI codes will have elements of this structure:

Basic MPI code

A relatively simple MPI code is shown here. You will notice how the code mirrors the general structure of MPI programs:

 
call-procs.c: 
#include <math.h> // math library 
#include <stdio.h>// Standard Input/Output library 
 
int main(int argc, char** argv) 
{ 
  /* MPI Variables */ 
  int num_processes; 
  int curr_rank; 
  int proc_name_len; 
  char proc_name[MPI_MAX_PROCESSOR_NAME]; 
 
  /* Initialize MPI */ 
  MPI_Init (&argc, &argv); 
 
  /* acquire number of processes */ 
  MPI_Comm_size(MPI_COMM_WORLD, &num_processes); 
 
  /* acquire rank of the current process */ 
  MPI_Comm_rank(MPI_COMM_WORLD, &curr_rank); 
...