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.


 

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