Using the VTune Analyzer on Multithreaded Applications
description
Transcript of Using the VTune Analyzer on Multithreaded Applications
![Page 1: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/1.jpg)
Using the VTune Analyzer on Multithreaded
Applications
Intel Software College
![Page 2: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/2.jpg)
2
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
Objectives
Two uses for VTune Performance Analyzer
• Improving the efficiency of computation
• Improving your threading model
Example: mandelbrot3.exe
![Page 3: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/3.jpg)
3
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
Agenda
Determine if a sample section of code can be threaded
Determine if the implemented threads are balanced or not
![Page 4: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/4.jpg)
4
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
Use VTune Analyzer on Serial Applications
Determine what parts of your application (if any) that, when threaded, will speed up your app
• CPU-bound apps can potentially run twice as fast on dual-core processors
• Memory bound apps may potentially run 50% faster
• I/O bound applications may not run any faster
Find main performance bottlenecks in your application (sampling)
• Determine whether or not it makes sense to thread there• If not, look further up the program’s calling sequence to find a more
appropriate place to consider (callgraph)
![Page 5: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/5.jpg)
5
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
Use VTune Analyzer on Multithreaded Applications
Determine if your current threading model is balanced
• On the thread view, each of the threads should be consuming the same amount of time
• If not, you must shift the amount of work between the threads
• Use “Samples Over Time” view
Look for idle CPU time
• Could more threads utilize idle resources?
• In the process view this can show up as ntoskrnl, or intelppm.sys
• Sometimes the process view actually says idle task
![Page 6: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/6.jpg)
6
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
Example: mandelbrot3.exe
Single threaded app, analyze to see if it can be made
Demo machine:
• Four socket, dual core, hyper-threaded (HT) machine
• (4 sockets * 2 cores per socket * 2 HT CPUs per core) = the OS sees 16 processors
![Page 7: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/7.jpg)
7
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
![Page 8: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/8.jpg)
8
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
![Page 9: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/9.jpg)
9
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
![Page 10: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/10.jpg)
10
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
![Page 11: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/11.jpg)
11
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
![Page 12: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/12.jpg)
12
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
![Page 13: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/13.jpg)
13
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
![Page 14: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/14.jpg)
14
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.
![Page 15: Using the VTune Analyzer on Multithreaded Applications](https://reader036.fdocuments.net/reader036/viewer/2022062500/56815a03550346895dc75060/html5/thumbnails/15.jpg)
15
Copyright © 2006, Intel Corporation. All rights reserved.
Using the VTune Analyzer on Multithreaded Applications
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.