Python is increasingly used in high-performance computing projects. It can be used either as a high-level interface to existing HPC applications and libraries, as embedded interpreter, or directly.
This course combines lectures and hands-on sessions. It shows how Python can be used on parallel architectures and how to optimize critical parts of the kernel using various tools.
The following topics will be covered:
- Short review of vectorized programming with NumPy
- Interactive parallel programming with IPython
- Profiling and optimization
- High-performance NumPy
- Just-in-time compilation with numba
- Distributed-memory parallel programming with Python and MPI
- Bindings to other programming languages and HPC libraries
- Interfaces to GPUs
This course is aimed at scientists who wish to explore the productivity gains made possible by Python for HPC.
## Setting up the environment
After cloning or downloading the repository, you can create a Python environment similar to the one used on the HPC Systems at JSC using [Micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html)([Conda](https://conda.io/projects/conda/en/latest/index.html) or [Mamba](https://mamba.readthedocs.io/en/latest/index.html) should work, too, but have not been tested). First change into the directory with the material and then execute
```bash
micromamba create -f hpcpy24.yaml
```
This downloads about 1 GB of data and creates the environment `hpc-python-2024`. Activate the environment using
```bash
micromamba activate hpc-python-2024
```
You can now start Jupyter Lab
```bash
jupyter lab
```
and work with the notebooks.
## Updating your copy of the repository
If you cloned the repository, you can pull updates by first committing the changes you made
```bash
git commit -a-m"add a short message describing your changes"
```
(replace `add a short message describing your changes` with a short message describing your changes) then pulling updates