Performance Analysis with Vampir DKRZ Tutorial 2013 5 – 7 August, Hamburg Matthias Weber, Frank Winkler, Andreas Knüpfer ZIH, Technische Universität Dresden 1 Outline Part I: Welcome to the Vampir Tool Suite – – – – Mission Event Trace Visualization Vampir & VampirServer Vampir Performance Charts Part II: Vampir Hands-on – Visualizing and analyzing NPB-MZ-MPI / BT Part III: Summary and Conclusion DKRZ Tutorial 2013, Hamburg 2 Mission • Visualization of dynamics of complex parallel processes • Requires two components – Monitor/Collector (Score-P) – Charts/Browser (Vampir) Typical questions that Vampir helps to answer: – What happens in my application execution during a given time in a given process or thread? – How do the communication patterns of my application execute on a real system? – Are there any imbalances in computation, I/O or memory usage and how do they affect the parallel execution of my application? DKRZ Tutorial 2013, Hamburg 3 Event Trace Visualization with Vampir • Alternative and supplement to automatic analysis • Show dynamic run-time behavior graphically at any level of detail • Provide statistics and performance metrics Timeline charts – Show application activities and communication along a time axis Summary charts – Provide quantitative results for the currently selected time interval DKRZ Tutorial 2013, Hamburg 4 Vampir – Visualization Modes (1) • Directly on front end or local machine % vampir CPU CPU CPU CPU Multi-Core Program CPU CPU CPU Vampir 8 Score-P CPU Small/Medium sized trace DKRZ Tutorial 2013, Hamburg Trace File (OTF2) Thread parallel 5 Vampir – Visualization Modes (2) • On local machine with remote VampirServer % vampirserver start –n 12 % vampir VampirServer Vampir 8 CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU Many-Core CPU CPU CPU CPU CPU CPU CPU CPU Program CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU DKRZ Tutorial 2013, Hamburg Score-P LAN/WAN Trace File (OTF2) Large Trace File (stays on remote machine) MPI parallel application 6 Usage Order of the Vampir Performance Analysis Toolset 1. Instrument your application with Score-P 2. Run your application with an appropriate test set 3. Analyze your trace file with Vampir – Small trace files can be analyzed on your local workstation 1. Start your local Vampir 2. Load trace file from your local disk – Large trace files should be stored on the HPC file system 1. 2. 3. 4. Start VampirServer on your HPC system Start your local Vampir Connect local Vampir with the VampirServer on the HPC system Load trace file from the HPC file system DKRZ Tutorial 2013, Hamburg 7 Main Displays of Vampir • Timeline Charts: – Master Timeline – Process Timeline – Counter Data Timeline – Performance Radar • Summary Charts: – Function Summary – Message Summary – Process Summary – Communication Matrix View DKRZ Tutorial 2013, Hamburg 8 Vampir Hands-on Visualizing and Analyzing NPB-MZ-MPI / BT 9 Vampir: Visualization of the NPB-MZ-MPI / BT trace % vampir scorep_bt-mz_B_4x4_trace/traces.otf2 Navigation Toolbar Function Summary Function Legend Master Timeline DKRZ Tutorial 2013, Hamburg 10 Vampir: Visualization of the NPB-MZ-MPI / BT trace Master Timeline Detailed information about functions, communication and synchronization events for collection of processes. DKRZ Tutorial 2013, Hamburg 11 Vampir: Visualization of the NPB-MZ-MPI / BT trace Process Timeline Detailed information about different levels of function calls in a stacked bar chart for an individual process. DKRZ Tutorial 2013, Hamburg 12 Vampir: Visualization of the NPB-MZ-MPI / BT trace Typical Program Phases Initialisation Phase DKRZ Tutorial 2013, Hamburg Computation Phase 13 Vampir: Visualization of the NPB-MZ-MPI / BT trace Counter Data Timeline Detailed counter information over time for an individual process. DKRZ Tutorial 2013, Hamburg 14 Vampir: Visualization of the NPB-MZ-MPI / BT trace Performance Radar Detailed counter information over time for a collection of processes. DKRZ Tutorial 2013, Hamburg 15 Vampir: Visualization of the NPB-MZ-MPI / BT trace Zoom in: Inititialization Phase Context View: Detailed information about function “initialize_”. DKRZ Tutorial 2013, Hamburg 16 Vampir: Visualization of the NPB-MZ-MPI / BT trace Feature: Find Function Execution of function “initialize_” results in higher page fault rates. DKRZ Tutorial 2013, Hamburg 17 Vampir: NPB-MZ-MPI / BT source snippet #include "scorep/SCOREP_User.h" c-------------------------------------------------------------------c initialize data c-------------------------------------------------------------------call timer_start(1) ... c-------------------------------------------------------------------c start the benchmark time step loop c-------------------------------------------------------------------do step = 1, niter SCOREP_USER_REGION_BEGIN( my_region_handle, "iteration", SCOREP_USER_REGION_TYPE_COMMON ) ... call exch_qbc(...) do iz = 1, proc_num_zones call adi(...) end do SCOREP_USER_REGION_END( my_region_handle ) end do call timer_stop(1) c-------------------------------------------------------------------c perform verification and print results c-------------------------------------------------------------------... DKRZ Tutorial 2013, Hamburg 18 Vampir: Visualization of the NPB-MZ-MPI / BT trace Computation Phase Computation phase results in higher floating point operations. DKRZ Tutorial 2013, Hamburg 19 Vampir: Visualization of the NPB-MZ-MPI / BT trace Zoom in: Computation Phase MPI communication results in lower floating point operations. DKRZ Tutorial 2013, Hamburg 20 Vampir: Visualization of the NPB-MZ-MPI / BT trace Zoom in: Finalization Phase “Early reduce” bottleneck. DKRZ Tutorial 2013, Hamburg 21 Vampir: Visualization of the NPB-MZ-MPI / BT trace Process Summary Function Summary: Overview of the accumulated information across all functions and for a collection of processes. DKRZ Tutorial 2013, Hamburg Process Summary: Overview of the accumulated information across all functions and for every process independently. 22 Vampir: Visualization of the NPB-MZ-MPI / BT trace Process Summary Find groups of similar processes and threads by using summarized function information. DKRZ Tutorial 2013, Hamburg 23 Summary and Conclusion 24 Summary • Vampir & VampirServer – – – – Interactive trace visualization and analysis Intuitive browsing and zooming Scalable to large trace data sizes (20 TByte) Scalable to high parallelism (200000 processes) • Vampir for Linux, Windows and Mac OS X • Note: Vampir does neither solve your problems automatically nor point you directly at them. Yet, it does give you FULL insight into the execution of your application. DKRZ Tutorial 2013, Hamburg 25 Conclusion • Performance analysis very important in HPC • Use performance analysis tools for profiling and tracing • Do not spend effort in DIY solutions, e.g. like printf-debugging • Use tracing tools with some precautions – overhead – data volume • Let us know about problems and about feature wishes: vampirsupport@zih.tu-dresden.de DKRZ Tutorial 2013, Hamburg 26 Vampir is available at http://www.vampir.eu Get support via vampirsupport@zih.tu-dresden.de DKRZ Tutorial 2013, Hamburg 27