Python/Batch
For small tests, pre- and post-processing with Python, you can start an interactive sessions on one of the login nodes. All other Python jobs have to be submitted through the batch system. You can submit a Python job (my_python_script.py) in batch mode with the following command:
sbatch [Slurm options] --wrap="python my_python_script.py"
Here you need to replace [Slurm options] with Slurm parameters for the resource requirements of the job. Please find a documentation about the parameters of sbatch on the wiki page about the batch system.
When you specify the Python interpreter on the first line of your script, then please use
#!/usr/bin/env python
instead of
#!/usr/bin/python
Otherwise the Python interpreter from the operating system will be called when you directly execute the script with
./my_python_script.py
instead of
python ./my_python_script.py
The Python interpreter from the operating system is older and does not have the additional packages installed.