CMPUT 497: Cluster Challenge and Computational Science

Paul Lu
Department of Computing Science
January 2009

Assignment 2: MPI matrix multiplication and granularity

Report Due Date: Thursday, April 2, 2009, in class.

Description:

This assignment is to be done individually and is worth 12.5% of your mark in the course.

The purpose of the assignment is for you to learn more about MPI programming and the impact of granularity on performance.

(NOTE: March 26/09: For this assignment, the number of messages sent via MPI is one measure of granularity. Therefore, reducing the number of MPI messages is one way of improving granularity. For the reasons discussed in class (e.g., TCP/IP), some strategies that improve granularity do not actually translate into better wall-clock time performance. )

There are 3 main components to the assignment:

  1. Download and benchmark the performance of an MPI program: Follow the instructions in the document about MPI and SGE (March 26/09: Version 3 on-line) created by Erkan Unal.

    Also, download the tar file , which contains a simple MPI program for matrix multiplication.

    (March 26/09: SGE job script , from class.)

    Note that you will only be running MPI (directly) on the cluster. You will NOT be installing MPI (it is already installed). And, you will NOT be using your VMs for this assignment.

    The first part of the assignment is to download, build, and run the program as-is. Do some simple benchmarking (e.g., different sizes of matrices, different numbers of processors) to establish a baseline. You should use SGE (see document) so that your fellow students do not run on the same machines as yourself and invalidate the benchmarking.

    Although great care has been taken in preparing the MPI document and the MPI program, mistakes and omissions are possible. Please immediately ask your questions by email to both Erkan (unal@cs.ualberta.ca) and myself.

  2. Modify the MPI program to improve granularity, and re-benchmark: Purposely, the MPI program given to you has poor granularity. Now, you need to try something (anything?) to improve granularity. I am not looking for any substantial re-writes of the program or major algorithmic changes. And, you only need to try one (successful) idea to improve the granularity of the program.

    After your improvements, re-benchmark your MPI program and show how it improves performance.

    HINT: Using non-blocking MPI communications is highly unlikely to result in a performance benefit on our cluster. The short explanation for this is that our hardware/software setup is not particularly well-suited for non-blocking communications. Focus mainly on other strategies for improving performance.

  3. Report:

    Write a 2-page report (1 inch margins, at least 12 point font, single-spaced) answering the following questions:

    1. How did you modify the code to improve granularity? (Include a source code listing; this does NOT count towards the 2-page limit).
    2. What kind of speedups are obtained in Parts 1 and 2?
    3. If the speedups in Part 2 are better than in Part 1, why? How does relate to granularity? Can you measure granularity?

    Obviously, given the 2-page limit, I am not expecting a long discussions. Be precise and concise in answering the above questions.

    Be aware of the Code of Student Behaviour and it how applies to referencing source material, if applicable.

What to hand in:

On the due date, hand in via paper copy and email of your electronic files, your report. We will try to set up meeting times for the demonstration during class.

Marking:

The assignment is worth 12.5% of your final mark in the course. This is an individual assignment. Do not work in groups. You may discuss the assignment with other students, but the report and the setup of SGE and the application must be your individual work.

100% of the marks will be for the report.


General comments on assignments:

  1. In formal writing, such as this assignment or a report to your boss, be careful to not use contractions (e.g., that's, can't, doesn't) and do not use overly colloquial words or phrases (e.g., huge chunk, deal breaker, new kid on the block).
  2. Be careful of making statements that you cannot support with evidence. Your statement might be right. The instructor might have even said it in class. But, unless you can make the argument with the support of facts, or cite a paper or the lecture notes, then it is risky to make such statements.
  3. Be sure to answer all the required questions in your report.