Parallel Scientific Computing in C++ and MPI

Chapter 5 Overview


Book Chapter Introduction

In this chapter we consider explicit discretizations of space- and time-derivatives.  In such discretizations we can express directly a derivative at one grid point in terms of function values at adjacent grid points (spatial discretizations) or in terms of previous time levels (temporal discretizations).  This, in turn, implies that there is no implicit coupling, and thus there is no matrix inversion involved but instead simple daxpy

The material in this chapter is relatively easy to program both on serial as well as on parallel computers.  It is appropriate for demonstrating fundamental concepts of discretization as well as primary constructs of the C++ language and of the MPI library.  Specifically, we will demonstrate the use of loops, arrays, functions and passing functions to functions.  In addition to presenting MPI_Send and MPI_RecvMPI_Sendrecv and MPI_Sendrecv_replace as alternative advanced MPI function calls for parallelizing finite differences discretizations. 


SCchapter5 Introduction and Chapter 5 Driver Programs

    Within the text, there are several places where the software suite is referenced.  In some cases the code is explicitly placed within the text, and at other times within the text we merely alert you that the software is available on this CD.  As you read through Chapter 5, you will find that the following function/classes were discussed.


    The declarations and definitions of these functions/classes can be found in the following files:

Go to the file SCchapter5.h for function/class declarations
Go to the file SCchapter5.cpp for function/class definitions
    In the case that an entire program (meaning that a main() function is provided) is presented in the text, we classify this as a driver program.  Unlike the functions/classes above, driver programs are complete C++ programs which can be compiled and executed.  As you read through the book, you will see that driver programs are often times created by using functions/classes which are in the SCchapter files.  We denote driver programs which are explicitly given in the text of the book in red.  In some chapters, we present very few driver programs explicitly in the text, however we provide some example driver programs which demonstrate how to use the functions/classes with in SCchapter files.  Such driver programs are denoted in black.

 
Section 5.1.2: Program for testing the non-periodic first and second derivative approximation routines chapter5c0.cpp
Section 5.1.2: Program for testing the periodic first and second derivative approximation routines chapter5c1.cpp
Section 5.1.3: MPI - Program for testing the non-periodic parallel first and second derivative approximation routines chapter5c2P.cpp
Section 5.1.3: MPI - Program for testing the periodic parallel first and second derivative approximation routines chapter5c3P.cpp