Plinq Presentation Steen L. Knudsen

Slides:



Advertisements
Similar presentations
PL/SQL : Stop making the same performance mistakes
Advertisements

Easily retrieve data from the Baan database
Computer Science 320 Clumping in Parallel Java. Sequential vs Parallel Program Initial setup Execute the computation Clean up Initial setup Create a parallel.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Chris Gill Department of Computer Science and Engineering Washington University in St. Louis.
James Kolpack, InRAD LLC popcyclical.com. CodeStock is proudly partnered with: Send instant feedback on this session via Twitter: Send a direct message.
Parallel Extensions to the.NET Framework Daniel Moth Microsoft
FUTURE OF.NET PARALLEL PROGRAMMING Joseph Albahari SESSION CODE: DEV308 (c) 2011 Microsoft. All rights reserved.
IAP C# Lecture 3 Parallel Computing Geza Kovacs. Sequential Execution So far, all our code has been executing instructions one after another, on a single.
Threads in C# Threads in C#.
VBA Modules, Functions, Variables, and Constants
Virtual techdays INDIA │ 9-11 February 2011 Parallelism in.NET 4.0 Parag Paithankar │ Technology Advisor - Web, Microsoft India.
Parallel Programming in Visual Studio 2010 Sasha Goldshtein Senior Consultant, Sela Group
CS220 Software Development Lecture: Multi-threading A. O’Riordan, 2009.
An introduction to F# (part 2) Bogdan Brinzarea-Iamandi Banca Romaneasca 25 February 2010.
PARALLEL PROGRAMMING ABSTRACTIONS 6/16/2010 Parallel Programming Abstractions 1.
Connect with life Bijoy Singhal Developer Evangelist | Microsoft India.
Parallel Programming in.NET Kevin Luty.  History of Parallelism  Benefits of Parallel Programming and Designs  What to Consider  Defining Types of.
SEC(R) 2008 Intel® Concurrent Collections for C++ - a model for parallel programming Nikolay Kurtov Software and Services.
Slides Prepared from the CI-Tutor Courses at NCSA By S. Masoud Sadjadi School of Computing and Information Sciences Florida.
Phil Pennington Sr. Developer Evangelist Microsoft Corporation SESSION CODE: WSV325.
Christopher Jeffers August 2012
Collage of Information Technology University of Palestine Advanced programming MultiThreading 1.
/425 Declarative Methods - J. Eisner /425 Declarative Methods Prof. Jason Eisner MWF 3-4pm (sometimes 3-4:15)
Week 3, Day 1: Processes & Threads Return Quiz Processes Threads Lab: Quiz Lab 3: Strategy & Factory Patterns! SE-2811 Slide design: Dr. Mark L. Hornick.
Parallel Extensions A glimpse into the parallel universe By Eric De Carufel Microsoft.NET Solution Architect at Orckestra
Quick overview of threads in Java Babak Esfandiari (extracted from Qusay Mahmoud’s slides)
Parallel Programming in.NET 4.0 Tasks and Threading Ingo Rammer, thinktecture
Monads Steve Goguen. About Me Web Developer for Allied Building Supply  ASP.NET, SQL Server, LINQ, etc. Website:
Parallel Extensions A glimpse into the parallel universe Eric De Carufel
Task Parallel Library (TPL)
CPS216: Advanced Database Systems (Data-intensive Computing Systems) Introduction to MapReduce and Hadoop Shivnath Babu.
Week 3, Day 1: Processes & Threads Processes Threads SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
SALSASALSASALSASALSA Design Pattern for Scientific Applications in DryadLINQ CTP DataCloud-SC11 Hui Li Yang Ruan, Yuduo Zhou Judy Qiu, Geoffrey Fox.
Parallel Programming: Responsiveness vs. Performance Joe Hummel, PhD Microsoft MVP Visual C++ Technical Staff: Pluralsight, LLC Professor: U. of Illinois,
About Me Microsoft MVP Intel Blogger TechEd Israel, TechEd Europe Expert C++ Book
Frontiers in Massive Data Analysis Chapter 3.  Difficult to include data from multiple sources  Each organization develops a unique way of representing.
Robert Vitolo CS474.  Branched off of ML (metalanguage)  Developed at Microsoft, available as part of the Visual Studio 2010 software package, integrated.
MATRIX MULTIPLY WITH DRYAD B649 Course Project Introduction.
Parallel Extensions A glimpse into the parallel universe By Eric De Carufel Microsoft.NET Solution Architect at Orckestra
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
Making Watson Fast Daniel Brown HON111. Need for Watson to be fast to play Jeopardy successfully – All computations have to be done in a few seconds –
Huseyin YILDIZ Software Design Engineer Microsoft Corporation SESSION CODE: DEV314.
Module 8 Enhancing User Interface Responsiveness.
LINQ & PLINQ (Parallel) Language Integrated Query.
Data Parallelism Task Parallel Library (TPL) The use of lambdas Map-Reduce Pattern FEN 20141UCN Teknologi/act2learn.
Inside LINQ to Objects How LINQ to Objects work Inside LINQ1.
DEV303. Tiny Functions Why Does It Need a Name?
Visual Studio 2010 and.NET Framework 4 Training Workshop.
LINQ Language Integrated Query LINQ1. LINQ: Why and what? Problem Many data sources: Relational databases, XML, in-memory data structures, objects, etc.
3/12/2013Computer Engg, IIT(BHU)1 OpenMP-1. OpenMP is a portable, multiprocessing API for shared memory computers OpenMP is not a “language” Instead,
Welcome to IBC233 Cindy Laurin And Russ Pangborn.
 Parallel Programming in C# Pro.Net Programming in C#, Adam Freeman.
Introduction to.NET Florin Olariu “Alexandru Ioan Cuza”, University of Iai Department of Computer Science.
Chapter 4: Threads.
Easily retrieve data from the Baan database
CS240: Advanced Programming Concepts
Async or Parallel? No they aren’t the same thing!
Computer Engg, IIT(BHU)
Task Parallel Library: Design Principles and Best Practices
MapReduce Computing Paradigm Basics Fall 2013 Elke A. Rundensteiner
April 30th – Scheduling / parallel
Staying Afloat in the .NET Async Ocean
Lecture 17: Distributed Transactions
湖南大学-信息科学与工程学院-计算机与科学系
Welcome to IBC233 Taught by Cindy Laurin.
Welcome to IBC233 Taught by Cindy Laurin.
How I Learned to Love FastMM Internals
Prof. Jason Eisner MWF 3-4pm (sometimes 3-4:15)
Visual Studio 2010 and .NET Framework 4 Training Workshop
Lecture 20 Parallel Programming CSE /8/2019.
Presentation transcript:

Plinq Presentation Steen L. Knudsen

? Datalog fra Århus Speciale: Neural Networks DDE / Ehuset KMD Bluetags Statsbilioteket Saxotech Gatehouse Nordjysk Elhandel

NEAS.DK Nordjysk Elhandel Pris aftaler el forbrug Pris aftaler el produktion Klima Trading

Agenda Quick Linq Intro Plinq Intro Plinq Pitfalls Task Parallel Library

Quick Linq Intro Slides by Paul Litwin

PLinq Parrallel Linq Make it easy for the developer to take advantage of multiple cores. Declarative way of expressing parrallel computations

Thread Pool A lot of code needed to manage the plumbing invovled in this

Plinq thread Pool Split the enumerable list into partitions and let the threads run the tasks

AsParrallel.AsParrallel Extension to IEnumerable public static ParallelQuery AsParallel( this IEnumerable source ) The Ienumerable source should represent the tasks that should run in parrallel

ParallelQuery.WithDegreeOfParallelism() The number of threads to be used Example:

Partitioner The Plinq runtime choose how to partition the source The default for List source is the range partitioner

Partitioner Chunk Partitioning Striped Partitioning Hash Partitioning

Partitioner You can write a custom Partitioner that inherits from Partitioner This can tune the performance if the partitioning is a bottleneck Example

ParallelQuery WithMergeOptions() FullyBuffered each thread process the part, then merge Example

ParallelQuery WithCancellation(CancellationToken) Makes it possible to cancel the parrallel query AsOrdered() Wait for all threads to finish and then orders the result as a normal query

ParallelQuery ForAll() Do some work for all elements but returns nothing

Exceptions AggregateException Collects all the exceptions thrown by the threads InnerExceptions member returns the list of exceptions

When to use Plinq N elements - M threads - T time to process Overhead Split the enumerable into parts O(N) Start the threads O(M) Merge the part results into the complete result O(N) Gain O(N/M*T) O(N/M*T) > (2*O(N)+ O(M))

Plinq and db sources Beware if the source for the AsParrallel is a database source. Example

Task Parallel Library

Parallel.Invoke Parallel.Invoke( () => MethodA(), () => MethodB(), () => MethodC()); Parallel.ForEach Parallel.ForEach(list, e => { DoWork(e) }); Parallel.For Parallel.For(start, end, (i) => DoSomeWork(i));

Task Parallel Library Task ”Future” a proxy for an object not yet computed. Task task = Task.Factory.StartNew(() => DoAction()); Is the task done : If(task.IsCompleted) Wait to the job to be done task.Wait();