Systèmes Hautes Performances

Portail informatique

Performance analysis

Before starting, download the asr5_env.sh script and source it:
$ wget http://www-inf.telecom-sudparis.eu/COURS/CSC5001/new_site/Supports/Cours/AnalysePerf/asr5_env.sh $ source asr5_env.sh
The goal of this lab is to learn how to use various performance analysis tools. For this, we will analyze a toy application to download here: mandelbrot.tgz.

Plotting a speedup graph

A first step in performance analysis consists in evaluating the "baseline" performance of the application. To do this, we will plot a speedup graph.

  1. Run the mandelbrot application while varying the number of OpenMP threads
  2. Create a .data file that contains:
    • the number of processors in the first column
    • the sequential execution time in the second column
    • the parallel execution time in the third column
    Here is an example of such file SpeedUpMandelbrot-OpenMP.data.
  3. Open the file speedup.plot and modify:
    • the plot title
    • the output file that ends with .png
    • the input file that ends with .data
  4. Run the gnuplot command:
  5. gnuplot speedup.plot
  6. This generates the output png file. For example SpeedUpMandelbrot-OpenMP.png.

Profiling

Now we want to determine the most time consuming functions of the program mandelbrot_gui. For this we will use perf.
  • Run the program with perf record
  • Analyze the results with perf report

Tracing an OpenMP program

The goal of this exercise is to generate an execution trace with EZTrace and to visualize it with ViTE:
$ make clean $ make CC="eztrace_cc gcc" mandelbrot eztrace_cc gcc -fopenmp -o mandelbrot mandelbrot_seq.c $ eztrace -t omp ./mandelbrot 10000 [...] Stopping EZTrace... saving trace trahay_eztrace_log_rank_1 $ eztrace_convert trahay_eztrace_log_rank_1 [...] $ vite eztrace_output.trace

While viewing the trace, you should see a load balancing problem (the same one you spotted during the parallel algorithmics lab). Fix the program and regenerate a trace showing that the load is balanced between threads.

Then rerun the performance measurement, and integrate the new data in the speedup plot (which will thus include 2 graphs: the "original" speedup graph and the speedup graph after optimization).

Tracing an MPI program

Download the stencil_mpi.tgz program, and extract the archive.

Use EZTrace to generate an execution trace of the MPI program.

The stencil_mpi program mixes MPI and OpenMP. Generate an execution trace that contains both the MPI communication and the OpenMP parallel regions.

Project

Now that you master a few performance analysis tools, use them on your micro-project, and improve its performance !