Python in HPC @ ICHEC

Europe/Dublin
Chartered Accounts House

Chartered Accounts House

47-49 Pearse Street Dublin 2 Ireland
Description

Python has gained tremendous popularity in scientific computing owing to the extensibility of the language, the rich ecosystem and being a convenient languages for scientists to develop and prototype codes productively. While using Python may offer many ways to achieve the same result, finding the most efficient means to do so for better performance and scalability can be a challenge. This course is focused on some of the ways to optimise and parallel scientific Python codes, encompassing subjects such as performance analysis, efficient use of scientific libraries (e.g. NumPy), extending Python to use more efficient languages (e.g. Cython) to carry out multi-processing using threads and the Message Passing Interface (MPI) on HPC systems.

The 4-day course will cover the following topics:

  • Efficient use of NumPy
  • Performance Analysis
  • Using Cython and optimisations
  • Interfacing with external libraries
  • Multi-processing using threads
  • Parallel computing using mpi4py
  • Extra optimisation exercises (common numerical algorithms) on HPC system

Course instructors:

  • Adam Ralph
  • Chris Werner

Prerequisites

  • Each participant is expected to have a basic knowledge of Python, including:
    • syntax
    • basic data structures (lists, arrays, tuples, dictionaries)
    • control structures (if-else statements, for/while loops)
    • functions and modules
  • Every participant is also expected to bring his/her own laptop to the course to carry out the hands-on exercises.
  • Some prior experience/knowledge of NumPy and the C programming language will be useful but not strictly required.

Participation in the course is free of charge. Tea, coffee and light snacks will be provided during breaks. Lunch is NOT provided; there is a restaurant on-site as well as other eateries nearby.


 

    • 09:30 10:00
      PRACE intro - Python and HPC
    • 10:00 10:45
      NumPy: Fast array interface to Python
    • 10:45 11:00
      Break 15m
    • 11:00 12:30
      NumPy: Tools
    • 12:30 13:30
      Lunch 1h
    • 13:30 15:00
      Advanced indexing, vectorised operations, broadcasting, numexpr
    • 15:00 15:15
      Break 15m
    • 15:15 17:00
      Performance analysis
    • 09:30 11:00
      Cython
    • 11:00 11:15
      Break 15m
    • 11:15 12:30
      Cython: Exercises
    • 12:30 13:30
      Lunch 1h
    • 13:30 15:00
      Introduction to C and interfacing external libraries
    • 15:00 15:15
      Break 15m
    • 15:15 17:00
      Introduction to C and interfacing external libraries: Exercises
    • 09:30 11:15
      Multiprocessing with Python
    • 11:15 11:30
      Break 15m
    • 11:30 12:30
      MPI in Python (mpi4py): Introduction
    • 12:30 13:30
      Lunch 1h
    • 13:30 15:00
      MPI in Python (mpi4py): Point-to-point communication
    • 15:00 15:15
      Break 15m
    • 15:15 17:00
      MPI in Python (mpi4py): Non-blocking communication and communicators
    • 09:30 11:15
      MPI in Python (mpi4py): Collective communication
    • 11:15 11:30
      Break 15m
    • 11:30 12:30
      MPI in Python (mpi4py): Collectives exercises
    • 12:30 13:30
      Lunch 1h
    • 13:30 16:00
      [Optional] Recap of strategies, additional exercises & solutions