Skip to main content
Every job on CUNY HPCC is submitted through SLURM. This page collects annotated templates for the common job shapes. Copy one, edit the #SBATCH directives, add your module loads, and submit with sbatch.
Three rules that apply to every job:
  1. Start from /scratch/<username>, never from /global/u/<username> (your home).
  2. Use SLURM syntax. Older PBS Pro scripts must be converted.
  3. Never run jobs on the login (head) node. Any job found running there will be killed and the account may be suspended.

Anatomy of a SLURM script

Real jobs on HPCC typically need --qos and --partition matching your project (for example --qos=qoschem --partition=partchem). If you don’t know which values to use, ask your PI or the HPC Helpline. Those values are omitted from examples below so you can paste them in once.

Partitions and QOS

Most production jobs must name a partition (--partition) and the QOS value assigned to your project (--qos). The current HPCC Wiki lists these operational partitions: partdev is dedicated to development. The HPCC Wiki describes it as available to all HPCC users with a four-hour time limit on a 16-core node with 64 GB memory and 2 K20m GPUs.
Run sinfo -s to see which partitions are currently up, and sacctmgr show assoc user=$USER format=Account,Partition,QOS to confirm which partition and QOS values your account is allowed to use.

Submitting, watching, and cancelling

Serial job (one core)

The simplest case: one process, one core.
serial.sh

Multi-threaded (OpenMP)

One task, multiple cores on the same node. Set OMP_NUM_THREADS so your program actually uses the cores SLURM allocated.
openmp.sh

MPI (multiple nodes)

Distributed-memory parallelism across nodes.
mpi.sh

Hybrid MPI + OpenMP

MPI between nodes, OpenMP threads within each rank.
hybrid.sh
The prototype above allocates 12 ranks per node × 2 nodes = 24 MPI ranks, each spawning 2 OpenMP threads. Adjust --qos, --partition, and --mem-per-cpu for your project before submitting.

GPU job

Request GPUs with --gres=gpu:<count>. On Arrow, the HPCC Wiki lists GPU nodes ranging from 2 to 8 GPUs per node.
gpu.sh

GPU with a specific type

Several partitions host different NVIDIA GPU types. Use sinfo to inspect the constraints currently advertised by the scheduler, then constrain your job only when the workload requires a specific GPU.

Job array (parameter sweep)

Run many copies of the same job, each with a different $SLURM_ARRAY_TASK_ID.
array.sh
This submits 6 jobs (indices 0–5) sharing a single array job ID.

Interactive debugging

For quick, interactive access to a compute node (short sessions only; don’t hold nodes idle):
Load modules and run commands as if you were on a compute node. Exit the shell to release the allocation.

Troubleshooting cheatsheet

Still stuck? Open a ticket with the job ID, the command you ran, and the contents of the .out and .err files. The FAQ on the HPCC Wiki covers more edge cases.