Fra Robin

(Forskjeller mellom versjoner)
Gå til: navigasjon, søk
Linje 109: Linje 109:
Cancel all jobs with name "job_name":
Cancel all jobs with name "job_name":
<pre class="brush: bash">
<pre class="brush: bash">
scancel --name=job_name
scancel -n job_name

Versjonen fra 26. feb 2021 kl. 14:01


Hardware and network configuration

The robin-hpc is a shared resource for robins researchers and Master students. The strength of the machine is the amount of CPU cores and RAM. Unforunatly, there's no GPU available in this service.


login node 2 cores/4 vCPU 16GB
worrker node 120 cores/240 vCPU 460GB CentOS


The storage on the nodes consists of one 1TB disk where 100GB is reserved for software and 900GB is reserved for the users of the node. However, each user has a soft limit of 20 GB and a hard limit of 100 GB with a grace period of 14 days.

It's important to note that there is no backup of the disk, so do not use the robin-hpc as a cloud storage service. We suggest using rsync/scp to your home area on


rsync --progress <file>.tar.gz <username><path>/<to>/<wherever>

It is also a possibility to mount your UiO home directory to the robin-hpc.


Apply for access using this link:


Ropin-hpc uses slurm for job scheduling.

To start a job on robin-hpc you will need to use a job script specifying the resources you want to use. The job is started with the following command:


(Note: Please do not run your program on the login node, test your implementation before copying the files to robin-hpc. You can easily copy the files needed to run your program to your home area on robin-hpc with scp.)

Below you will find a template for the job script, followed by some convenient commands.

SLURM job script template


# This is a template for a slurm job script.
# To start a job on robin-hpc please use the command "sbatch".                                                                                                                            

# Job name                                                                                                                                                                                                  
#SBATCH --job-name=nameofmyjob                                                                                                                                                                              

# Wall clock time limit (hh:mm:ss). 
# (Note: The program will be killed when the time limit is reached.)                                                                                                         
#SBATCH --time=01:00:00                                                                                                                                                                                     

# Number of tasks to start in parallel from this script.                                                                                                                                                    
# (i.e. below will be started ntasks times)                                                                                                                                                    
#SBATCH --ntasks=1                                                                                                                                                                                          

# CPUs allocated per task                                                                                                                                                                                   
#SBATCH --cpus-per-task=16                                                                                                                                                                                  

# Memory allocated per cpu                                                                                                                                                                                  
#SBATCH --mem-per-cpu=1G                                                                                                                                                                                    

# Set exit on errors                                                                                                                                                                                        
set -o errexit
set -o nounset

# Load your environment                                                                                                                                                                                     
source myenv/bin/activate

# Run your program with "srun yourcommand"                                                                                                                                                                  
# stdout and stderr will be written to a file "slurm-jobid.out".                                                                                                                                            
# (warning: all tasks will write to the same slurm.out file)                                                                                                                                                
srun python3

Convenient commands

View the status of all jobs:


View the status of your own jobs:

squeue -u yourusername  

Cancel all your jobs:

scancel -u yourusername

Cancel all jobs with name "job_name":

scancel -n job_name


Matlab R2019b

Todo: sebastto

Setting up the SLURM job script

#SBATCH --job-name=matlab_job
#SBATCH --ntasks=1
#SBATCH --cpus-per-task 16

srun matlab -batch "addpath(genpath('/path/to/your/matlab/folder'));run('myScript.m')"

Running Matlab in batch mode is the most safe option for running MATLAB on a HPC. (From Mathworks documentation)[1]:

-batch statement

  • Starts without the desktop

  • Does not display the splash screen

  • Executes statement

  • Disables changes to preferences

  • Disables toolbox caching

  • Logs text to stdout and stderr

  • Does not display modal dialog boxes

  • Exits automatically with exit code 0 if script executes successfully. Otherwise, MATLAB terminates with a non-zero exit code.

The addpath(genpath('/path/to/your/matlab/folder')) part adds all files in the specified directory to the MATLAB search path. Afterwards we run the main script of your program with run('myScript.m').

Utilizing parallel computing in your MATLAB Script

When the SLURM worker node is setting up your job, a number of environment variables is set. We can use the environment variable SLURM_CPUS_ON_NODE to get the number of CPU cores available in our MATLAB script. In fact, we can use that variable to dynamically select the number of workers in the MATLAB parallel pool, so that your script works both on your own computer and on the HPC.


% Delete parallel pool from earlier runs

if isempty(SLURM_CPUS_STR) 
    % Run on personal computer (with however many cores your CPU has)
    % Run on SLURM-scheduled HPC


Todo: emmaste


alias docker=podman
Personlige verktøy