windows server 2008 r2 dev session 02

30
CLINT EDMONSON ARCHITECT EVANGELIST [email protected] Windows ® Server 2008 R2: Develop With New Parallel Computing Technologies

Upload: clint-edmonson

Post on 09-May-2015

1.228 views

Category:

Technology


1 download

DESCRIPTION

Windows Server 2008 R2 for Developers Session 2 from the New Efficiency launch tour.

TRANSCRIPT

Page 1: Windows Server 2008 R2 Dev Session 02

CLINT EDMONSONARCHITECT EVANGELIST

[email protected]

Windows® Server 2008 R2: Develop With New Parallel Computing Technologies

Page 2: Windows Server 2008 R2 Dev Session 02

Agenda

Why parallel computing?

The Shift!

The Platform!

The Process!

The Tools!

Page 3: Windows Server 2008 R2 Dev Session 02

Moore’s LawOur Old Friend Gordon Moore

From http://www.intel.com/technology/mooreslaw/ “The number of transistors on a chip will double

about every 2 years” Typically manifested as clock-speed increases We mistakenly associate Moore’s Law with CPU

speed

Page 4: Windows Server 2008 R2 Dev Session 02

Why Can’t We Continue to Scale Up?Heat! Increased clock speed == increases power usage Increased power usage == increased heat output

Image courtesy of http://www.phys.ncku.edu.tw/~htsu/humor/fry_egg.html

Page 5: Windows Server 2008 R2 Dev Session 02

Multi-core Two or more independent cores (or CPUs) Homogenous architecture May be integrated onto a single integrated circuit die May be integrated onto multiple dies in a single chip

package

Many-core Number of processors exceeds traditional multi-processor

techniques Heterogeneous architecture All cores share resource and services like memory and disk

access

Solution: Scale OutMulti-core / Many-core

Page 6: Windows Server 2008 R2 Dev Session 02

The Free Lunch is Over

Page 7: Windows Server 2008 R2 Dev Session 02

Platform must manage resources effectively Programs must be written differently

More than just managing threads Applications must scale up or down

How to Program for Parallel ComputingThe “Many-core Shift”

Page 8: Windows Server 2008 R2 Dev Session 02

Agenda

Parallel computing platform

The Platform!

The Process!

The Tools!

The Shift!

Page 9: Windows Server 2008 R2 Dev Session 02

Windows Server 2008 R2Platform Hardware Trends

Virtualization

Power Efficiency

64-bitMulticore & NUMA

Page 10: Windows Server 2008 R2 Dev Session 02

Helpful Terminology

Logical processor (a.k.a. thread execution engine)

Core A processing unit With hyper-threading, it can consists of 2 or 4 logical

processors

Socket (a.k.a. processor, package, CPU) Physical processor Consists of one or more cores

NUMA node Set of logical processors and cache that are close to one

another

Group 1 or more NUMA nodes Set of up to 64 processors

Page 11: Windows Server 2008 R2 Dev Session 02

Group

NUMA Node

NUMA Node

Socket Socket

Windows Organizes Many-Cores via GroupNew with Windows 7 and Windows Server 2008 R2

Core Core

Core Core

LP LP

LP LP

NUMA = Non-Uniform Memory Access

LP = Logical Processor

Page 12: Windows Server 2008 R2 Dev Session 02

Processor GroupsGroups, 4 Nodes, 8 Sockets, 32 Cores, 4 LPs/Core = 128 LPs

Group

NUMA Node

Socket SocketCore Core

Core Core

Core Core

Core Core

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

NUMA Node

Socket SocketCore Core

Core Core

Core Core

Core Core

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

Group

NUMA Node

Socket SocketCore Core

Core Core

Core Core

Core Core

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

NUMA Node

Socket SocketCore Core

Core Core

Core Core

Core Core

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

LP LP

Page 13: Windows Server 2008 R2 Dev Session 02

Windows on 256 ProcessorsA SQL Server Transaction Processing

Workload

video

Page 14: Windows Server 2008 R2 Dev Session 02

Agenda

Introducing parallelism into your applications

The Process!

The Tools!

The Shift!

The Platform!

Page 15: Windows Server 2008 R2 Dev Session 02

Visual Studio 2010 (.NET Developer)Tools, Programming Models, RuntimesTools Programming Models

.NET Parallel Extensions

.NET Runtime

Parallel LINQ(PLINQ)

Resource Manager

Task Scheduler

Managed Library

Threads Pools

Data

Str

uct

ure

s

Tools

ParallelDebugger

Tool Windows

ParallelProfilerAnalysis

Task ParallelLibrary

Page 16: Windows Server 2008 R2 Dev Session 02

Demystifying Parallel ProgrammingParallel Extensions Make It Easy

demo

Page 17: Windows Server 2008 R2 Dev Session 02

3 Ways to Express Parallelism in Your Apps Imperative Task Parallelism (fine grained) Imperative Data Parallelism (structured) Declarative Data Parallelism (PLINQ)

Page 18: Windows Server 2008 R2 Dev Session 02

Imperative Task Parallelism

Fine-grained parallelism Express potential parallelism via expressions and

statements that take the form of lightweight tasks

You have fine-grained control Semantic is similar to how threads and the

threadpool work today

Page 19: Windows Server 2008 R2 Dev Session 02

Imperative Data Parallelism

Structured parallelism Mechanisms used to express common imperative

data-oriented operations For loops For each loop Invoke

Think in terms of blocks of code Parallelize loops

Page 20: Windows Server 2008 R2 Dev Session 02

Declarative Data Parallelism

PLINQ Implementation of LINQ-to-objects that

execute queries in parallel Express what you want to accomplish, rather

than how you want to accomplish it Minimal impact to existing queries

Page 21: Windows Server 2008 R2 Dev Session 02

Agenda

Visual Studio 2010

The Tools!

The Shift!

The Platform!

The Process!

Page 22: Windows Server 2008 R2 Dev Session 02

Two new debugger tool windows: “Parallel Tasks” “Parallel Stacks”

Debugging Parallel ApplicationsNew in Visual Studio® 2010

Page 23: Windows Server 2008 R2 Dev Session 02

Demystifying Parallel ProgrammingDebugging A Parallel Application

demo

Page 24: Windows Server 2008 R2 Dev Session 02

Parallel Performance AnalyzerCore Utilization View Profiling tools support multi-core/parallel

execution Identify parallelism opportunities Enable performance tuning for parallel apps

Improving the productivity of parallel development and performance tuning Integrated with the IDE Providing better visualizations Showing temporal relationships Illustrating Interactions with OS, libraries and

I/O Exposing causes of inefficiency Providing actionable data by linking behavior to

source code whenever possible

Analysis Views Core utilization and concurrency Thread blocking Cross-core thread migration

Platforms Windows Vista ®, Server 2008,

and Windows 7 32 and 64-bit Native and managed

environments

Number of cores

Your process

Idle time

Other processes

Core Utilization / Concurrency

View

Page 25: Windows Server 2008 R2 Dev Session 02

Parallel Performance AnalyzerThread Blocking View

Thread execution breakdown

Detailed thread analysis

(one channel per thread)

Legend

Hide uninteresting

threads

Measure time for interesting segments

Zoom in and out

Page 26: Windows Server 2008 R2 Dev Session 02

Parallel Performance AnalyzerCore Execution / Thread Migration View

Each core in a swim lane One color per

thread

Red indicates cross-core migrations

This thread migrates across

all four cores

Page 27: Windows Server 2008 R2 Dev Session 02

Start learning to think in parallel Consider how your solution will scale on

multi-core systems Utilize the parallel programming platform

and tools to maximize your application scalability

SummaryCall-to-Action

Page 28: Windows Server 2008 R2 Dev Session 02

Learn More About Windows Server 2008 R2

Resources

Microsoft.com http://www.microsoft.com/windowsserver2008/en/us/

R2.aspx

MSDN Concurrency Developer Center http://msdn.microsoft.com/concurrency

Developer Team Blogs http://blogs.msdn.com/nativeconcurrency http://blogs.msdn.com/pfxteam http://blogs.technet.com/winserverperformance http://www.danielmoth.com/Blog/labels/

ParallelComputing.html

Page 29: Windows Server 2008 R2 Dev Session 02

Visual Studio 2010 with MSDNand The Ultimate Offer

Presenter Name Jerry FlynnPresenter Title Developer Solution Specialist

Microsoft Corporation

presenter Email [email protected]

Page 30: Windows Server 2008 R2 Dev Session 02

© 2009 Microsoft Corporation. All rights reserved. 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.