towards efficiency computing with allinea · - check your past logbooks - explain the problem to a...

36
Towards Efficiency Computing with Allinea 04 Oct 2015 KAUST Florent Lebeau [email protected]

Upload: others

Post on 19-Sep-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Towards Efficiency Computing with Allinea

04 Oct 2015

KAUST

Florent Lebeau

[email protected]

Page 2: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Agenda

9:00 - Welcome

9:15 - Introduction to Allinea tools and latest changes

9:45 - Profile and Optimize with Allinea Forge

10:30 - Coffee break

11:00 - Debug with Allinea Forge

12:00 - Lunch

13:30 - Application Efficiency with Allinea Performance

Reports

14:45 - Hands-on Session on Your Application

15:45 - Wrap-Up and questions

Page 3: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Introduction to Allinea Tools

Page 4: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Allinea : an expanding company

• HPC tools company since 2002

– Leading in HPC software tools market worldwide

– Global customer base

• Helping the HPC community design the best applications

– Unrivaled productive and easy-to-use development environment…

– … To help reach the highest level of performance and scalability

• Helping HPC production make the most of their clusters

– Unique solutions to reduce HPC systems operating costs

– Innovative approach to facilitate cutting-edge challenges resolution

Page 5: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Improve cluster efficiency

• “Optimization” is not always synonym of “efficiency”– Cluster productivity or cluster usage

• Possible efficiency needs during production

– Define and enforce best practices (scale, parameters…)

– Provision and validate cluster upgrades and changes

– Detect & resolve hardware or software faults impacting performance

• Effortless one-touch reports with allinea

– Generates explicit and readable reports with metrics and explanations

– Understand optimized HPC applications effortlessly

Page 6: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Better runs, quickly

No source code needed

Less than 5% runtime overhead

Fully scalable

Run regularly – or in regression tests

Explicit and usable output

Page 7: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

• Allinea Forge: a modern integrated environment for HPC developers

‒ Rebranding of Allinea Unified (Allinea DDT + Allinea MAP)

• Supporting the lifecycle of application development and improvement

‒ Productively debug code with Allinea DDT

‒ Enhance application performance with Allinea MAP

• Designed for productivity

‒ Consistent easy to use tools

‒ Fewer failed jobs

• Available to you

Need to dive into the code ?

Page 8: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Allinea Forge

One Unified Solution

Observe and debug your code step by step

Flick to Allinea DDTCommon interface and settings files

Increasing memory usage ? Memory leak !Workload imbalance ? Possible partitioner bug !

Use Allinea MAP to find a bottleneck

Page 9: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Allinea MAP

Performance made easy

Low overhead measurement

• Accurate, non-intrusive application performance profiling

• Seamless – no recompilation or relinking required

Easy to use

• Source code viewer pinpoints bottleneck locations

• Zoom in to explore iterations, functions and loops

Deep

• Measures CPU, communication, I/O and memory to identify problem causes

• Identifies vectorization and cache performance

Page 10: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

• Who had a rogue behaviour ?

‒ Merges stacks from processes and threads

• Where did it happen?

‒ Allinea DDT leaps to source automatically

• How did it happen?

‒ Detailed error message given to the user

‒ Some faults evident instantly from source

• Why did it happen?

‒ Unique “Smart Highlighting”

‒ Sparklines comparing data across processes

Allinea DDT helps to understand

Run

with Allinea tools

Identify a problem

Gather infoWho, Where,

How, Why

Fix

Page 11: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Latest Changes

Page 12: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Reverse connect: the end of

template files

Page 13: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Horizontal & vertical zoom

Page 14: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Energy Metrics: Quantify gains immediately

CPU RUNGPU RUN

Page 15: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

DDT

Reverse connect

(No more queue configuration)

ARM v8 and Power8 support

MAP

Energy metrics

Start/stop sampling by time

Zoomable metrics

Stdout/stderr in .map files

Limited ARMv8 support

Performance Reports

Energy metrics

Limited ARMv8 support

Allinea Forge and Performance Reports 5.1

caption

Hardware (system + CPU) provides energy-related data

(Currently: IPMI-based power sensors)

API extracts this data and feeds Allinea’s tools (Currently: Intel Energy Checker SDK)

Allinea’s tools process data at runtime to bring unique perspective

Page 16: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Profile and Optimise with Allinea

Forge

Page 17: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Code optimisation can be time-consuming.

Efficient tools can help you focus on the most important bottlenecks.

The quest for the Holy Performance

Page 18: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Getting Started on Shaheen

• Load the environment

$ module load allinea-forge/5.1-43957

$ module switch PrgEnv-cray/5.2.56 PrgEnv-gnu

• Prepare the code for profiling$ make-profiler-libraries$ cc –g –O3 myapp.c –o myapp.exe -dynamic –L./ -lmap-sampler-pmpi

-lmap-sampler -Wl,--eh-frame-hdr -lm -Wl,-rpath=./

• Modify job script to prefix the mpirun command

map -–profile srun myapp.exe

• Submit job$ sbatch myjob.sub

• View result

$ map myapp_Xp_Yt_YYYY-MM-DD-HH-MM.map

Page 19: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Tutorial:

Matrix Multiplication: C = A x B + C

k

k

i A

B

C size

j i, j, k: loop indexes

nslices = 4

Algorithm

1- Master initializes matrices A, B & C

2- Master slices the matrices A & C, sends them to slaves

3- Master and Slaves perform the multiplication

4- Slaves send their results back to Master

5- Master writes the result Matrix C in an output file

Page 20: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Exercise objectives :

– Load Allinea Forge environment

– Compile a code for allinea MAP

– Submit the job through the queue

– Discover allinea MAP interface and features

– Optimize a simple code

Content

– Source code + makefile

– Handout (step by step instructions)

Tutorial archive on Shaheen in:

/lustre/scratch/project/s1001/x_lebeaufm/allinea_workshop.tar.gz

Profiling the application

Page 21: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Resolving Bugs with Allinea Forge

Page 22: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Debugging a problem is much easier when you can :

• Make and undo changes fearlessly

- Use a source control (CVS, …)

• Track what you’ve tried so far

- Write logbooks

• Reproduce bugs with a single command

- Create and use test script

Debugging by Discipline

Page 23: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Debugging by Magic

Any technology

sufficiently advanced

is indistinguishable

from magic.

Unpredictable,

dangerous,

irresistible.

Page 24: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Debugging a problem is much easier if you know debuggers

• Prepare the code

$ cc –O0 –g myapp.c –o myapp

• Start Allinea DDT in interactive mode (on compute node

for instance)

$ ddt -n 8 ./myapp arg1 arg2

$ ddt srun -n 8 ./myapp arg1 arg2

• Start Allinea DDT in offline mode (on compute node)

$ ddt –offline report.html -n 8 ./myapp arg1 arg2

(in your submission script instead of mpirun)

Learn your spells

Page 25: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Debugging by Inspiration

Look at the problem,

see the solution.

Trust your instincts.

Control if they are

right.

Page 26: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Debugging a problem is much easier if you are inspired :

• Search your inspiration sources

- Check your past logbooks

- Explain the problem to a rubber duck

• Test your instincts

- Create tests (tracepoints, watchpoints, conditional breakpoints…)

• Observe what the debugger is telling you

- Analyse what the debugger communicates

- Retrieve information from the debugger (advanced magic)

Debugging by Inspiration

Page 27: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Debugging by Inspiration

• Memory errors can be obvious (segfaults …)

• Sometimes not

• Allinea DDT memory debugging tool enables automatic error

detection

• By activating dmalloc library

• By adding guard pages

• On the host as well as on the Xeon Phi

• Different levels of detection brings different debugger behaviour

Page 28: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Getting Started on Shaheen

• Load the environment$ module load allinea-forge/5.1-43957$ module switch PrgEnv-cray/5.2.56 PrgEnv-gnu

• Prepare the code for memory debugging$ cc –g –O0 myapp.c –o myapp.exe -L/path/to/ddt/lib/64 -ldmalloc

-Wl,--allow-multiple-definition –lm

• Modify job script to prefix the srun command for reverse connect

ddt -–connect srun myapp.exe

• Launch Allinea MAP in the background

$ ddt &

• Submit job$ sbatch myjob.sub

Page 29: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Exercise objectives:

– Compile a code for allinea forge

– Discover underlying bugs with allinea MAP

– Use allinea DDT to debug issues

Content

– Source code + makefile

– Handout (step by step instructions)

How to optimise further?

Exercise 2 : Working on the Optimized code

Page 30: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Application Efficiency with Allinea

Performance Reports

Page 31: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Allinea Performance Reports

One example with a

CFD application

Page 32: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Getting Started on Shaheen

• Load the environment$ module load allinea-report

• Prepare the code for memory debugging$ make-profiler-libraries

$ cc –g –O3 myapp.c –o myapp.exe -dynamic –L./ -lmap-sampler-pmpi

-lmap-sampler -Wl,--eh-frame-hdr -lm -Wl,-rpath=./

• Modify job script to prefix the mpirun command

perf-report srun myapp.exe

perf-report srun python myscript.py

• Submit job$ sbatch myjob.sub

• View result

$ firefox myapp_Xp_Yt_YYYY-MM-DD-HH-MM.html

Page 33: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

• How to make sure OpenFOAM is using the best

of a system?

• Example from the OpenFOAM tutorial http://www.openfoam.org/docs/user/damBreak.php

Tutorial: Allinea Performance-Reports with

OpenFOAM

Page 34: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Hands-on session on your application

Page 35: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Summary

• Develop your efficiency with allinea forge– Optimize your code to reach your goals with allinea MAP

– Reduce the number of failed jobs with allinea DDT

• Improve cluster usage with allinea performance

reports– Squeeze more jobs within a given time frame

– Increase research by freeing machine time without hardware

investment

– Help application support teams focus on the right issues

Page 36: Towards Efficiency Computing with Allinea · - Check your past logbooks - Explain the problem to a rubber duck • Test your instincts-Create tests (tracepoints, watchpoints, conditional

Thank you

Your contacts :

– Technical questions? [email protected]

– Sales team: [email protected]