CSE 260 Homework #2
Due Thursday 10/13/05 in class
Worth 20 points

Change log

Date Description
4-Oct-05 Added discussion about convergence testing.

Introduction

In this assignment you'll implement the 1D and 2D Jacobi method discussed in class and take measurements on Valkyrie. Please verify ASAP that your login works on Valkyrie, and that you have access to the web board. Here are some notes on Getting Started with Valkyrie.

You may work in a team for this assignment. If you are a team of 3, then please see me as I will require a more ambitious design.


The assignment

Implement the code in one dimension first. A Matlab implementation (single processor) is available on Valkyrie in $PUB/examples/jac3d_matlab. Once you have implemented the code, take the measurements below. Next implement the 2D case, and repeat the measurements. You need only implement 1 dimensional (strip) partitioning.

Recall that Jacobi's method has a quadratic running time in N, so it will be unlikely that you will see the solution converge in a reasonable amount of time even for large values of the convergence threshold. However, you should display the residual at the end of the run. Be sure to mention in your report which metric, L2, Max, etc. that you used to measure the residual vector.

  1. Run on 1, 2, 4, and 8 processors with a fixed workload and report the parallel efficiency. Establish a problem size N and the number iterations T such that a run on 8 processors completes in about 5 seconds. For each number of processors repeat the run several times and report the best timings. Did you notice any variations in running times?
  2. Does performance taper off as you increase P? Why is this the case?
  3. Measure communication overhead, and comment on it. Are there any trends? It can be difficult to time the communication calls, so a more reliable technique in the case of Jacobi is to measure communication indirectly using the following procedure. Modify your code so that you can disable all communication. Repeat the runs in (1) with communication disabled, and report communication times as the difference between the resultant times and the timings you obtained in (1).
  4. Finally, report scaled efficiency timings by increasing the workload linearly as you increase P. Repeat parts (1), (2), and (3).

How to take timings

If you had the machine to yourself, running times would be reproducible. However, since we will be sharing the machine, your timings measurements will reflect switch contention from other jobs. To help approximate a dedicate environment, we will filter out spurious timings: run the program several times until you see consistent results. You should use no more than 8 processes for this experiment.

Use MPI's timer function MPI_Wtime() to measure wall clock times as in the following code fragment:

	double t0   = MPI_Wtime(); 
        // some code....
	double t1   = MPI_Wtime();
	double time = (t1-t0);

The man-page for MPI_Wtime() is found on line. Note, however, that all times are reported in seconds, and there is no need to divide by MPI_Wtick() to convert to seconds. (You can obtain the resolution of MPI_Wtime using MPI_Wtick())


Things you should turn in

Document your work in a well-written report which discusses your findings carefully. Hand in a copy of your report in class. Your report should present a clear evaluation of the design of your code, including bottlenecks of the implementation, and describe any special coding or tuned parameters. Be sure to include the plots described above, along with any plotted data in tabular form.

Your report should cite any written  works or software as appropriate in the text of the report. Citations should include any software you used that was written by someone else, or that was written by you for purposes other than this class, i.e. plotting packages and the like (do NOT use someone else's MPI application code, however.)

If you use a machine other than Valkyrie, please mention this in your report.


Electronic turnin instructions

Important. Please follows these instructions carefully.

Transmit an electronic copy of your report as a compressed archive file, e.g. .zip, .tgz, .tar.gz. Organize the source code and plots into subdirectories, and include a README file explaining the contents. If you like, include  a .html file called index.html. From there you can then link to the README file and to the various components of your report, including the source code and any other files you want to include.

The name of your archive file should begin with your Valkyrie login ID, followed by the underscore character '_' followed by "hw2,"  i.e. mine would be cs260x_hw2.tar.gz. Your archive file should create a directory with the same name as the prefix of your archive file. Be sure and delete all .object (.o) files and executables before creating the archive file. Email the file to my cs260x account cs260x (at) Valkyrie with the string CSE260:hw2 in the Subject: line.


MPI

Man pages for the MPI calls may be examine on Valkyrie with the man command. More extensive documentation can be found at at http://www-cse.ucsd.edu/users/baden/Doc/mpi.html. Here is a web page with extension MPI documentation, including man pages:


Copyright © 2005  Scott B. Baden. Last modified: 10/4/05 8:37 AM