SlideShare a Scribd company logo
Parallel Computing
      (with GPars)




                     NOV 2011
Evolution

● Old Days
  ○ threads
  ○ synchronize
  ○ locks
  ○ wait-notify
Evolution

● Recent enhancements
  ○ java.util.concurrent.*
  ○ Future task
  ○ Executor Pools
  ○ Blocking Queues
  ○ ConcurrentMap
Evolution

● Emerging Technologies
  ○ Map-Reduce
  ○ API's (Google Collections, JSR-166)
  ○ Non-blocking I/O
  ○ Parallel Friendly Languages (Scala, Clojure, Groovy)
Groovy Parallel Systems

High level abstractions for writing concurrent code!

 ● Code-level Helpers
    ○ Parallel Collections
    ○ Asynchronous Processing
    ○ Fork/Join - Map/Reduce

 ● Architecture-level Concepts
    ○ Dataflows
    ○ Actors

 ● Protecting Shared Mutable State
    ○ Agents
Groovy Parallel Systems

High level abstractions for writing concurrent code!

 ● Code-level Helpers
    ○ Parallel Collections
    ○ Asynchronous Processing
    ○ Fork/Join - Map/Reduce

 ● Architecture-level Concepts
    ○ Dataflows
    ○ Actors (For next time...)

 ● Protecting Shared Mutable State
    ○ Agents (For next time...)
DEMO 1
 (Parallel encryption)
Optimal Thread Pool Size




   Pool size = ???
Optimal Thread Pool Size




   Pool size = Ncores
Optimal Thread Pool Size




   Pool size = Ncores + 1
Optimal Thread Pool Size




   Pool size = Ncores + Block. Op. Ratio
Optimal Thread Pool Size




   Pool size = Ncores + wait time
                         cpu time
DEMO 2
"Dado un rango obtener la cantidad de
nr. primos agrupados por él ultimo digito"
Danger



 Don't mess up with mutable shared data!
DEMO 3
 (Facebook Search)
Collections
 ● eachParallel()
 ● eachWithIndexParallel()
 ● collectParallel()
 ● findAllParallel()
 ● findAnyParallel
 ● findParallel()
 ● everyParallel()
 ● anyParallel()
 ● grepParallel()
 ● groupByParallel()
 ● foldParallel()
 ● minParallel()
 ● maxParallel()
 ● sumParallel()
 ● splitParallel()
 ● countParallel()
 ● foldParallel()
DEMO 4
 (Facebook Singles)
Fork-Join




Map-Reduce
DEMO 5
 (API Calls)
DEMO 6
  (Multiget)
Multiget
+ Info
  ● http://gpars.org/0.12/guide/guide/single.html
  ● http://www.slideshare.net/paulk_asert/concurrency-with-
    gpars
  ● http://gee.cs.oswego.edu/dl/papers/fj.pdf
  ● http://static.googleusercontent.
    com/external_content/untrusted_dlcp/labs.google.
    com/en/us/papers/mapreduce-osdi04.pdf
  ● Java Concurrency in Practice (ISBN-0321349601)


Pics Credits
  ● Stone age: http://tinyurl.com/bvnlv74
  ● Steam train: http://tinyurl.com/6lp3krq
  ● Speed train: http://tinyurl.com/7jjc3v5
  ● CPU: http://www.flickr.com/photos/olivander/149865626/
https://github.com/pablomolnar/gpars_samples




                                    @pmolnar

More Related Content

PDF
ECMAScript: past, present and future
PDF
Распределенные системы хранения данных, особенности реализации DHT в проекте ...
PDF
Clojure Intro
PDF
FleetDB
PDF
Some Tricks in Using Terminal - KienDT
PDF
"Metrics: Where and How", Vsevolod Polyakov
PDF
Be a Zen monk, the Python way
PDF
Scaling metrics
ECMAScript: past, present and future
Распределенные системы хранения данных, особенности реализации DHT в проекте ...
Clojure Intro
FleetDB
Some Tricks in Using Terminal - KienDT
"Metrics: Where and How", Vsevolod Polyakov
Be a Zen monk, the Python way
Scaling metrics

What's hot (18)

PDF
[COSCUP 2018] uTensor C++ Code Generator
PPTX
Your data isn't that big @ Big Things Meetup 2016-05-16
PDF
Toy Model Overview
PDF
.NET Memory Primer (Martin Kulov)
PDF
OSDC 2019 | Fast log management for your infrastructure by Nicolas Frankel
PPTX
Fantastic caches and where to find them
ODP
Lofar python meetup jan9 2013
PDF
Time Series Data with Apache Cassandra (ApacheCon EU 2014)
PPTX
Syslog-ng Performance
PPTX
Всеволод Поляков (DevOps Team Lead в Grammarly)
ODP
bup backup system (2011-04)
PDF
Linux-Permission
KEY
証明駆動開発のたのしみ@名古屋reject会議
PPTX
“Show Me the Garbage!”, Understanding Garbage Collection
PDF
High Performance Systems Without Tears - Scala Days Berlin 2018
PDF
Is It Faster to Go with Redpanda Transactions than Without Them?!
PDF
Restinio - header-only http and websocket server
PDF
JSON's big problem android_taipei_201709
[COSCUP 2018] uTensor C++ Code Generator
Your data isn't that big @ Big Things Meetup 2016-05-16
Toy Model Overview
.NET Memory Primer (Martin Kulov)
OSDC 2019 | Fast log management for your infrastructure by Nicolas Frankel
Fantastic caches and where to find them
Lofar python meetup jan9 2013
Time Series Data with Apache Cassandra (ApacheCon EU 2014)
Syslog-ng Performance
Всеволод Поляков (DevOps Team Lead в Grammarly)
bup backup system (2011-04)
Linux-Permission
証明駆動開発のたのしみ@名古屋reject会議
“Show Me the Garbage!”, Understanding Garbage Collection
High Performance Systems Without Tears - Scala Days Berlin 2018
Is It Faster to Go with Redpanda Transactions than Without Them?!
Restinio - header-only http and websocket server
JSON's big problem android_taipei_201709
Ad

Similar to Parallel computing with GPars (20)

PDF
The Parquet Format and Performance Optimization Opportunities
PDF
“Show Me the Garbage!”, Garbage Collection a Friend or a Foe
PDF
Distributed real time stream processing- why and how
PDF
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
PDF
Real-time analytics with Druid at Appsflyer
ODP
Developing applications with rules, workflow and event processing (it@cork 2010)
PPTX
Journey through high performance django application
PDF
SystemML - Datapalooza Denver - 05.17.16 MWD
PDF
Scio - A Scala API for Google Cloud Dataflow & Apache Beam
PDF
Stripe CTF3 wrap-up
PDF
Handout: 'Open Source Tools & Resources'
PDF
Flink Forward SF 2017: Kenneth Knowles - Back to Sessions overview
PDF
Sorry - How Bieber broke Google Cloud at Spotify
PDF
Developing games and graphic visualizations in Pascal
PPTX
MacGyver Learns Spark
PDF
NetflixOSS meetup lightning talks and roadmap
PDF
Machine learning at Scale with Apache Spark
PPTX
Gpu workshop cluster universe: scripting cuda
PDF
GSoC2014 - Uniritter Presentation May, 2015
PDF
24 uses for perl6
The Parquet Format and Performance Optimization Opportunities
“Show Me the Garbage!”, Garbage Collection a Friend or a Foe
Distributed real time stream processing- why and how
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
Real-time analytics with Druid at Appsflyer
Developing applications with rules, workflow and event processing (it@cork 2010)
Journey through high performance django application
SystemML - Datapalooza Denver - 05.17.16 MWD
Scio - A Scala API for Google Cloud Dataflow & Apache Beam
Stripe CTF3 wrap-up
Handout: 'Open Source Tools & Resources'
Flink Forward SF 2017: Kenneth Knowles - Back to Sessions overview
Sorry - How Bieber broke Google Cloud at Spotify
Developing games and graphic visualizations in Pascal
MacGyver Learns Spark
NetflixOSS meetup lightning talks and roadmap
Machine learning at Scale with Apache Spark
Gpu workshop cluster universe: scripting cuda
GSoC2014 - Uniritter Presentation May, 2015
24 uses for perl6
Ad

Recently uploaded (20)

PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
A Presentation on Artificial Intelligence
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
cuic standard and advanced reporting.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Cloud computing and distributed systems.
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
NewMind AI Weekly Chronicles - August'25 Week I
The Rise and Fall of 3GPP – Time for a Sabbatical?
Dropbox Q2 2025 Financial Results & Investor Presentation
A Presentation on Artificial Intelligence
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
cuic standard and advanced reporting.pdf
Spectral efficient network and resource selection model in 5G networks
Empathic Computing: Creating Shared Understanding
Cloud computing and distributed systems.
Understanding_Digital_Forensics_Presentation.pptx
Network Security Unit 5.pdf for BCA BBA.
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Per capita expenditure prediction using model stacking based on satellite ima...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Parallel computing with GPars

  • 1. Parallel Computing (with GPars) NOV 2011
  • 2. Evolution ● Old Days ○ threads ○ synchronize ○ locks ○ wait-notify
  • 3. Evolution ● Recent enhancements ○ java.util.concurrent.* ○ Future task ○ Executor Pools ○ Blocking Queues ○ ConcurrentMap
  • 4. Evolution ● Emerging Technologies ○ Map-Reduce ○ API's (Google Collections, JSR-166) ○ Non-blocking I/O ○ Parallel Friendly Languages (Scala, Clojure, Groovy)
  • 5. Groovy Parallel Systems High level abstractions for writing concurrent code! ● Code-level Helpers ○ Parallel Collections ○ Asynchronous Processing ○ Fork/Join - Map/Reduce ● Architecture-level Concepts ○ Dataflows ○ Actors ● Protecting Shared Mutable State ○ Agents
  • 6. Groovy Parallel Systems High level abstractions for writing concurrent code! ● Code-level Helpers ○ Parallel Collections ○ Asynchronous Processing ○ Fork/Join - Map/Reduce ● Architecture-level Concepts ○ Dataflows ○ Actors (For next time...) ● Protecting Shared Mutable State ○ Agents (For next time...)
  • 7. DEMO 1 (Parallel encryption)
  • 8. Optimal Thread Pool Size Pool size = ???
  • 9. Optimal Thread Pool Size Pool size = Ncores
  • 10. Optimal Thread Pool Size Pool size = Ncores + 1
  • 11. Optimal Thread Pool Size Pool size = Ncores + Block. Op. Ratio
  • 12. Optimal Thread Pool Size Pool size = Ncores + wait time cpu time
  • 13. DEMO 2 "Dado un rango obtener la cantidad de nr. primos agrupados por él ultimo digito"
  • 14. Danger Don't mess up with mutable shared data!
  • 15. DEMO 3 (Facebook Search)
  • 16. Collections ● eachParallel() ● eachWithIndexParallel() ● collectParallel() ● findAllParallel() ● findAnyParallel ● findParallel() ● everyParallel() ● anyParallel() ● grepParallel() ● groupByParallel() ● foldParallel() ● minParallel() ● maxParallel() ● sumParallel() ● splitParallel() ● countParallel() ● foldParallel()
  • 17. DEMO 4 (Facebook Singles)
  • 19. DEMO 5 (API Calls)
  • 20. DEMO 6 (Multiget)
  • 22. + Info ● http://gpars.org/0.12/guide/guide/single.html ● http://www.slideshare.net/paulk_asert/concurrency-with- gpars ● http://gee.cs.oswego.edu/dl/papers/fj.pdf ● http://static.googleusercontent. com/external_content/untrusted_dlcp/labs.google. com/en/us/papers/mapreduce-osdi04.pdf ● Java Concurrency in Practice (ISBN-0321349601) Pics Credits ● Stone age: http://tinyurl.com/bvnlv74 ● Steam train: http://tinyurl.com/6lp3krq ● Speed train: http://tinyurl.com/7jjc3v5 ● CPU: http://www.flickr.com/photos/olivander/149865626/