/
Your first Python job

Your first Python job

About this tutorial

This tutorial will guide you through running a job with Python on ALICE.

What you will learn?

  • Setting up the batch script for a simple serial and parallel Python job

  • Loading the necessary modules

  • Installing your own or special Python modules

  • Submitting your job

  • Monitoring your job

  • Collect information about your job

What this example will not cover?

What you should know before starting?

  • Basic Python. This tutorial is not intended as a tutorial on Python. If you are completely new to Python, we recommend that you go through a generic Python tutorial first. There are many great ones out there.

  • Basic knowledge of how to use a Linux OS from the command line.

  • How to connect to ALICE or SHARK: How to login to ALICE or SHARK

  • How to move files to and from ALICE or SHARK: Transferring Data

  • How to setup a simple batch job as shown in Your first bash job

Python on ALICE and SHARK

There are different versions of Python available on ALICE and SHARK. Some have also been build with CUDA support. You can choose whatever version is available and suitable for you.

Python is also always available by default from the operating system. Do not use this version of Python for your jobs. Always make use of a module.


ALICE

You can find a list of available versions with

module -r avail '^Python/'

Choose a module and add it to your environment by loading it, e.g.,:

module load Python/3.11.5-GCCcore-13.2.0

The command python --version returns the version of Python you have loaded:

[me@nodelogin01 ~]$ python --version Python 3.11.5

The command which Python returns the location where the Python exe