 Rick Molloy Program Manager Microsoft Corporation TL25.

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Taylor Brown Test Lead Microsoft Corporation ES09.
Parallel Performance Tools in Visual Studio 2010.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
 Niklas Gustafsson Software Architect Microsoft Corporation TL22.
 Josh Honeyman Sr. Development Lead Microsoft Corporation BB57.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Jesse Kaplan Program Manager Microsoft Corporation TL34.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Payroll and HR Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Parametric Sweeps Cluster SOA MPI LINQ to HPC Excel Cluster Deployment Monitoring Diagnostics Reporting Job submission API and portal.
 Phil Haack Senior Program Manager Microsoft Corporation PC21.
Amalga UIS Modules Medical Imaging Research Foundation Quality Measures Other HealthVault Partner Applications Microsoft Partner Solutions.
Daniel Moth  Parallel Computing Platform Microsoft Corporation TL26.
 Nishant Gupta Program Manager Live Services Microsoft Corporation BB51.
Co- location Mass Market Managed Hosting ISV Hosting.
 Alexander Malek Lead Program Manager SharePoint Microsoft Corporation BB47.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: SmartList Usability Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
 Frank Savage Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Lynne Hill General Manager Parallel Computing Platform Visual Studio.
Inspire and enable transformative user experiences for retrieving and exploring content regardless of location.
 Chaitanya Sareen Senior Program Manager Microsoft Corporation PC24.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Connect with life Connect with life
NEXT: Overview – Sharing skills & code.
A Windows Azure application runs multiple instances of each role A Windows Azure application behaves correctly when.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Suggested Item Enhancements – Sales Script and Additional Information © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
 Paul Vick Principal Architect Microsoft Corporation  Lucian Wischik Software Engineer Microsoft Corporation.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Parallel Pattern Library Resource Manager Task Scheduler Task Parallel Library Task Parallel Library Parallel LINQ Managed Native Key: Threads Operating.
demo Demo.
Feature: Void Historical/Open Transaction Updates © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
 Boris Jabes Program Manager Lead Microsoft Corporation TL13.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

IoCompleteRequest (Irp);... p = NULL; …f(p);
MIX 09 4/17/2018 4:41 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Lighting Up Windows Server 2008 R2 Using the ConcRT on UMS
Task Parallel Library: Design Principles and Best Practices
Возможности Excel 2010, о которых следует знать
C++ Forever: Interactive Applications in the Age of Manycore
An Introduction To Microsoft F#
Title of Presentation 12/2/2018 3:48 PM
F# for Parallel and Asynchronous Programming
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.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Jason Zander Unplugged
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
Presentation transcript:

 Rick Molloy Program Manager Microsoft Corporation TL25

Make it easier to express and manage the correctness, efficiency and maintainability of parallelism on Microsoft platforms for developers of all skill levels Enable developers to express parallelism easily and focus on the problem to be solved Improve the efficiency and scalability of parallel applications Simplify the process of designing and testing parallel applications

void MatrixMult( int size, double** m1, double** m2, double** result) { for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { result[i][j] = 0; for (int k = 0; k < size; k++) { result[i][j] += m1[i][k] * m2[k][j]; }

void MatrixMult( int size, double** m1, double** m2, double** result) { int N = size; int P = 2 * NUMPROCS; int Chunk = N / P; HANDLE hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); long counter = P; for (int c = 0; c < P; c++) { std::thread t ([&,c] { for (int i = c * Chunk; i < (c + 1 == P ? N : (c + 1) * Chunk); i++) { for (int j = 0; j < size; j++) { result[i][j] = 0; for (int k = 0; k < size; k++) { result[i][j] += m1[i][k] * m2[k][j]; } if (InterlockedDecrement(counter) == 0) SetEvent(hEvent); }); } WaitForSingleObject(hEvent,INFINITE); CloseHandle(hEvent); } Synchronization Knowledge Error prone Heavy synchronization Static partitioning Lack of thread reuse Tricks Lots of boilerplate

MSFT Parallel Computing Technologies Robotics-based manufacturing assembly line Silverlight Olympics viewer Enterprise search, OLTP, collab Animation / CGI rendering Weather forecasting Seismic monitoring Oil exploration Automotive control system Internet –based photo services Ultrasound imaging equipment Media encode/decode Image processing/ enhancement Data visualization Task Concurrency Data Parallelism Distributed/ Cloud Computing Local Computing CCR Maestro TPL / PPL Cluster TPL Cluster PLINQ MPI / MPI.Net WCF Cluster SOA WF PLINQ TPL / PPL CDS OpenMP WF Compute Shader

AreaDescriptionsExample Scenarios Imperative Data Parallelism Apply the same operation to common collections/sets in parallel. Looping, data partitioning, divide-and-conquer, reductions, scans, etc. Medical imaging Bond pricing Task Parallelism Simultaneously perform multiple independent operations. Tasks, threads, fork/join, futures, etc. Process control automation Shared Resources Building blocks for implementing concurrent components. Scalable and thread-safe collections, locks, etc. Middle-tier configuration/ state management Declarative Data Parallelism Define what computation needs to be done, without the how. Selections, filters, joins, aggregations, groupings, etc. Statistical modeling Asynchrony Exploit latent operations by doing work while waiting for data. Asynch I/O, async interaction points, message passing, etc. Streaming audio

Scenario: Simple Image Processing Pipeline task transform / parallel for search for files transform load image from disk image filters transform / parallel for transform load image from disk image filters alternator load balance unbounded buffer image ready

Parallel Pattern Library Resource Manager Task Scheduler Task Parallel Library Task Parallel Library PLINQ Managed Library Native Library Key: Threads Operating System Concurrency Runtime Programming Models Agents Library Agents Library ThreadPool Task Scheduler Resource Manager Data Structures Tools Parallel Debugger Tool Windows Parallel Debugger Tool Windows Profiler Concurrency Analysis Profiler Concurrency Analysis

Parallel Pattern Library Resource Manager Task Scheduler Task Parallel Library Task Parallel Library PLINQ Managed Library Native Library Key: Threads Operating System Concurrency Runtime Programming Models Agents Library Agents Library ThreadPool Task Scheduler Resource Manager Data Structures Tools Parallel Debugger Tool Windows Parallel Debugger Tool Windows Profiler Concurrency Analysis Profiler Concurrency Analysis

Visual Studio 10 Concurrency Runtime Programming Model Operating System Platform Infrastructure for Concurrency Low overhead scheduling and load balancing Cooperative blocking Support for multiple scheduler instances Resource management Common resource management Dynamic load balancing between schedulers Platform extensibility and composability Enables ISVs and partners to integrate concurrent libraries with the Scheduler and Resource Manager

Visual Studio 10 Concurrency Runtime Programming Model Operating System Platform Infrastructure for Concurrency Low overhead scheduling and load balancing Cooperative blocking Support for multiple scheduler instances Resource management Common resource management Dynamic load balancing between schedulers Platform extensibility and composability Enables ISVs and partners to integrate concurrent libraries with the Scheduler and Resource Manager OpenMP Threading Building Blocks Intel Parallel Studio

Visual Studio 10 Programming Model Operating System OpenMP Threading Building Blocks Intel Parallel Studio Reduce the number of concepts to learn through interfaces and containers common to TBB and PPL Encourage broader adoption by aligning interfaces and responding to customer feedback Better application scalability and composability with platform integration Concurrency Runtime

Dynamic scheduling allows work to be distributed efficiently at runtime. CPU0 CPU1 CPU2 CPU3 CPU0 CPU1 CPU2 CPU3

Parallel Pattern Library Resource Manager Task Scheduler Task Parallel Library Task Parallel Library PLINQ Managed Library Native Library Key: Threads Operating System Concurrency Runtime Programming Models Agents Library Agents Library ThreadPool Task Scheduler Resource Manager Data Structures Tools Parallel Debugger Tool Windows Parallel Debugger Tool Windows Concurrent Profiling Concurrent Profiling

Visual Studio 10 Concurrency Runtime Operating System Simplify writing parallel applications by raising the level of abstraction Simplify writing parallel applications by providing alternatives to shared state Unlock Platform Performance by providing developers with concurrent algorithms and containers

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

void quicksort(int * a, int n) { if (n <= 1) return; int s = partition(a,n); task_group g; g.run([&]{quicksort(a,s);}); g.run([&]{quicksort(a+s,n-s);}); g.wait(); }

Parallel Pattern Library Resource Manager Task Scheduler Task Parallel Library Task Parallel Library PLINQ Managed Library Native Library Key: Threads Operating System Concurrency Runtime Programming Models Agents Library Agents Library ThreadPool Task Scheduler Resource Manager Data Structures Tools Parallel Debugger Tool Windows Parallel Debugger Tool Windows Concurrent Profiling Concurrent Profiling

Parallel Pattern Library Resource Manager Task Scheduler Task Parallel Library Task Parallel Library PLINQ Managed Library Native Library Key: Threads Operating System Concurrency Runtime Programming Models Agents Library Agents Library ThreadPool Task Scheduler Resource Manager Data Structures Tools Parallel Debugger Tools Windows Parallel Debugger Tools Windows Concurrent Profiling Concurrent Profiling

int sum = 0; for (vector ::iterator it = myVec.begin(); it != myVec.end(); ++it) { int element = *it; SomeFineGrainComputation(element); sum += element; }

combinable localSums; parallel_for_each(myVec.begin(), myVec.end(), [&localSums] (int element) { SomeFineGrainComputation(element); localSums.local() += element; }); int sum = localSums.combine(std::plus );

//a vector of imagePaths vector images; list imageList for_each(images.begin(),images.end(),[&](string path){ Cimage* image = new Cimage(); image->Load(path.c_str()); imageList.push_back(image); }

//a vector of imagePaths vector images; //a combinable list combinable > combinableImageList; parallel_for_each(images.begin(),images.end(),[&](string path){ Cimage* image = new Cimage(); image->Load(path.c_str()); combinableImageList.local().push_back(image); } //our result list list imageList; combinableImageList.combine_each([&](list & localList){ imageList.splice(resultImageList.begin(),localList); });

Express Concurrency in C++

Parallel Pattern Library Resource Manager Task Scheduler Task Parallel Library Task Parallel Library PLINQ Managed Library Native Library Key: Threads Operating System Concurrency Runtime Programming Models Agents Library Agents Library ThreadPool Task Scheduler Resource Manager Data Structures Tools Parallel Debugger Tool Windows Parallel Debugger Tool Windows Concurrent Profiling Concurrent Profiling

Visual Studio 10 Concurrency Runtime Operating System Simplify writing parallel applications by raising the level of abstraction Simplify writing parallel applications providing alternatives to shared state by providing alternatives to shared state Unlock Platform Performance by providing developers with concurrent algorithms and containers

HRESULT LogChunkFileParser::ParseFile() { HRESULT hr = S_OK; WCHAR wszLine[MAX_LINE] = {0}; hr = reader->OpenFile(pFileName); if (SUCCEEDED(hr)){ while(!reader->EndOfFile()){ //read the next line hr = reader->ReadLine(wszLine, MAX_LINE); if (SUCCEEDED(hr)){ //and parse it Parse(wszLine); } return S_OK; }

HRESULT LogChunkFileParser::ParseFile(){ unbounded_buffer * MsgBuffer= new unbounded_buffer (); ParserAgent parseAgent; parseAgent.start(); HRESULT hr = S_OK; WCHAR* wszLine; hr = reader->OpenFile(pFileName); if (SUCCEEDED(hr)){ while(!reader->EndOfFile()){ wszLine = new WCHAR[MAX_LINE]; // read the next line hr = reader->ReadLine(wszLine, MAX_LINE); if (SUCCEEDED(hr)){ //and parse it send(MsgBuffer, AgentMessage(wszLine)); } send(MsgBuffer, AgentMessage(EXIT)); parseAgent.wait(); } return hr; }; class ParserAgent : agent{ unbounded_buffer & buf_; public: … void Run(){ AgentMessage msg; while((msg = receive(buf_))->type != EXIT) { Parse(msg->pCurrentLine); delete msg->pCurrentLine; } }); class ParserAgent : agent{ unbounded_buffer & buf_; public: … void Run(){ AgentMessage msg; while((msg = receive(buf_))->type != EXIT) { Parse(msg->pCurrentLine); delete msg->pCurrentLine; } });

PDC Parallelism Sessions

And download Parallel Extensions to the.NET Framework!

Please fill out your evaluation for this session at: This session will be available as a recording at:

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