Homework #3

Due: Wednesday, July 19th, 5:30 PM

We are interested in investigating the performance of an N-body simulation implemented in MPI. An example can be found in the following file: hw3.zip. Questions to investigate include:

1.) What is the performance dependence upon the size of the problem? There are several parameters that could be considered "size of the problem" here, including many that are in the code but not exposed on the command line, so multiple investigations will be warranted
2.) How does the program perform as the number of nodes (processes) is varied? Especially pay attention to what happens when you cross system boundaries (e.g., every 16 nodes).
3.) Based on what you've learned, improve the performance of this program. I am not looking for the best possible execution, any performance improvement will do. There are many potential improvements to be made!
4.) Put together a performance model of your best-executing code that attempts to include as many of the above factors as is reasonable.

Answer all of the above questions, or feel free to come up with your own avenues of investigation. For each question, be sure to include the following in your report:

- What platform(s) were used? (processor speed, cache size, etc. as relevant)
- How did you go about collecting data?
- What raw data did you collect?
- Analyze the raw data with the appropriate statistical method(s) as discussed in class.
- What did you learn from this investigation? Were your results surprising?

Execution instructions

I have tested the below instructions on the school Linux machines. If you have problems, please post them on Piazza.

Cluster Setup

You need to prepare your account. First login to a linux machine and generate an SSH key:

> ssh-keygen -t dsa

Hit enter to all the prompts; use a blank passphrase, then:

> cp ~/.ssh/id_dsa.pub ~/.ssh/authorized_keys

Next, run these commands to initialize an MPD control file:

> touch ~/.mpd.conf
> chmod 0700 ~/.mpd.conf


Your account is now setup to submit jobs to the cluster.



Compilation

You can compile the MPI program with the supplied makefile. You may need to adjust this makefile if you wish to use particular profilers, such as Scalasca.

MPI Execution

To run this program on the cluster, you must prepare the run_cluster.sh script that is given. In this script you will see lines that start with "#$". These are parameters for the run. Change the value after "-N" to a unique name for your job. Change the value after "-pe mpi" to the number of processors you wish to use for the job. Finally, change the last line of the script so that it points to the path of the executable (you can find this by typing pwd from the mpi directory. Use an absolute path.).

To submit your job run:

> qsub <scriptname>

The following command lets you observe the job queue:

> qstat

Additional information about qstat can be found here.

The following command will delete a job from the job queue:

> qdel

Output from Cloud Jobs

Stdout and stderr files are generated in your working director with the filenames <name>.o<num> and <name>.e<num> where name is the name given in the shell script (using -N) and num is the job number assigned by the submission system.

These files should be empty, but might have helpful information in the event of an execution failure.

If you compiled your code to be used with scalasca, you will also see a directory containing profiling information. To view the output run the following command:

> scalasca -examine <directory>

You will then see information from your most recent run. You should delete or move this directory before running the code again.

These directories should also be generated for the OpenMP program if it was compiled using scalasca, and these can also be examined with scalasca -examine.



If you did not compile your code for use with scalasca, you will find the program output in the file called <jobName>.o<jobID>

Submission Instructions

Submit a single report for your entire group. Please make sure that each group member's name is on the report. You need not turn in the code that you used unless you feel it is particularly relevant to your results (please default to explaining any code modifications in the text of your report). Once your report is finished, please email it as an attachment to dshook@wustl.edu with "Homework 3" in the subject line. You should receive an email confirmation once your report has been sucessfully submitted.