Tech Ed North America 2010 6/20/2018 7:07 AM Required Slide

Slides:



Advertisements
Similar presentations
Parallel Performance Tools in Visual Studio 2010.
Advertisements

Feature: OLE Notes Migration Utility
Session 1.
customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
How We Do Language Design at Microsoft (C#, Visual Basic, F#)
Entity Framework 4 Deep Dive
Tech·Ed  North America /11/ :01 AM SESSION CODE: DEV405
6/12/ :53 PM DEV311 Deep Dive into Microsoft Visual Studio Team Foundation Server 2010 Reporting Steven Borg, Principal ALM Consultant Northwest.
9/11/2018 5:53 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Task Parallel Library: Design Principles and Best Practices
MDOP: Advanced Group Policy Management 4.0
Tech Ed North America /13/ :13 AM Required Slide
Tech·Ed North America /14/2018 7:13 PM
Microsoft Visual Studio IDE Futures
Overview of Social Computing in Microsoft SharePoint 2010
Customer Experiences With Business Intelligence
Implementing RESTful Services Using the Microsoft .NET Framework
TechEd /14/2018 6:26 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Sysinternals Tutorials
What’s New In ASP.NET MVC 2
Advanced Dashboard Creation Using Microsoft SharePoint Server 2010
Jason Zander Unplugged
Branching and Merging Practices
Tech Ed North America /27/ :47 PM Required Slide
Title of Presentation 12/2/2018 3:48 PM
High Availability: A Contrarian View
Brian Keller Sr. Technical Evangelist Microsoft Session Code: DEV310
12/5/2018 3:24 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Best Practices: Creating OData Services using WCF Data Services
Tech·Ed North America /7/2018 2:51 PM
F# for Parallel and Asynchronous Programming
Tech·Ed North America /8/ :16 PM
Team Foundation Server 2010 for Everyone
Tiberiu Covaci Senior Technical Trainer Many-core
Introducing Microsoft SQL Server 2008 R2 Master Data Services
Authoring for Microsoft Silverlight 4 with Microsoft Expression Blend
Tech Ed North America /1/ :36 AM Required Slide
Tech Ed North America /1/2019 2:58 AM Required Slide
Intro to Workflow Services and Windows Server AppFabric
Tech·Ed North America /17/2019 1:47 AM
Brian Keller Sr. Technical Evangelist Microsoft Session Code: DEV310
Microsoft SharePoint Conference 2009 Jon Flanders
2010 Microsoft BI Conference
Building Silverlight Apps with RIA Services
Using Windows Runtime and SDK to build Metro style apps
TechEd /7/2019 1:14 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Tech Ed North America /12/2019 6:45 AM Required Slide
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
A Lap Around Internet Explorer 9 For Developers
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
2010 Microsoft BI Conference
Hack-proofing your Clients using Windows 7 Security!
How and When to Use MEF: Too Much Is Never Enough
Building RESTful services using OData
Шитманов Дархан Қаражанұлы Тарих пәнінің
Lap Around the Windows Azure Platform
Code First Development in Microsoft ADO.NET Entity Framework 4.1
Building BI applications using PowerPivot for Excel
Title of Presentation 5/24/2019 1:26 PM
7/5/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Tech·Ed North America /6/2019 7:10 PM
TechEd /12/ :12 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
TechEd /30/2019 7:18 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Tech Ed North America /6/2019 2:07 PM Required Slide
TechEd /5/2019 2:08 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
What’s New in Visual Studio 2012 for Web Developers
Presentation transcript:

Tech Ed North America 2010 6/20/2018 7:07 AM Required Slide SESSION CODE: DEV317 Profiling and Debugging Parallel Code with Microsoft Visual Studio 2010 Huseyin Yildiz Software Design Engineer Microsoft Corporation © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

AGENDA Motivation Recap of Parallel Programming support in Visual Studio 2010 Parallel Profiling Parallel Debugging

MOTIVATION Multicore processors are here Single thread performance is mostly flat Performance burden shifted to software Parallelism libraries now available, and make the job easier Data parallelism, task parallelism, parallel loops, agents Concurrency opens up new challenges for debugging and tuning => Need for targeted tools

CONCURRENCY DEVELOPMENT CYCLE Divide & conquer Express Parallelism Debug Tune - Isolate phases - Identify parallelism opportunities - Data parallelism - Task parallelism - Parallel loops - Remove parallelism blockers - Reduce latency - Find more parallelism opportunities

PARALLELISM SUPPORT IN VISUAL STUDIO 2010 Tech Ed North America 2010 6/20/2018 7:07 AM PARALLELISM SUPPORT IN VISUAL STUDIO 2010 Tools Programming models PLINQ Parallel Pattern Library Agents Library Parallel Debugger Task Parallel Library Data structures Data structures Concurrency runtimes Concurrency Visualizer Task Scheduler Task Scheduler Thread Pool Resource manager Resource Manager Operating system Threads Key: Managed library Native library Tools © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

PARALLEL PROFILING Tech Ed North America 2010 6/20/2018 7:07 AM © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

CONCURRENCY VISUALIZER OVERVIEW New concurrency-oriented profiler in Visual Studio 2010 Visualizes thread activity on a timeline Per-thread or per-core views of execution states, blocking, I/O etc. Provides very fine grained information Zoom in to individual context switches to track suspicious interactions Or zoom out to look for patterns (good or bad)

A STORY BETTER TOLD IN PICTURES

CONCURRENCY VISUALIZER OVERVIEW (cont’d) Sampling profiler, also utilizes existing kernel level event sources Based on ETW technology => very low overhead Not tied to a specific concurrency runtime Includes some visual markers specific to TPL, PPL, PLINQ Supports Native and managed apps 32-bit and 64-bit Windows 7, Windows Server 2008, and Windows Vista

GETTING STARTED Run as admin Symbol paths OK? Enable concurrency option in Performance Wizard

CPU UTILIZATION VIEW What it shows How to use it High level graph of CPU utilization by your process Y-axis covers all available cores Comparison against other processes and idle time How to use it Good starting point for most concurrency profiling scenarios Identify ranges or patterns of overall utilization When was execution truly parallel? When did it get serialized?

THREAD VIEW What it shows How to use it Each thread’s execution over time - down to context switches Call stacks for where a thread got blocked and who unblocked it Sampled call stacks (collected every 1 ms) Disk I/O details on the same timeline How to use it Find root causes of low utilization and long delays When a thread isn’t executing, find out why Blocked? Paging? Preempted? Sleeping? Analyze thread interactions

CORE VIEW What it shows How to use Execution activity per core Individual threads identifiable by color Core migration statistics How to use Identify thread affinity or migration issues Unintended feature: Hunt for garbage collections!

Parallel Profiling Case Study Tech Ed North America 2010 6/20/2018 7:07 AM Parallel Profiling Case Study DEMO © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

PATTERNS: SERIALIZATION Problem: Too much synchronization in parallelized code Signs: Little or no overlapping execution blocks, too frequent blocking Solution: Identify contended lock from blocking call stacks, reduce locking

PATTERNS: UNEVEN WORK DISTRIBUTION Problem: DOP decreases towards the end due to high work granularity Signs: Staircase pattern in a group of related threads as work acquiesces Solution: Revisit work partitioning

PATTERNS: OVERSUBSCRIPTION Problem: Too many active threads competing for CPU time Signs: Checkerboard pattern of execution and preemption blocks Solution: Limit degree of parallelism

PATTERNS: INEFFICIENT I/O Problem: Too much concurrent I/O blocks CPU bound work Signs: Interleaved execution and I/O blocks Solution: Revisit I/O strategy, consider asynchronous I/O

CUSTOM MARKERS FOR APPLICATION PHASES #include "Scenario.h" int _tmain(int argc, _TCHAR* argv[]) { ... myScenario = new Scenario(0, L"Scenario Marker Example", (LONG) 0); myScenario->Begin(0, TEXT(“PHASE1")); // Do actual work for phase 1 here myScenario->End(0, TEXT(“PHASE1")); } Native and managed scenario marker libraries available at http://code.msdn.microsoft.com/Scenario

PARALLEL DEBUGGING Tech Ed North America 2010 6/20/2018 7:07 AM © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

PARALLEL DEBUGGER OVERVIEW Goal: Help navigate pending and active tasks in the debugger for TPL and PPL applications Two new debugger tool windows: “Parallel Tasks” “Parallel Stacks” Works with native and managed task runtimes Task Parallel Library Parallel Patterns Library

PARALLEL TASKS WINDOW List of all unfinished tasks Which threads they are running on, call stacks Which tasks are blocked, or waiting to run

PARALLEL STACKS WINDOW Zoom control Bird’s eye view Multiple call stacks in a single view Task status Easy navigation to any executing method Rich UI (zooming, panning, bird’s eye view, flagging, tooltips)

OTHER DEBUGGING ENHANCEMENTS DebuggerDisplay and DebuggerProxy attributes for most new managed parallelism-related types Task ,TaskScheduler AggregateException Concurrent collections New synchronization primitives Lazy<T> , ThreadLocal<T> … Historical debugging (IntelliTrace) support for Task, QUWI and LazyInitializer

Parallel Debugger in Action Tech Ed North America 2010 6/20/2018 7:07 AM Parallel Debugger in Action DEMO © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

RESOURCES MSDN Parallel Computing Dev Center: http://msdn.microsoft.com/en-us/concurrency/default.aspx Team blog: http://blogs.msdn.com/b/visualizeparallel/ Hazim Shafi’s blog: http://blogs.msdn.com/b/hshafi/ MSDN article on Concurrency Visualizer: http://msdn.microsoft.com/en-us/magazine/ee336027.aspx Scenario marker API: http://code.msdn.microsoft.com/Scenario

Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Tech Ed North America 2010 6/20/2018 7:07 AM Track Resources Visual Studio – http://www.microsoft.com/visualstudio/en-us/ Soma’s Blog – http://blogs.msdn.com/b/somasegar/  MSDN Data Developer Center – http://msdn.com/data ADO.NET Team Blog – http://blogs.msdn.com/adonet WCF Data Services Team Blog – http://blogs.msdn.com/astoriateam EF Design Blog – http://blogs.msdn.com/efdesign © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Resources Learning Required Slide www.microsoft.com/teched Tech Ed North America 2010 6/20/2018 7:07 AM Required Slide Resources Learning Sessions On-Demand & Community Microsoft Certification & Training Resources www.microsoft.com/teched www.microsoft.com/learning Resources for IT Professionals Resources for Developers http://microsoft.com/technet http://microsoft.com/msdn © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Complete an evaluation on CommNet and enter to win! Tech Ed North America 2010 6/20/2018 7:07 AM Required Slide Complete an evaluation on CommNet and enter to win! © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31st http://northamerica.msteched.com/registration   You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year

Tech Ed North America 2010 6/20/2018 7:07 AM © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

CPU UTILIZATION VIEW CLOSE-UP Number of cores CPU Utilization of other processes CPU Utilization of the target process Idle time

THREAD VIEW CLOSE-UP Zoom control and time axis Ruler tool for custom time measurements One lane per thread Thread activity (color coded execution states) Usage Hints Activity Legend Call Stacks available for each “sample” Who unblocked this thread?

CORE VIEW CLOSE-UP Execution on each core One lane per logical core One color per thread Cross-core migration statistics

Required Slide Tech Ed North America 2010 6/20/2018 7:07 AM © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.