introductionCommon problemsOverview and rationaleWhy Python?What is parallel computing?


Figure 1

boxes and arrows in sequential configuration
Serial computation

Figure 2

boxes and arrows with two parallel pipe lines
Parallel computation

Figure 3

boxes and arrows
serial execution

Figure 4

boxes and arrows
parallel execution

Figure 5

  • There are two ‘workers’: the cook and the stove. boxes and arrows showing dependencies between tasks

  • Figure 6

    diagram
    Shared vs. Distributed memory architecture: the crucial difference is the bandwidth to shared memory

    BenchmarkingA first example with DaskMemory profilingUsing many cores


    Figure 1

    screenshot of system monitor
    System monitor

    Figure 2

    showing very high peak for numpy, and constant low line for dask
    Memory performance

    Figure 3

    showing that using more cores can also make things slower
    Timings against number of cores

    Computing $\pi$Parallelizing a Python applicationUsing Numba to accelerate Python code


    Figure 1

    the area of a unit sphere contains a multiple of pi
    Computing Pi

    Threads and processesThreadingMultiprocessing


    Delayed evaluationDask Delayed


    Figure 1

    boxes and arrows
    Dask workflow graph

    Figure 2

    a gather pattern {.output alt=“boxes and arrows”}


    Map and reduce


    Figure 1

    boxes and arrows
    A map operation.

    Figure 2

    boxes and arrows
    A reduction.

    Exercise with FractalsThe Mandelbrot and Julia fractals


    Figure 1

    colorful rendering of mandelbrot set
    The whole Mandelbrot set

    Figure 2

    rendering of mandelbrot zoom
    Zoom in on Mandelbrot set

    Figure 3

    performance curves
    Benchmarks

    Figure 4

    colorful rendering of a Julia set
    Example of a Julia set

    AsyncioIntroduction to AsyncioA first programWorking with asyncio outside Jupyter


    Figure 1


    Figure 2


    Figure 3

    a dip at njobs=10 and overhead ~0.1ms per task
    timings

    Calling external C and C++ libraries from PythonCalling C and C++ librariesCall the C library from multiple threads simultaneously.