49
Designing Applications in the era of Many-core Computing Tiberiu Covaci Senior Technical Trainer Many-core DEV 315

Designing Applications in the era of Many-core Computing

  • Upload
    wynn

  • View
    21

  • Download
    0

Embed Size (px)

DESCRIPTION

DEV 315. Designing Applications in the era of Many-core Computing. Tiberiu Covaci Senior Technical Trainer Many-core. Who am I?. Tiberiu ’Tibi’ Covaci Software engineer, over 20 years experience MCT since 2004, teaching .NET Researcher at KTH Sweden - PowerPoint PPT Presentation

Citation preview

Designing Applications in the era of Many-core Computing

Tiberiu CovaciSenior Technical TrainerMany-core

DEV 315

Who am I?

Tiberiu ’Tibi’ CovaciSoftware engineer, over 20 years experienceMCT since 2004, teaching .NETResearcher at KTH SwedenINETA Speaker & Country Lead for SwedenTelerik MVP/Insider@tibor19 #msteched

Current state

Clock speed has reached an upper limit and can not be increasedMoore’s law is alive and kickingProcessors makers are doing multicoreMulticore software is hard

Amdahl's law (optional)Three reasons why it is hardConclusion, we and no one else has any idea how to do multicore software, but it is a glorious and shiny future.

Agenda

DefinitionsHow to create parallel applicationFinding concurrency Strategies for exploiting concurrencyAlgorithm structuresSupporting structuresSharing state

Definitions

PatternsPattern languagesProgramming roles

Patterns

A generally accepted solution to a recurring problem

Patterns

A generally accepted solution to a recurring problem

– Name– Problem– Context– Forces– Solution

– Invariant– Examples– Known Uses– Related patterns

Characteristics:

Patterns

A generally accepted solution to a recurring problem

– Name– Problem– Context– Forces– Solution

– Invariant– Examples– Known Uses– Related patterns

Characteristics:

Pattern language

Collection of related patterns one flowing in to the other as you solve the problem

Programming roles

Application programmerApplication framework developerParallel programming framework developersPlatform programmers

THE PROBLEM

How to create parallel applications

Finding ConcurrencyOriginal Problem

Original Problem

Algorithm Structure

Tasks, shared and local data

Corresponding source code

Task t1 = Task.Factory.StartN

ew(…);

Units of execution & new shared data for extracted dependencies

Supporting Structures & Implementation Mechanisms

Finding Concurrency

Finding Concurrency

Tasks, shared and local data

Original Problem

Original Problem

Finding Concurrency

Decomposition AnalysisDependency AnalysisDesign Evaluation

Decomposition Analysis

Task Decomposition Data Decomposition

Dependency Analysis

Group TasksOrder TasksData Sharing

Design Evaluation

Is the decomposition and the dependency analysis good enough so we can continue?

DEMO

Step 1 Step 2 Step 3 Step 4

Peel and Dice Oninons

Fry the Onion

Sprinkle Paprika

Add Water

Dice TheMeat

Add Some Spices

Cut And Clean The Chilies

Cook 40 minutes

Peel and Dice Potatoes

Cook 10 minutes

Cut The Peppers

Cook 5 minutes

Peel and Dice Oninons

Fry the Onion

Sprinkle Paprika

Add Water

Dice TheMeat

Add Some Spices

Cut And Clean The Chilies

Cook 40 minutes

Peel and Dice Potatoes

Cook 10 minutes

Cut The Peppers

Cook 5 minutes

Strategies for exploiting concurrency

Finding ConcurrencyOriginal Problem

Original Problem

Algorithm Structure

Tasks, shared and local data

Units of execution & new shared data for extracted dependencies

Strategies for exploiting concurrency

Agenda parallelismResult parallelismSpecialist parallelism

Agenda parallelism

Algorithms are naturally expressed in terms of the actions to be carried out by the program

Agenda parallelism

Task ParallelismDelightfully parallelSeparable dependencies

Divide and conquer

DEMO

Result parallelism

Algorithms are defined in terms of data structures and how they are decomposed

Result parallelism

Geometric DecompositionRecursive DataData Parallelism

DEMO

Specialist parallelism

A fixed set of tasks that data flows through

Specialist parallelism

Pipeline Event-based Coordination

DEMO

Finding ConcurrencyOriginal Problem

Original Problem

Algorithm Stru

cture

Tasks, shared and local data

Corresponding source code

Task t1 = Task.Factory.StartNew

(…);

Units of execution & new shared data for extracted dependencies

Supporting Structures & Implementation Mechanisms

Supporting Structures & Implementation mechanism

Supporting Structures & Implementation mechanism

Program StructuresData StructuresUnit of Execution ManagementCommunicationSynchronization

Sharing State and Synchronization

Don’t share!Read only dataData isolationSynchronization

Synchronization

Memory synchronization / fencesBarriersMutual exclusion

Deadlocks

Mutual exclusionHold and waitNo preemptionCircular wait

Source: More Patterns for Parallel Application Programs, Berna L. Massingill, Timothy G. Mattson and Beverly A. Sanders

Master/Worker

SPMD Loop Parallel

Fork/Join

DistributedArray Map

Reduce

Actors

SOA Facade

Repository

MPMD

Pipeline

Producer/Consumer

Shared Queue

Divide & Conquer

Summary

DefinitionsHow to create parallel applicationFinding concurrency Strategies for exploiting concurrencyAlgorithm structures

Summary

Supporting structuresSharing stateDeadlocksHow to make GoulashHow to get help in the kitchen

Where do we go from here?

http://msdn.com/concurrencyhttp://software.intel.com/en-us/multi-core/http://[email protected]

Conclusions

Embrace parallelism!

Thank you!

Related Content

DEV303 - Modern Native C++ Development for Maximum ProductivityDEV323 | A Taste of F#: Today and Future

DEV277-HOL Introduction to the Parallel Extensions Library

Find Me Later At Ask an Architect Booth

Questions?

http://msdn.com/concurrencyhttp://software.intel.com/en-us/multi-core/http://[email protected]

DEV Track Resources

http://www.microsoft.com/visualstudio http://www.microsoft.com/visualstudio/en-us/lightswitch http://www.microsoft.com/expression/http://blogs.msdn.com/b/somasegar/http://blogs.msdn.com/b/bharry/http://www.microsoft.com/sqlserver/en/us/default.aspxhttp://www.facebook.com/visualstudio

Resources

www.microsoft.com/teched

Sessions On-Demand & Community Microsoft Certification & Training Resources

Resources for IT Professionals Resources for Developers

www.microsoft.com/learning

http://microsoft.com/technet http://microsoft.com/msdn

Learning

http://northamerica.msteched.com

Connect. Share. Discuss.

Complete an evaluation on CommNet and enter to win!

Scan the Tag to evaluate this session now on myTech•Ed Mobile