Computing and Information Science 405

CIS 405 - High Performance Computing: Platforms, Tools, and Effective Strategies for

Computationally and Data Intensive Science

Location:

Spring Semester 2008 — Class Room: Thurston 203

Credits:

2 Credit Hours Satisfactory/Unsatisfactory

8 weeks TTh from 11:40 to 12:55
                           

Office Hours:

By appointment (send email to lifka@cac.cornell.edu)

514A Rhodes Hall

Recommended Text:

Parallel Programming in C with MPI & OpenMP

By: Michael J. Quinn

Note: I’ve requested a copy of the text be put on reserve at the Carpenter Engineering Library
                                             

Abstract:

An introduction to High Performance Computing, HPC,  for graduate students or advanced undergraduate students who will use High Performance Computing as tool in their research.  Various HPC architectural platforms will be described with a focus on computational clusters.  Students will learn how to identify and exploit the various types of parallelism in algorithms and legacy applications.   Understanding how to measure speedup and efficiency and how various bottlenecks affect them will be covered.  Parallel programming with MPI, OpenMP, and task-farming techniques such as the use of web services will be covered in detail.  The goal of the class is for students to gain practical HPC experience for use in their specific fields of research.

  

Prerequisites: Proficiency in C, C++, Fortran, or Fortran 90.

  

Lecture Notes:

(Note: Lectures may contain concepts and examples from the Text book and other Sources Listed Below)

Week 1: Introduction to High Performance Computing
Lectures Notes (
ppt, pdf)

Week 2: Parallel Application Design
Lecture Notes (
ppt, pdf)

Week 3 & 4: Distributed Memory Programming—Using Message Passing Interface, MPI
Lecture Notes (
ppt, pdf)

Week 5: Shared Memory Programming—Using OpenMP
Lecture Notes (
ppt, pdf)

Week 6: Parallel Code Debugging, Performance Tuning, & Scalability
Lecture Notes (ppt, pdf)

Week 7: Wide Area Distributed Computing
Lecture Notes (ppt, pdf)

Week 8: New HPC Strategies—Data Driven Science
Lecture Notes: (ppt, pdf)

Lecture Examples: 
Week 1: Introduction to High Performance Computing
 
helloworld.c
 pi.c
 RoundTrip.c
 sample.bat & helloworld.xml job file (sample.zip)

Week 2: Parallel Application Design
 Simple Data Parallelism example (
dp1.c)

 Simple Functional Parallelism example (fp1.c)

 Simple Task Parallelism example (tp1.c)

 Simple Pipeline Parallelism example (pp1.c)

 Simple example of using malloc for a 2 dimensional array (2d.c)

 Serial 2D Heat Transfer Problem using malloc (heat2d.c)

 Parallel 2D Heat Transfer Problem using malloc (pheat2d.c)

 2D Heat Transfer Movie (heat.wmv)

 Irfanview — A nice image conversion program

 

Week 3 & 4: Distributed Memory Programming—Using Message Passing Interface, MPI

 MPI API example (api_examples.c)

 MPI All to All example  (alltoall.c)

 MPI Gather examples (gather.c & gather2.c)

 MPI BagBoy example (BagBoy.c)

 Serial Bubble Sort example (bubble.c)

 MPI BagBoy Homework solution (bb2.c)

 MPI Parallel Bubble Sort solution (pbub.c)

Week 5: Shared Memory Programming—Using OpenMP
 OpenMP Batch script omp.bat (
omp.zip)
 OpenMP HelloWorld (omp_helloworld.c)
 OpenMP Data Parallelism example (
omp_dp1.c)
 OpenMP Pi example (
omp_pi.c)
 OpenMP heat2d (
omp_heat2d.c)
 OpenMP bubble-sort (odd-even approach) (
omp_bubble.c)
 OpenMP firstprivate example (
omp_1stpriv.c)
 OpenMP lastprivate example (
omp_lastpriv.c)
 OpenMP parallel code block example (
omp_parallel.c)
 OpenMP single clause example (
omp_single.c)
 OpenMP nowait clause example (
omp_nowait.c)
 OpenMP functional parallelism example (
omp_fp1.c)

Week 6: Parallel Code Debugging, Performance Tuning, & Scalability

Week 7: Wide Area Distributed Computing

Week 8: New HPC Strategies—Data Driven Science

 

Assignments (Note: Scroll Down for the class FAQ)
Assignment 1 - Due Thursday 2/7
  1. Read Chapters 1 & 2 in the text.
  2. Sign up for CAC Exploratory Account

      http://www.cac.cornell.edu/documentation/Allocations/Explore.aspx

  3. Identify an HPC problem relevant to your area of research.
      * Obtain source code, batch scripts, and sample data for this problem.
  4.
Email me 3 examples where HPC is used int Cornell research.
  5.
Email me 3 examples where HPC is uses outside of Cornell.
  6.
Email me your name, email addrress, your field of study, and your goals for CIS 405.
      * Note:  The text provides examples of several HPC problems.
  7. Build and Run helloworld example from class in batch on the CAC development nodes.
  8. Run the helloworld example from class interactively on the CAC development nodes.

Assignment 2—Due Thursday 2/21

 1. Build the RoundTrip.c example using mpicc

     - Try to understand how this code works

     - Run RoundTrip.exe in batch using a machines file and 4 development nodes.  Run with 4 and 8 processes

     - Change the number of megabytes sent in the code, rebuild & rerun

     - Email me the output from 3 different runs of this code

 2. Read Chapter 3 in the text book

     - Pay particular attention to section 3.3 — Foster’s Design Methodology

     - Review the text examples that apply Foster’s Methodology

  3. Read Chapters 4-6

      - Pay attention to the various MPI calls and how they are used

  4. Design a parallel version of Bubble Sort.

      - Download serial version (bubble.c)

      - Apply Foster’s Methodology to this problem

      - Write and MPI Implementation for your parallel bubble sort

         - use rand() function to generate a large array of random values to sort

      - Email:

           - Describe each of the 4 steps of Foster’s Methodology for your solution

           - MPI source code for your solution

           - Batch script for running your program

           - Output from your batch run

  5. Modify BagBoy.c example (BagBoy.c) so that:

      - each customer is helped in order

      - once you’ve received all the items for each customer you sort them  so that the heaviest
          items get printed out first (bottom of the bag)

      - Note: groceries array is in order such that smaller indices are “lighter” than higher indices.

      - Email:

           - Source code of your BagBoy solution

           - Batch script to run your program

           - Output from your Batch run

 

Assignment 3 — Due Tuesday 3/25

1. write a serial version of the code “Sieve of Eratosthenes”  Use the following algorithm and perl script as a guide
-
sieve.pl
- “
Sieve of Eratosthenes Algorithm

2. Optimized your serial “Sieve of Eratosthenes” code with OpenMP   

3. Write an MPI version of the “Sieve of Eratosthenes”
Hints:
 - Use MPI_Allreduce to determine the next value of “k”

       - Use MPI_Gather to collect the sub-arrays at the end for the master process to print out. 
          -
gather_int_arrays.c is an example you can use as an example.

 

4. Please fill out Course Survey

 

Assignment 3 Solutions

  OpenMP solution

  MPI solution


Recommended Reading

[1] Using MPI: Portable Parallel Programming with the Message-Passing Interface

By: William Gropp, Ewing Lusk, & Anthony Skjellum
October 1994; ISBN 0-262-57104-8

 

[2] Introduction to Parallel Computing
By: Ted G. Lewis, Hesham El-Rewini
Copyright 1992 - Prentice-Hall Inc.
ISBN: 0-13-498924-4

 

[3] An Introduction to Parallel Programming
By: K. Mani Chandy, Stephen Taylor
Copyright 1992 - Jones and Bartlett Publishers, Inc.
ISBN: 0-86720-208-4

 

[4] Designing and Building Parallel Programs, Concepts and Tools for Parallel Software Engineering
By: Ian Foster
Copyright 1995 - Addison-Wesley Publishing Company, Inc.
ISBN: 0-201-57594-9

 

[5] Introduction to Parallel and Vector Solution of Linear Systems
By: James M. Ortega
Copyright 1988 - Plenum Press
ISBN: 0-306-42862-8

 

[6] Parallel Sorting Algorithms
By: Selim G. Akl
Copyright 1995 - Academic Press, Inc
ISBN: 0-12-047680-0

 

[7] Portable Programs for Parallel Processors
By: James Patterson, Terrence Disz, Ralph Butler, Rick Stevens, Ross Overbeek,Barnett Glickfeld, Ewing Lusk and James Boyle
Copyright 1987 Holt, Rinehart and Winston, Inc.
ISBN: 0-03-014404-3

 

[8] Numerical Analysis, third edition
By: Richard L. Burden, J. Douglas Faires
Copyright 1985 - PWS Publishers
ISBN: 0-87150-857-5

 

[9] Applied Numerical Methods with Software
By: Shoichiro Nakamura
Copyright 1991 - Prentice-Hall, Inc.
ISBN: 0-13-041047-0

 

[10] Parallel Programming with MPI
By: Peter S. Pacheco
Copyright 1997, Morgan Kauffman, San Franciso
ISBN: 1-55860-339-5

 

[11] Message Passing Interface Web Site
http://www.mpi-forum.org/

 

[12] OpenMP Web Site
http://www.openmp.org

 


CIS 405 FAQ:


Question 1:
 
How do I turn in my homework assignments?
Answer 1:
 
Email them to lifka@cac.cornell.edu