SlideShare a Scribd company logo
Python Multiprocessing,
Celery or PP
for
Dynamic Model
Applications
Ghazal Tashakor
https://www.linkedin.com/in/tashakor/
Parallel Programming in Python(PP)
Within parallel programming, Python has
built-in and external modules that simplify
implementation.
Parallelizable Problems
1. Obtaining the highest Fibonacci value
for multiple inputs
2. Crawling the Web
Python PP Tools
1. The PythonThreading Module
2. The Python Multiprocessing Module
3. The Parallel Python Module
4. Celery – A Distributed Task Queue
Disadvantages of Threads
1. Harm the performance of the application
2. Sharing data and scalability is poor
Data Buffering in Multiprocessing
Module solution
Although the user of Multiprocessing and
ProcessPoolExecutor in python could solve
the parallelizable problems and does not need
to use synchronization mechanisms, such as
Locks for instance, but internally, these
mechanisms are used to transport data among
buffers and pipes in order to accomplish
communication.
Advantage of using PP module
1. Automatic detection of number of
processors to improve load balance
2. Many processors allocated can be
changed at runtime
3. Load balance at runtime
4. Auto-discovery resources throughout the
network
Advantage of using Celery
1. Improved version of the
multiprocessing pool (pool as a
service)
2. Best for shared-arrays
Distributing Tasks with Celery
Celery is a framework that offers
mechanisms to lessen difficulties while
creating distributed systems. The Celery
framework works with the concept of
distribution of work units (tasks) by
exchanging messages among the
machines that are interconnected as a
network, or local workers.
A task is the key concept in Celery; any
sort of job we must distribute has to be
encapsulated in a task beforehand.
Parallel Algorithms

The divide and conquer technique

Data decomposition
(we used to creat low cost the user thread)
Not good in the case of reality

Decomposing tasks with pipeline

Processing and mapping
Data Decomposition problem
We used it to solve the matrix problem
where each necessary operation to get to
the final result was executed by a single
worker, and each worker executed the
same number of operations. In real world,
there is an asymmetry of the relation
between the number of workers and the
quantity of data that is decomposed, and
this directly affects the performance of the
solution.
Processing and mapping solution
1. Identifying the tasks that require data
exchange
2. Grouping the tasks that establish
constant communication in a single
worker can enhance the performance.
This is true when there is a large load of data
communication as it may help reduce the
overhead in exchange of the information within
the tasks.
Resources/Books
1. Parallel Programming with Python – June 25, 2014 by Jan Palach
2. Distributed Computing with Python – April 2016 by Francesco Pierfederici
3. Parallel, Distributed Scripting with Python by P. Miller Center for Applied Scientific Computing

More Related Content

Similar to Paralle Programming in Python

Performance evaluation of larger matrices over cluster of four nodes using mpi
Performance evaluation of larger matrices over cluster of four nodes using mpiPerformance evaluation of larger matrices over cluster of four nodes using mpi
Performance evaluation of larger matrices over cluster of four nodes using mpi
eSAT Journals
 
CS8603_Notes_003-1_edubuzz360.pdf
CS8603_Notes_003-1_edubuzz360.pdfCS8603_Notes_003-1_edubuzz360.pdf
CS8603_Notes_003-1_edubuzz360.pdf
KishaKiddo
 

Similar to Paralle Programming in Python (20)

Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP
Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP
Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP
 
Web Oriented FIM for large scale dataset using Hadoop
Web Oriented FIM for large scale dataset using HadoopWeb Oriented FIM for large scale dataset using Hadoop
Web Oriented FIM for large scale dataset using Hadoop
 
Concurrency and parallel in .net
Concurrency and parallel in .netConcurrency and parallel in .net
Concurrency and parallel in .net
 
Multithreading by rj
Multithreading by rjMultithreading by rj
Multithreading by rj
 
Advanced computer architecture unit 5
Advanced computer architecture  unit 5Advanced computer architecture  unit 5
Advanced computer architecture unit 5
 
Introduction to Data Structure & algorithm
Introduction to Data Structure & algorithmIntroduction to Data Structure & algorithm
Introduction to Data Structure & algorithm
 
A Parallel Computing-a Paradigm to achieve High Performance
A Parallel Computing-a Paradigm to achieve High PerformanceA Parallel Computing-a Paradigm to achieve High Performance
A Parallel Computing-a Paradigm to achieve High Performance
 
chapter - 1.ppt
chapter - 1.pptchapter - 1.ppt
chapter - 1.ppt
 
Towards high performance computing(hpc) through parallel programming paradigm...
Towards high performance computing(hpc) through parallel programming paradigm...Towards high performance computing(hpc) through parallel programming paradigm...
Towards high performance computing(hpc) through parallel programming paradigm...
 
Operating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptxOperating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptx
 
Use of genetic algorithm for
Use of genetic algorithm forUse of genetic algorithm for
Use of genetic algorithm for
 
Map reduce advantages over parallel databases report
Map reduce advantages over parallel databases reportMap reduce advantages over parallel databases report
Map reduce advantages over parallel databases report
 
1844 1849
1844 18491844 1849
1844 1849
 
1844 1849
1844 18491844 1849
1844 1849
 
Performance evaluation of larger matrices over cluster of four nodes using mpi
Performance evaluation of larger matrices over cluster of four nodes using mpiPerformance evaluation of larger matrices over cluster of four nodes using mpi
Performance evaluation of larger matrices over cluster of four nodes using mpi
 
Parallel Computing
Parallel ComputingParallel Computing
Parallel Computing
 
DYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTING
DYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTINGDYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTING
DYNAMIC TASK PARTITIONING MODEL IN PARALLEL COMPUTING
 
Aq4301224227
Aq4301224227Aq4301224227
Aq4301224227
 
CS8603_Notes_003-1_edubuzz360.pdf
CS8603_Notes_003-1_edubuzz360.pdfCS8603_Notes_003-1_edubuzz360.pdf
CS8603_Notes_003-1_edubuzz360.pdf
 
Hadoop tutorial for Freshers,
Hadoop tutorial for Freshers, Hadoop tutorial for Freshers,
Hadoop tutorial for Freshers,
 

More from Ghazal Tashakor (6)

2022_01_TSMP_HPC_Asia_Final.pptx
2022_01_TSMP_HPC_Asia_Final.pptx2022_01_TSMP_HPC_Asia_Final.pptx
2022_01_TSMP_HPC_Asia_Final.pptx
 
Rapid Survey on Routing in Data Centers
Rapid Survey on Routing in Data CentersRapid Survey on Routing in Data Centers
Rapid Survey on Routing in Data Centers
 
Smart controller over resource nodes
Smart controller over resource nodesSmart controller over resource nodes
Smart controller over resource nodes
 
Investigating resource elasticity
Investigating resource elasticityInvestigating resource elasticity
Investigating resource elasticity
 
Resource scheduling
Resource schedulingResource scheduling
Resource scheduling
 
Resource scheduling
Resource schedulingResource scheduling
Resource scheduling
 

Recently uploaded

Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
StarCompliance.io
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
ArpitMalhotra16
 
Computer Presentation.pptx ecommerce advantage s
Computer Presentation.pptx ecommerce advantage sComputer Presentation.pptx ecommerce advantage s
Computer Presentation.pptx ecommerce advantage s
MAQIB18
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
ewymefz
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
ocavb
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
enxupq
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
ewymefz
 
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
vcaxypu
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
ewymefz
 
Introduction-to-Cybersecurit57hhfcbbcxxx
Introduction-to-Cybersecurit57hhfcbbcxxxIntroduction-to-Cybersecurit57hhfcbbcxxx
Introduction-to-Cybersecurit57hhfcbbcxxx
zahraomer517
 

Recently uploaded (20)

Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
 
Uber Ride Supply Demand Gap Analysis Report
Uber Ride Supply Demand Gap Analysis ReportUber Ride Supply Demand Gap Analysis Report
Uber Ride Supply Demand Gap Analysis Report
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
 
Computer Presentation.pptx ecommerce advantage s
Computer Presentation.pptx ecommerce advantage sComputer Presentation.pptx ecommerce advantage s
Computer Presentation.pptx ecommerce advantage s
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
 
How can I successfully sell my pi coins in Philippines?
How can I successfully sell my pi coins in Philippines?How can I successfully sell my pi coins in Philippines?
How can I successfully sell my pi coins in Philippines?
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
 
Business update Q1 2024 Lar España Real Estate SOCIMI
Business update Q1 2024 Lar España Real Estate SOCIMIBusiness update Q1 2024 Lar España Real Estate SOCIMI
Business update Q1 2024 Lar España Real Estate SOCIMI
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
 
tapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive datatapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive data
 
Using PDB Relocation to Move a Single PDB to Another Existing CDB
Using PDB Relocation to Move a Single PDB to Another Existing CDBUsing PDB Relocation to Move a Single PDB to Another Existing CDB
Using PDB Relocation to Move a Single PDB to Another Existing CDB
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
 
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
 
Tabula.io Cheatsheet: automate your data workflows
Tabula.io Cheatsheet: automate your data workflowsTabula.io Cheatsheet: automate your data workflows
Tabula.io Cheatsheet: automate your data workflows
 
社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
 
Introduction-to-Cybersecurit57hhfcbbcxxx
Introduction-to-Cybersecurit57hhfcbbcxxxIntroduction-to-Cybersecurit57hhfcbbcxxx
Introduction-to-Cybersecurit57hhfcbbcxxx
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 
Q1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year ReboundQ1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year Rebound
 

Paralle Programming in Python

  • 1. Python Multiprocessing, Celery or PP for Dynamic Model Applications Ghazal Tashakor https://www.linkedin.com/in/tashakor/
  • 2. Parallel Programming in Python(PP) Within parallel programming, Python has built-in and external modules that simplify implementation.
  • 3. Parallelizable Problems 1. Obtaining the highest Fibonacci value for multiple inputs 2. Crawling the Web
  • 4. Python PP Tools 1. The PythonThreading Module 2. The Python Multiprocessing Module 3. The Parallel Python Module 4. Celery – A Distributed Task Queue
  • 5. Disadvantages of Threads 1. Harm the performance of the application 2. Sharing data and scalability is poor
  • 6. Data Buffering in Multiprocessing Module solution Although the user of Multiprocessing and ProcessPoolExecutor in python could solve the parallelizable problems and does not need to use synchronization mechanisms, such as Locks for instance, but internally, these mechanisms are used to transport data among buffers and pipes in order to accomplish communication.
  • 7. Advantage of using PP module 1. Automatic detection of number of processors to improve load balance 2. Many processors allocated can be changed at runtime 3. Load balance at runtime 4. Auto-discovery resources throughout the network
  • 8. Advantage of using Celery 1. Improved version of the multiprocessing pool (pool as a service) 2. Best for shared-arrays
  • 9. Distributing Tasks with Celery Celery is a framework that offers mechanisms to lessen difficulties while creating distributed systems. The Celery framework works with the concept of distribution of work units (tasks) by exchanging messages among the machines that are interconnected as a network, or local workers. A task is the key concept in Celery; any sort of job we must distribute has to be encapsulated in a task beforehand.
  • 10. Parallel Algorithms  The divide and conquer technique  Data decomposition (we used to creat low cost the user thread) Not good in the case of reality  Decomposing tasks with pipeline  Processing and mapping
  • 11. Data Decomposition problem We used it to solve the matrix problem where each necessary operation to get to the final result was executed by a single worker, and each worker executed the same number of operations. In real world, there is an asymmetry of the relation between the number of workers and the quantity of data that is decomposed, and this directly affects the performance of the solution.
  • 12. Processing and mapping solution 1. Identifying the tasks that require data exchange 2. Grouping the tasks that establish constant communication in a single worker can enhance the performance. This is true when there is a large load of data communication as it may help reduce the overhead in exchange of the information within the tasks.
  • 13. Resources/Books 1. Parallel Programming with Python – June 25, 2014 by Jan Palach 2. Distributed Computing with Python – April 2016 by Francesco Pierfederici 3. Parallel, Distributed Scripting with Python by P. Miller Center for Applied Scientific Computing