microsoft visual studio bringing out the best in multicore systems l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Microsoft Visual Studio: Bringing Out The Best In Multicore Systems PowerPoint Presentation
Download Presentation
Microsoft Visual Studio: Bringing Out The Best In Multicore Systems

Loading in 2 Seconds...

play fullscreen
1 / 29

Microsoft Visual Studio: Bringing Out The Best In Multicore Systems - PowerPoint PPT Presentation


  • 161 Views
  • Uploaded on

TL19. Microsoft Visual Studio: Bringing Out The Best In Multicore Systems.  Hazim Shafi Principal Architect Microsoft Corporation. Outline. Motivation Parallel application development The basics The role of tools Exploiting parallelism Current and future programming models

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Microsoft Visual Studio: Bringing Out The Best In Multicore Systems' - hawa


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
microsoft visual studio bringing out the best in multicore systems

TL19

Microsoft Visual Studio:Bringing Out The Best In Multicore Systems

 HazimShafi

Principal Architect

Microsoft Corporation

outline
Outline
  • Motivation
  • Parallel application development
    • The basics
    • The role of tools
  • Exploiting parallelism
    • Current and future programming models
  • Parallel performance tuning
    • New Visual Studio tools
  • Demos throughout
outline3
Outline
  • Visual Studio 2010 includes many parallel programming features
    • Reduce programming complexity
      • Managed and native
      • Debugging support
    • Concurrency analysis tools
      • Causes of inefficiency
      • Opportunities for parallelism
  • Want more details?
    • References to related PDC talks and symposia
motivation
Motivation
  • Multicore processors are here
    • Single thread performance is ~flat
    • Performance burden shifted to software
    • Enables new user experiences
  • Major concern for Windows developers
    • Performance suffers with new features
    • Need help parallelizing applications
  • Parallel Computing Platform team
    • Ease of developing, debugging, and tuning parallel applications
    • Help is on its way in Visual Studio 2010
visual studio 2010 tools programming models runtimes
Visual Studio 2010Tools/programming models/runtimes

Tools

Programming models

PLINQ

Parallel Pattern library

Agents

library

Parallel

Debugger Toolwindows

Task Parallel

library

Data structures

Data structures

Concurrency runtime

Profiler concurrency

analysis

Task scheduler

Thread pool

Task scheduler

Resource manager

Resource manager

Operating system

Threads

Key:

Managed library

Native library

Tools

parallel application development the basics
Parallel Application DevelopmentThe basics
  • Parallelism is about performance
  • Step 1: Understand your goals
  • Step 2: Measure existing performance
  • Step 3: Performance tuning
    • Starts with sequential version
  • Step 4: Identify opportunities for parallelism
    • Hide latency
    • Speed up CPU bound phases
  • Step 5: Express parallelism
  • Step 6: Tune
goals and sequential tuning
Goals And Sequential Tuning
  • Know your users
    • Use realistic datasets
    • Know your ecosystem
  • Parallelize only if necessary, but PLAN for it
    • Introduces bugs
    • Increases complexity
    • Visual Studio features reduce complexity
  • I/O, memory latency and algorithmic optimizations
    • Often sufficient to meet goals
visual studio profiling tools demo recap
Visual Studio Profiling ToolsDemo recap
  • Profiler
    • Sampling based – for CPU-bound phases
      • Lowest overhead
      • Analyze time and/or hardware performance counters
    • Instrumentation based – not limited to CPU-bound phases
      • Detailed, higher runtime overhead
    • Managed memory usage analysis
  • TL26: Improving .NET Application Performance And Scalability
  • Steve Carroll and Ed Glas
  • TL24: 1:15 PM in 153 (Wednesday)
visual studio 2010 tools programming models runtimes10
Visual Studio 2010Tools/programming models/runtimes

Tools

Programming models

PLINQ

Parallel Pattern library

Agents

library

Parallel

Debugger Toolwindows

Task Parallel

library

Data structures

Data structures

Concurrency runtime

Profiler concurrency

analysis

Task scheduler

Thread pool

Task scheduler

Resource manager

Resource manager

Operating system

Threads

Key:

Managed library

Native library

Tools

parallel application development measuring performance
Parallel Application DevelopmentMeasuring performance
  • Compare actual performance against goals
    • Requires instrumentation
  • Divide and conquer
    • Identify scenario phases
    • Tackle biggest contributors first
    • Amdahl’s Law
  • Instrumentation
    • Integrated support in Visual Studio 2010 performance tools
parallel application development instrumentation
Parallel Application DevelopmentInstrumentation
  • Managed and native
  • Instrumentation provides
    • Time ∆, and possibly some resource usage information
    • Nesting support
    • Optional Tracing data emitted for post-run analysis
    • Integration with Visual Studio 2010 Trace Visualization Tools

MeasurementBlockmyMB = new MeasurementBlock();

myMB.Begin(0, “Phase 1”);

// Phase 1 work happens here

myMB.End();

parallel application development opportunities for parallelism
Parallel Application DevelopmentOpportunities for parallelism
  • Attempted performance tuning, but can’t meet goals
  • Identify opportunities for parallelism
    • Speed-up CPU-bound phases
    • Overlap/hide delays from user experience
    • Where and how?
  • Visual Studio 2010 Concurrency Analysis Tools
    • Managed and native
    • 32-bit and 64-bit
    • Windows 7, Windows Server 2008, and Windows Vista
visual studio 2010 concurrency analysis tools
Visual Studio 2010 Concurrency Analysis Tools
  • CPU utilization analysis
    • How it varies with time across phases
    • Identify opportunities for improvement
    • Drill into a range of execution for details
  • Thread blocking analysis
    • Analyzes each thread’s execution
    • When a thread is not executing, why?
    • Link to source code responsible
    • Disk I/O dependencies with filenames/delays
  • Core execution analysis
    • Thread migration or affinity issues
visual studio 2010 concurrency analysis tools what i haven t shown
Visual Studio 2010 Concurrency Analysis ToolsWhat I haven't shown
  • Thread synchronization dependencies
    • Which thread was I waiting for?
    • What was that thread doing?
  • Multi-process scenarios
    • My program spawns other processes
    • My program requests services from other processes
  • More statistics and guidance
    • Point out known issues
    • Provide references to relevant improvement techniques
exploiting parallelism
Exploiting Parallelism
  • Forms of parallelism
    • Data, task, pipelining, latency hiding, etc.
  • Legacy programming patterns
    • Hand-coded thread creation, scheduling
    • Thread pools, I/O completion ports, asynchronous APIs etc.
  • New programming paradigms
    • Relieve developer from managing threads
    • Express parallelism using simple abstractions
    • Software stack handles the rest
visual studio 2010 tools programming models runtimes18
Visual Studio 2010Tools/programming models/runtimes

Tools

Programming models

PLINQ

Parallel Pattern library

Agents

library

Parallel

Debugger Toolwindows

Task Parallel

library

Data structures

Data structures

Concurrency runtime

Profiler concurrency

analysis

Task scheduler

Thread pool

Task scheduler

Resource manager

Resource manager

Operating system

Threads

Key:

Managed library

Native library

Tools

parallelism in net framework 4 0 parallel extensions
Parallelism In .NET Framework 4.0Parallel Extensions
  • PLINQ – Parallel Language Integrated Query
  • Parallel.For, Parallel.ForEach
  • Parallel.Invoke { stmt1, stmt2,…}
  • Want to learn more?
  • Parallel Programming For Managed Developers With The Next Version Of Microsoft Visual Studio
  • Daniel Moth
  • TL26: 10:30 AM in Petree Hall CD (Wednesday)  
visual studio 2010 tools programming models runtimes20
Visual Studio 2010Tools/programming models/runtimes

Tools

Programming models

PLINQ

Parallel Pattern library

Agents

library

Parallel

Debugger Toolwindows

Task Parallel

library

Data structures

Data structures

Concurrency runtime

Profiler concurrency

analysis

Task scheduler

Thread pool

Task scheduler

Resource manager

Resource manager

Operating system

Threads

Key:

Managed library

Native library

Tools

parallel c applications concurrency runtime and ppl
Parallel C++ ApplicationsConcurrency runtime and PPL
  • Parallel Pattern Library
    • parallel_for – demo later
    • Parallel task invocations
  • Asynchronous agents
  • Concurrency runtime

void quicksort(int * a, int n) { if (n <= 1) return; int s = partition(a,n);

quicksort(a,s);quicksort(a+s,n-s);

return;}

task_group g;g.run([&]{quicksort(a,s);});g.run([&]{quicksort(a+s,n-s);});g.wait();

parallel c applications want to learn more
Parallel C++ ApplicationsWant to learn more?
  • Parallel Programming For C++ Developers In The Next Version Of Microsoft Visual Studio
  • Rick Molloy
  •  TL25: 3:30 PM in 408B (TODAY)
  • Concurrency Runtime Deep Dive: How To Harvest Multicore Computing Resources
  • NiklasGustafsson
  • TL22: 1:15 PM in 408B (Wednesday)
expressing parallelism remaining developer tasks
Expressing ParallelismRemaining developer tasks
  • Ensure that parallel tasks can execute concurrently
    • Without violating order or data dependencies
    • Example: parallel_for loop iterations have to be independent
  • Synchronization
    • Identify races and ordering constraints
    • Add appropriate synchronization primitives
call to action concurrency in visual studio 2010
Call To ActionConcurrency in Visual Studio 2010
  • Many new features for parallel programmers
    • Explore these in the Visual Studio CTP
    • Give us your feedback!
  • Programming constructs to reduce program complexity
    • Managed and native
    • Concurrency runtime
    • Task Parallel library
    • Parallel Pattern library
  • Concurrency analysis tools
    • Analyze concurrency in your application
    • Understand sources of inefficiency
    • Support for TPL and PPL
slide26
Questions?

Concurrency Runtime: TL22: 1:15 PM in 408B (Wednesday)

.NET Performance: TL24: 1:15 PM in 153 (Wednesday)

Native Parallel Programming: TL25: 3:30 PM in 408B (Today)

Managed And Debugging: TL26: 10:30 AM in Petree Hall (Wednesday)

Parallel Computing Symposium: 8:30 AM – 1:30 PM 515A (Thursday)

http://blogs.microsoft.com/hshafi

evals recordings
Evals & Recordings

Please fill out your evaluation for this session at:

This session will be available as a recording at:

www.microsoftpdc.com

slide28

© 2008 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.