Introduction Python

Welcome page and syllabus
  • Also link at House symbol 🏠 at top of page

Learning outcomes

  • Load Python modules and site-installed Python packages

  • Create a virtual environment

  • Install Python packages with pip (Kebnekaise, Rackham, Snowy)

  • Write a batch script for running Python

Exercises FIX

Your expectations?

  • Find best practices for using Python at UPPMAX and HPC2N

  • Packages

  • Use the HPC performance with Python

Not covered

  • Improve python coding skills

  • Other clusters (though they work in a mostly very similar way)

Schedule

Course schedule

Time

Topic

Teacher(s)

9:00

First login

BB + PO + RB + RP

9:45

Break

.

10:00

Syllabus

RP

10:10

Python in general

RP

10:20

Load modules and run

RP

10:50

Break

.

11:05

Packages

RB

11:35

Isolated environments 1

RB

12:00

Lunch

.

13:00

Isolated environments 2

RB

13:35

Batch

BB

14:05

Break

.

14:20

GPU

BB

14:40

Simulataneous sessions

BB * RB * RP

15:10

Break

.

15:25

Parallel and multi-threaded functions

PO

16:00

Summary and evaluation

RB

16:15

End of the day

.

Simultaneous session:

  • Kebnekaise: Jupyter, by BB

  • Rackham: Interactive session and Jupyter, by RB

  • LUNARC, by RP

What is python?

As you probably already know…

  • “Python combines remarkable power with very clear syntax.

  • It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.

  • There are interfaces to many system calls and libraries, as well as to various windowing systems. …“

In particular, what sets Python apart from other languages is its fantastic open-source ecosystem for scientific computing and machine learning with libraries like NumPy, SciPy, scikit-learn and Pytorch.

Material for improving your programming skills

First level

The Carpentries teaches basic lab skills for research computing.

Second level

CodeRefinery develops and maintains training material on software best practices for researchers that already write code. Their material addresses all academic disciplines and tries to be as programming language-independent as possible.

Aalto Scientific Computing

Third level

ENCCS (EuroCC National Competence Centre Sweden) is a national centre that supports industry, public administration and academia accessing and using European supercomputers. They give higher-level training of programming and specific software.

Other NAISS centres

Objectives

We will:

  • Teach you how to navigate the module system

  • Show you how to find out which versions of Python and packages are installed

  • Use the package handler pip

  • Explain how to create and use virtual environments

  • Show you how to run batch jobs

  • Show some examples with parallel computing and using GPUs

Most of this will be the same or very similar to how it is done at other HPC centres in Sweden