Skip to content

HPC Cluster

This page provides an introduction to the CMRI HPC cluster. The content is structured so that sections can be read in order or referenced individually depending on your familiarity with HPC systems. If you know how to use the UGE/SGE scheduler but not Slurm, this scheduler rosetta may be useful for translating common commands between the two.


Accessing the Cluster

  1. Open a terminal application.
    • On Windows, you can press the Windows key, type cmd, then press enter.
  2. In the terminal, type ssh <your_username>@cmri-vm-login.cmh.internal, replacing <your_username> with the username you use to log in to your computer, then press enter.
  3. Enter your CMH account password when prompted.

Hardware

The CMRI HPC cluster is currently made up of 14 compute nodes. The hardware specifications for each system are listed in the table below:

Node Names Count Cores Threads RAM Network GPU(s)
cmri-gpu0[1,3] 2 56 112 750GB 100Gb 2x Nvidia Tesla T4
cmri-gpu0[4-5] 2 128 256 2TB 100Gb 4x Nvidia H200
cmri-n[01-10] 10 56 112 750GB 100Gb N/A

In order to use compute node resources, you need to submit a request, or 'job', to the Slurm scheduler.

Software

Software is provided on the cluster using modules. For information on how to use software modules, see the Software Modules page.

Jobs and Partitions

The cluster uses the Slurm scheduler to manage access to compute nodes. In order to use compute nodes, you need to submit a resource request, or 'job'. Slurm provides two commands for doing this:

srun
Used to run interactive jobs, which allow you to connect directly to compute nodes and manually run applications on them.
sbatch
Used to submit job scripts which run applications on compute nodes non-interactively.

Slurm organizes compute nodes into groups called 'partitions'. Every job runs in a partition; jobs that do not specify a partition have the default one assigned. There are four partitions on the cluster that you can choose to run your job in:

Name Nodes Priority Max Walltime Max CPUs Max Memory Default
short cmri-n[01-10] high 8 hours 560 3840G No
medium cmri-n[01-10] normal 2 days 560 3840G Yes
long cmri-n[01-10] low 14 days 224 1536G No
gpu cmri-gpu0[1,3-5] normal 7 days N/A N/A No
Name
The partition name, used to specify which partition you want your job to run in.
Nodes
A list of nodes that make up the partition. Nodes can belong to multiple partitions.
Priority
The relative priority of the partition. Jobs submitted to higher-priority partitions will typically run sooner.
Max Walltime
The maximum amount of time jobs submitted to the partition are allowed to run.
Max CPUs
The maximum number of CPUs you can use to run jobs in the partition. Depending on how busy the cluster is, you may not be able to use all of these at once.
Max Memory
The maximum amount of memory you can use to run jobs in the partition. Depending on how busy the cluster is, you may not be able to use all of this at once.
Default
Indicates whether the partition is the default. Jobs that do not specify a partition will be assigned to it.

If you do not specify a partition, your job will be assigned to the default medium partition, which should work fine in most cases. You may want to use a different partition if your job will run for longer than two days, or requires GPUs.

The next two sections give examples of how to use the srun and sbatch commands to submit jobs and start running on compute nodes.

Interactive Jobs

Interactive jobs allow you to connect to compute nodes and run applications on them directly. This can be useful for testing workflows, running interactive applications, and debugging. The srun command is used to start interactive jobs. The example below is the simplest command to start an interactive job on a compute node:

srun --pty /bin/bash
--pty
This tells the scheduler to run in 'pseudo-terminal' or interactive mode.
/bin/bash
This is the program that srun executes on the compute node. Specifying the Bash shell will give you an interactive shell session as if you had used ssh to log in to the compute node directly.

The previous example did not request specific hardware resources (amount of memory, number of CPU cores, etc.), so the scheduler allocated a default set of resources; two CPU cores and 14G of memory for 48 hours. The next example overrides these defaults by explicitly requesting resources:

srun -p short -J test -N 1 -n 1 -c 4 --mem=10G -t 4:00:00 --pty /bin/bash

The new options in this example are explained below:

-p short
This specifies the partition the job should run in, the short partition in this case.
-J test
This option specifies the job name, which can be useful for identifying running jobs.
-N 1
This is the number of nodes requested by the job. If -N is not specified, the value defaults to one.
-n 1
The number of tasks the job will run. If you are planning on running multiple copies of your application in parallel, set this option equal to the number of copies. The default value is one.
-c 4
The number of cpu cores requested per task. If your application is multithreaded, set this equal to the number of threads it uses for the best performance. The default value is one.
--mem=10G
The RAM requested per node. The default is 14 gigabytes per cpu core.
-t 04:00:00
The walltime, or maximum length of time your job will run. The default is two hours for all partitions. See the Jobs and Partitions section above for information on the maximum walltime each partition allows.

Interactive sessions are great for testing new workflows and running interactive applications, but require you to manually run each step. Job scripts are another way to run jobs on the cluster which address this limitation.

Job Scripts

Job scripts allow you to run jobs without manual intervention. Once you know all of the steps required for a workflow, you can create a job script to run it automatically. Running the job is then as simple as submitting the script to the scheduler with the sbatch command.

Job scripts are made up of three elements:

  1. An interpreter declaration
  2. SBATCH options (identical to srun options)
  3. The script body

The example below shows a simple job script:

#!/bin/bash
#SBATCH -t 00:10:00
#SBATCH -J script_test

echo "Hello world from $SLURMD_NODENAME"

Each line in the example is explained below:

  1. #!/bin/bash
    • This is the interpreter declaration. In this example, the job script is a Bash shell script, so the interpreter is the Bash shell.
  2. #SBATCH -t 00:10:00
    • This is an SBATCH option that requests a walltime of ten minutes. SBATCH options are identical to srun options for interactive sessions.
  3. #SBATCH -J script_test
    • This is another SBATCH option, it specifies the job name.
  4. echo "Hello world from $SLURMD_NODENAME"
    • Lastly, we have the script body. This example uses an echo command to print the name of the compute node it runs on using a Slurm environment variable.

Creating a Bash script to run your job is typically easiest, but you could use another interpreted programming languages such as Python instead.

This example shows how you might re-write the Bash job script above in Python:

#!/usr/bin/env python3
#SBATCH -t 00:10:00
#SBATCH -J script_test

import os
HOSTNAME = os.getenv('SLURMD_NODENAME')
print("Hello world from " + HOSTNAME)

Regardless of which language you use, the script elements are still the same.

Once you have a job script written, you can submit it to the scheduler with the sbatch command. For example, if you saved your script file as test_script.sh, you would run:

sbatch test_script.sh

from cmri-vm-login to submit the job.

Next Steps

This page is meant to be a brief introduction to using software and submitting jobs on the CMRI HPC cluster, and just scratches the surface on how you can use the Slurm scheduler. For more information on job submission and interacting with Slurm, please see the Slurm Job Submission guide.

We also recommend that you reference the official Slurm documentation from SchedMD: