This article describes how to execute a Python script on the LANTA HPC system using Miniconda. The following table of contents provides an overview of the article's material, allowing for quick identification of the most relevant sections.
Slurm script example for running the Python script
Running on Compute node
Code Block |
---|
#!/bin/bash
#SBATCH -p compute # Specify partition [Compute/Memory/GPU]
#SBATCH -N 1 -c 128 # Specify number of nodes and processors per task
#SBATCH --ntasks-per-node=1 # Specify tasks per node
#SBATCH -t 120:00:00 # Specify maximum time limit (hour: minute: second)
#SBATCH -A ltxxxxxx # Specify project name
#SBATCH -J JOBNAME # Specify job name
module load Miniconda3Mamba/2223.11.1-10-0 # Load the Miniconda3 module
conda activate tensorflow-2.612.0 1 # Activate your environment
python3 file.py # Run your program or executable code |
Info |
---|
Full node: -c 128, Half node: -c 64, ΒΌ node: -c 32 |
Running on GPU node
Code Block |
---|
#!/bin/bash
#SBATCH -p gpu # Specify partition [Compute/Memory/GPU]
#SBATCH -N 1 -c 16 # Specify number of nodes and processors per task
#SBATCH --gpus-per-task=1 # Specify number of GPU per task
#SBATCH --ntasks-per-node=4 # Specify tasks per node
#SBATCH -t 120:00:00 # Specify maximum time limit (hour: minute: second)
#SBATCH -A ltxxxxxx # Specify project name
#SBATCH -J JOBNAME # Specify job name
module load Miniconda3Mamba/2223.11.1-10-0 # Load the Miniconda3 module
conda activate tensorflow-2.612.0 1 # Activate your environment
python3 file.py # Run your program or executable code |
Info |
---|
1 GPU card: --ntasks-per-node=1, 2 GPU cards: --ntasks-per-node=2, 4 GPU cards: --ntasks-per-node=4 |
Submit a job
Use the sbatch script.sh
command to submit your job to the Slurm system.
...
Note |
---|
Before you use the sbatch script.sh command, you must ensure that your environment is disabled. |
...
Related articles
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@48ae393 |
---|
showSpace | false |
---|
sort | modified |
---|
showSpacetype | falsepage |
---|
reverse | true |
---|
typelabels | pagesingularity python container |
---|
cql | label in ( "python-vir-env" , "python-apptainer" , "env" , "jupyter" ) and space = currentSpace ( ) | labels | singularity python container |
---|
|