Homework #2
Due: Wednesday, July 5th, 5:30 PM
We are interested in investigating the performance of a numerical solution to Laplace's equation implemented in OpenMP. An example can be found in the following file: hw2.zip. Questions to investigate include:Each group must answer the following:
How does this implementation compare with the Monte Carlo simulation approach? You will have to implement the Monte Carlo approach yourself. Some tips:
* Create a working serial version of the code first, then parallelize it with OpenMP.
* Be careful with how you generate random numbers! There are many resources online for generating random values with OpenMP, and we discussed this issue in class.
Explain why the Monte Carlo version does or does not perform as well as the given version of the code, especially when multiple threads are used. Is this what you expected?
You should submit your code as a zip file with your report.
You should then answer 3 of the following questions. You may use either the supplied code or the Monte Carlo version you wrote to answer these questions, whichever you prefer.
1.) How does Scalasca compare to the profilers we saw on the previous assignment (gprof, operf, gperftools)? What about the timing hooks included in the code? Do they all agree? Why or why not?
2.) What can we learn about the cache organization of the machine from this code?
3.) What can we learn about optimization from the compiler (e.g. -O)? Comment on how well optimization appears to work with OpenMP.
4.) What is the performance dependence upon the size of the plate? The error tolerance?
5.) How does it perform as the number of threads is varied? Be sure to collect samples that use more threads than available processors.
6.) How do the above answers vary accross machines, especially machines with different numbers of processors available?
You are also encouraged to come up with your own avenues of investigation. You may choose to answer a question of your choosing instead of one of the supplied questions, however it is highly recommended to email the instructor about your idea before doing so.
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?
Using Scalasca
For scalasca to work, you must first add some things to your PATH. On the WUSTL machines this can be done with:module add cse566
Once you have set up the path, you should run the provided shell script:
./heated_plate_run_scalasca.sh
This will create three directories: one for each run. To analyze the results do:
scalasca -examine <directory>
Where "directory" is one of the directories generated during program execution.
Feel free to modify the script file to change the number of cores used or any other options.