User Tools

Site Tools


guides:slurm:anaconda

**This is an old revision of the document!**

Using Anaconda with SLURM

Example script (ai-benchmark.py):

from ai_benchmark import AIBenchmark
benchmark = AIBenchmark()
results = benchmark.run()
print (results)

Example anaconda environment:

# Create Anaconda environment
conda create --name ai-benchmark python mamba
mamba install cudatoolkit==11.5 tensorflow keras==2.6.*
results = benchmark.run()
print (results)

Next user must embed the script into the SLURM batch job file/control file (e.g. scriptR.sbatch):

#!/bin/bash
#SBATCH --job-name helloworld	# Name for your job
#SBATCH --ntasks 1		# Number of task
#SBATCH --time 5		# Runtime in minutes.
#SBATCH --mem=2000		# Reserve 2 GB RAM for the job
#SBATCH --partition serial	# Partition to submit
#SBATCH --output hello.out	# Standard out goes to this file
#SBATCH --error hello.err	# Standard err goes to this file
#SBATCH --mail-user username@uef.fi	# this is the email you wish to be notified at
#SBATCH --mail-type ALL		# ALL will alert you of job beginning, completion, failure etc
#SBATCH --auks=yes	        # Enable kerberos support with auks

module load r # load modules

Rscript hello.R # Execute the script

The last step is to submit the job to the compute queue with the sbatch command.

sbatch scriptR.sbatch
guides/slurm/anaconda.1636984730.txt.gz · Last modified: 15.11.2021 15:58 by Administrator