Skip to content

Parallel computing, cython, numba, multi-processing and multi-threading in python

Notifications You must be signed in to change notification settings

kyaiooiayk/High-Performance-Computing-in-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⏱High-Performance-Computing-in-Python

Parallel computing, cython, numba, multi-processing and multi-threading in Python.


📌Motivation

  • Python was created for humans and to help them experiment idea faster. Many details such as variable types and memory allocation and deallocation are then left to the runtime to decide.
  • The downside is that Python is slower and harder to optimise - than languages like C or Fortran.
  • So, why are we still sticking to python? No! Most program have few part that are time-critical. Even, for this parts, itis possible to achieve the same speed as C or Fortran.

⁉Why parallelisation?

  • The growth of CPU clock speed (i.e., the speed at which a single chain of logic can be run) has slowed dramatically.
  • As a response, hardware makers have increased the number of cores (physical CPUs) embedded in each machine as a differnt avenue to fast execution: parallelisation.

⁉What is concurrency?

  • Concurrency is the capability of having more than one computation in progress at the same time.
  • Concurrency is a different type of programming. So not only: procedural, functional and OOP.
  • Concurrency is what allows: concurrent, parallel and asynchronous execution.

📦Packages

  • Native:
    • Python multiprocessing for process-based concurrency. A process refers to a computer program. Multiprocesses are appropriate for CPU-bound tasks, and not I/O-bound tasks.
    • Python threading for thread-based concurrency. A thread refers to a thread of execution by a computer program. Because of the GIL, threads are appropriate for I/O-bound tasks, and not CPU-bound tasks.
    • Python asyncio for coroutine-based concurrency. A coroutine is a unit of concurrency that is more lightweight than a thread.
  • Third parties:
    • ray: a framework for scaling Python applications.
    • tornado: Python web framework and asynchronous networking library.
    • celery: Distributed task queue.
    • sanic: Async Python web server and framework.
    • aiohttp: Asynchronous HTTP client/server framework for asyncio
    • dask: Parallel computing with task scheduling.
    • uvloop: Ultra fast asyncio event loop.

🏫Available tutorials


🧑‍🎓Study notes


📚References


About

Parallel computing, cython, numba, multi-processing and multi-threading in python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published