5 PLINQ and MapReduce: data parallelism, part 2

 

This chapter covers

  • Using declarative programming semantics
  • Isolating and controlling side effects
  • Implementing and using a parallel Reduce function
  • Maximizing hardware resource utilization
  • Implementing a reusable parallel MapReduce pattern

This chapter presents MapReduce, one of the most widely used functional programming patterns in software engineering. Before delving into MapReduce, we’ll analyze the declarative programming style that the functional paradigm emphasizes and enforces, using PLINQ and the idiomatic F#, PSeq. Both technologies analyze a query statement at runtime and make the best strategy decision concerning how to execute the query in accordance with available system resources. Consequently, the more CPU power added to the computer, the faster your code will run. Using these strategies, you can develop code ready for next-generation computers. Next, you’ll learn how to implement a parallel Reduce function in .NET, which you can reuse in your daily work to increase the speed of execution of aggregates functions.

Using FP, you can engage data parallelism in your programs without introducing complexity, compared to conventional programming. FP prefers declarative over procedural semantics to express the intent of a program instead of describing the steps to achieve the task. This declarative programming style simplifies the adoption of parallelism in your code.

5.1 A short introduction to PLINQ

 

5.1.1 How is PLINQ more functional?

 
 
 
 

5.1.2 PLINQ and pure functions: the parallel word counter

 
 
 
 

5.1.3 Avoiding side effects with pure functions

 
 
 
 

5.1.4 Isolate and control side effects: refactoring the parallel word counter

 
 
 
 

5.2 Aggregating and reducing data in parallel

 

5.2.1 Deforesting: one of many advantages to folding

 
 

5.2.2 Fold in PLINQ: Aggregate functions

 
 

Understanding how partitioning works

 
 
 

5.2.3 Implementing a parallel Reduce function for PLINQ

 

5.2.4 Parallel list comprehension in F#: PSeq

 
 

5.2.5 Parallel arrays in F#

 

5.3 Parallel MapReduce pattern

 
 
 

5.3.1 The Map and Reduce functions

 
 
 

5.3.2 Using MapReduce with the NuGet package gallery

 
 
 
 

Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest