Visualize Numerical Integration

Libby Shoop and Ivana Marincic, Macalester College
Author Profile
Initial Publication Date: July 22, 2014


This is an activity with working code supplied that enables students to see how various forms of the data decomposition pattern map processing units to computations. The problem we use is numerical integration: approximation of the integral over an interval using the sum of areas of rectangles. Students run examples in OpenMP (threads) and/or MPI (processes) and a depiction of which processing units (either processes or threads) computed each rectangle is played back slow enough to see how the computation took place.

Used this activity? Share your experiences and modifications

Learning Goals

  • Students will be able to describe the types of data decomposition patterns that can be used in
    • distributed message passing situations using MPI,
    • shared-memory situations using OpenMP, and
    • hybrid cases, using both message passing and OpenMP

Context for Use

At a minimum, you will need a multicore machine with an OpenMP C compiler, such as gcc. This machine and any client from which the student would log in remotely will also need X11. If you want the MPI examples, you will need to compile and run the supplied code on a single machine or cluster with MPICH2 installed. This is an activity students can step through during class or lab. It is also quite suitable as an instructor demonstration in class.

Description and Teaching Materials

You can visit the module in your browser:

Concept: Data Decomposition Pattern

or you can download the module in either PDF format or latex format.

PDF Format: VisualizeNumericalIntegration.pdf.
Latex Format: VisualizeNumericalIntegration.tar.gz.
Word Format: VisualizeNumericalIntegration.docx.

Teaching Notes and Tips



No assessment instruments available.

References and Resources


Comment? Start the discussion about Visualize Numerical Integration