21
1 © 2017 Rogue Wave Software, Inc. All Rights Reserved. 1 Approaches to debugging mixed- language HPC apps Exhibitor Forum SC17

Approaches to debugging mixed-language HPC apps

Embed Size (px)

Citation preview

Page 1: Approaches to debugging mixed-language HPC apps

1© 2017 Rogue Wave Software, Inc. All Rights Reserved. 1

Approaches to

debugging mixed-

language HPC apps

Exhibitor Forum

SC17

Page 2: Approaches to debugging mixed-language HPC apps

2© 2017 Rogue Wave Software, Inc. All Rights Reserved. 2

Data modeling is critical for machine learning

• Data scientists iterate over huge datasets

• Legacy algorithms are critical

• Most popular languages

– R in scientific communities

– Python in engineering

• Focusing on Python

• Developers use it because

– Ease of use

– Clean syntax

– Extension libraries (many in C/C++)

Page 3: Approaches to debugging mixed-language HPC apps

3© 2017 Rogue Wave Software, Inc. All Rights Reserved. 3

Calling C/C++ from Python

• High performance libraries are written in C/C++ and Fortran

– Run faster

– Rewriting doesn’t make sense

– Advanced multi-threaded capabilities

• Fortunately there are many ways to call between the languages

Page 4: Approaches to debugging mixed-language HPC apps

4© 2017 Rogue Wave Software, Inc. All Rights Reserved. 4

Debugging multiple languages

• Debugging one language is difficult enough

– Especially with many threads/processes

• The language intersection is tougher

– Data comparison

– Glue code

• Issues are:

– Viewing data across language barriers

– Combined call stack

– Extraneous stack frames

Page 5: Approaches to debugging mixed-language HPC apps

5© 2017 Rogue Wave Software, Inc. All Rights Reserved. 5

Python Session Editor

Glue

code

Debugging Python Interpreter

Page 6: Approaches to debugging mixed-language HPC apps

6© 2017 Rogue Wave Software, Inc. All Rights Reserved. 6

Stopped in C/C++ Python Extension

Shows Python & C++

Page 7: Approaches to debugging mixed-language HPC apps

7© 2017 Rogue Wave Software, Inc. All Rights Reserved. 7

Stopped in C/C++ Python Extension

Shows Python & C++

Page 8: Approaches to debugging mixed-language HPC apps

8© 2017 Rogue Wave Software, Inc. All Rights Reserved. 8

Selected Python frame

C++

data

Python

Data

Page 9: Approaches to debugging mixed-language HPC apps

9© 2017 Rogue Wave Software, Inc. All Rights Reserved. 9

Data View

C++

data

Python

Data

Page 10: Approaches to debugging mixed-language HPC apps

10© 2017 Rogue Wave Software, Inc. All Rights Reserved. 10

Numpy

Page 11: Approaches to debugging mixed-language HPC apps

11© 2017 Rogue Wave Software, Inc. All Rights Reserved. 11

Python without filtering

Glue

code

No viewing of Python data and code

Page 12: Approaches to debugging mixed-language HPC apps

12© 2017 Rogue Wave Software, Inc. All Rights Reserved. 12

Python support in TotalView

• Designed for where Python calls C/C++ or vice versa

• Glue frames hidden from view

– Supported for SWIG

– User customizable

• Python information shown

– Code

– Data

Page 13: Approaches to debugging mixed-language HPC apps

13© 2017 Rogue Wave Software, Inc. All Rights Reserved. 13

Stack transformation facility

• Hides stack frames

• Transforms stack frames

• Backbone for:

– Python support

• Useful for any stack frames you want to hide

– Language differences

– Wrapper code

Page 14: Approaches to debugging mixed-language HPC apps

14© 2017 Rogue Wave Software, Inc. All Rights Reserved. 14

Demo

Page 15: Approaches to debugging mixed-language HPC apps

15© 2017 Rogue Wave Software, Inc. All Rights Reserved. 15

Few use cases

• Currently used with large scientific application at Lawrence

Livermore National Laboratory

• Helpful while learning or extending packages such as TensorFlow.

Page 16: Approaches to debugging mixed-language HPC apps

16© 2017 Rogue Wave Software, Inc. All Rights Reserved. 16

TensorFlow basics

• Open source

• Numerical computation

• Usage in machine learning

• Written in C++

– Called from Python

Page 17: Approaches to debugging mixed-language HPC apps

17© 2017 Rogue Wave Software, Inc. All Rights Reserved. 17

TensorFlowMultithreaded application

Glue code removed

Added a rule for some wrappers

Page 18: Approaches to debugging mixed-language HPC apps

18© 2017 Rogue Wave Software, Inc. All Rights Reserved. 18

How does Rogue Wave help HPC?

TotalView debugger

• Troubleshooting and analysis tool

• Visibility into applications

• Control over applications

• Integrated Reverse Debugging

MemoryScape debugger• Malloc API misuse

• Memory leaks

• Buffer overflows

• Invalid Read/Write

Page 19: Approaches to debugging mixed-language HPC apps

19© 2017 Rogue Wave Software, Inc. All Rights Reserved. 19

TotalView for HPC• Comprehensive multi-core and multi-threaded analysis and debug environment

– Thread specific breakpoints

– Control individual thread execution

– View thread specific stack and data

– View complex data types easily

• Integrated Reverse debugging

• Mixed Language - Python C/C++

• Track memory leaks in running applications

• Supports C/C++ on Linux

• Active development for 30+ years

• Allowing the business to have

– Predictable development schedules

– Less time spent debugging

Page 20: Approaches to debugging mixed-language HPC apps

20© 2017 Rogue Wave Software, Inc. All Rights Reserved. 20

Summary

• Comments and questions

• Come see a live demo and learn more at our SC17 booth 1715

• For more information

– https://www.roguewave.com

– White Paper - https://www.roguewave.com/resources/white-

papers/mixed-language-debugging-python-c-cplusplus

– Videos - https://www.youtube.com/watch?v=LXSSstUdKnc

– Evaluation - https://www.roguewave.com/products-services/request-

evaluation

Page 21: Approaches to debugging mixed-language HPC apps

21© 2017 Rogue Wave Software, Inc. All Rights Reserved. 21