Cluster Instructions
You are on an HPC cluster. Before submitting any jobs or running heavy commands, detect which cluster you are on and follow the correct instructions.
IMPORTANT: Never run Python, heavy CPU, or GPU commands directly on a login node. Always submit via the scheduler unless you have confirmed you are on a compute node.
Step 1: Detect the cluster
Run these checks in order:
# Check host and working directory path
hostname
hostname -f 2>/dev/null || true
pwd
# Check available scheduler
if command -v sbatch >/dev/null 2>&1; then
echo "SLURM"
elif command -v qsub >/dev/null 2>&1 && command -v qconf >/dev/null 2>&1; then
echo "SGE"
elif command -v qsub >/dev/null 2>&1; then
echo "PBS"
else
echo "UNKNOWN"
fi
| Path pattern |
Cluster |
Scheduler |
Instructions |
/rds/general/user/<user>/home/ |
Imperial CX3 |
PBS Pro |
cx3.md in this skill |
/gpfs/home/<user> |
Imperial HX1 |
PBS Pro |
Use CX3 instructions (cx3.md) |
/lustre/home/<user> + sbatch available + Young hostname |
UCL MMM Young NG (ssh mmm) |
SLURM |
mmm-slurm.md in this skill |
/lustre/home/<user> + qsub/qconf available + Young hostname |
UCL MMM old Young (ssh mmm-old) |
SGE / Grid Engine |
mmm-sge.md in this skill |
/home/<project>/<user>.<project>/ + /projects/<project>/ exists |
Isambard AI |
SLURM |
isambard.md in this skill |
softnanolab-HP-Z8-G4-Workstation / softnanolab-campus |
SoftNano campus workstation |
SLURM may exist, but not the HPC cluster target |
Do not submit MMM/HPC work here; SSH onward to mmm, mmm-old, hx1, or leprotein |
If none match, ask the user which cluster they are on.
Detection order matters. A plain "SLURM exists" check is not enough: MMM Young NG and Isambard both expose SLURM, while the SoftNano campus workstation may also expose SLURM commands without being the intended cluster target. Use host/path first, then the scheduler.
Step 2: Check if you are on a login node
- CX3: Run
hostname. If it contains login, you are on a login node — do not run compute commands directly. If it does NOT contain login, you are on a compute node and can run short Python commands directly.
- MMM Young NG (
ssh mmm): Hostnames like login*.young.ucl.ac.uk are login nodes. Use sbatch or srun via the MMM SLURM instructions.
- MMM old Young (
ssh mmm-old): Hostnames like login*.ib.young.ucl.ac.uk are login nodes. Use qsub; this is SGE, not PBS.
- Isambard: Assume login node unless inside an
srun session or a batch job.
- SoftNano campus: This is a workstation/gateway. It may have SLURM commands, but it is not the MMM/HPC cluster target. Do not run or submit HPC workloads there unless the user explicitly asks for campus-local work; SSH to the actual cluster first.
Step 3: Load cluster-specific instructions
Read the appropriate file from this skill's directory:
- CX3 / HX1: Read
cx3.md — covers PBS Pro queues, job templates, key patterns, common commands, and storage paths.
- MMM Young NG: Read
mmm-slurm.md — covers SLURM partitions/QoS, GPU A100 requests, modules, and common commands.
- MMM old Young: Read
mmm-sge.md — covers SGE queues, project/account flags, GPU requests, modules, and common commands.
- Isambard: Read
isambard.md — covers SLURM job templates, GPU allocation (Grace Hopper Superchips), DDP setup, and common commands.
Follow those instructions for all job submission, script creation, and resource allocation decisions.
Step 4: Submit or run the command
If $ARGUMENTS contains a command or script to run:
- Determine if it needs a batch job (long-running, GPU, heavy CPU) or can run directly (quick debugging, <5 min).
- For batch jobs: create a job script using the templates from the cluster-specific instructions, then submit it.
- For quick commands on a compute node: run directly.
- For quick commands on a login node:
- CX3: Use
qsub -I for an interactive session.
- MMM Young NG: Use
srun with a partition/QoS from mmm-slurm.md.
- MMM old Young: Use
qsub with flags from mmm-sge.md; do not run tests directly on the login node.
- Isambard: Use
srun for an interactive session.
If no arguments are provided, just report which cluster and node type you detected.
1---2name: cluster-instructions3description: Detect which HPC cluster you are on and load the correct job submission instructions. Use when the user asks to submit, run, or schedule a job, or when you need to know which cluster environment you are in.4---56# Cluster Instructions78You are on an HPC cluster. Before submitting any jobs or running heavy commands, detect which cluster you are on and follow the correct instructions.910**IMPORTANT**: Never run Python, heavy CPU, or GPU commands directly on a login node. Always submit via the scheduler unless you have confirmed you are on a compute node.1112## Step 1: Detect the cluster1314Run these checks in order:1516```bash17# Check host and working directory path18hostname19hostname -f 2>/dev/null || true20pwd2122# Check available scheduler23if command -v sbatch >/dev/null 2>&1; then24 echo "SLURM"25elif command -v qsub >/dev/null 2>&1 && command -v qconf >/dev/null 2>&1; then26 echo "SGE"27elif command -v qsub >/dev/null 2>&1; then28 echo "PBS"29else30 echo "UNKNOWN"31fi32```3334| Path pattern | Cluster | Scheduler | Instructions |35|---|---|---|---|36| `/rds/general/user/<user>/home/` | Imperial CX3 | PBS Pro | `cx3.md` in this skill |37| `/gpfs/home/<user>` | Imperial HX1 | PBS Pro | Use CX3 instructions (`cx3.md`) |38| `/lustre/home/<user>` + `sbatch` available + Young hostname | UCL MMM Young NG (`ssh mmm`) | SLURM | `mmm-slurm.md` in this skill |39| `/lustre/home/<user>` + `qsub`/`qconf` available + Young hostname | UCL MMM old Young (`ssh mmm-old`) | SGE / Grid Engine | `mmm-sge.md` in this skill |40| `/home/<project>/<user>.<project>/` + `/projects/<project>/` exists | Isambard AI | SLURM | `isambard.md` in this skill |41| `softnanolab-HP-Z8-G4-Workstation` / `softnanolab-campus` | SoftNano campus workstation | SLURM may exist, but not the HPC cluster target | Do not submit MMM/HPC work here; SSH onward to `mmm`, `mmm-old`, `hx1`, or `leprotein` |4243If none match, ask the user which cluster they are on.4445Detection order matters. A plain "SLURM exists" check is not enough: MMM Young NG and Isambard both expose SLURM, while the SoftNano campus workstation may also expose SLURM commands without being the intended cluster target. Use host/path first, then the scheduler.4647## Step 2: Check if you are on a login node4849- **CX3**: Run `hostname`. If it contains `login`, you are on a login node — do not run compute commands directly. If it does NOT contain `login`, you are on a compute node and can run short Python commands directly.50- **MMM Young NG (`ssh mmm`)**: Hostnames like `login*.young.ucl.ac.uk` are login nodes. Use `sbatch` or `srun` via the MMM SLURM instructions.51- **MMM old Young (`ssh mmm-old`)**: Hostnames like `login*.ib.young.ucl.ac.uk` are login nodes. Use `qsub`; this is SGE, not PBS.52- **Isambard**: Assume login node unless inside an `srun` session or a batch job.53- **SoftNano campus**: This is a workstation/gateway. It may have SLURM commands, but it is not the MMM/HPC cluster target. Do not run or submit HPC workloads there unless the user explicitly asks for campus-local work; SSH to the actual cluster first.5455## Step 3: Load cluster-specific instructions5657Read the appropriate file from this skill's directory:5859- **CX3 / HX1**: Read `cx3.md` — covers PBS Pro queues, job templates, key patterns, common commands, and storage paths.60- **MMM Young NG**: Read `mmm-slurm.md` — covers SLURM partitions/QoS, GPU A100 requests, modules, and common commands.61- **MMM old Young**: Read `mmm-sge.md` — covers SGE queues, project/account flags, GPU requests, modules, and common commands.62- **Isambard**: Read `isambard.md` — covers SLURM job templates, GPU allocation (Grace Hopper Superchips), DDP setup, and common commands.6364Follow those instructions for all job submission, script creation, and resource allocation decisions.6566## Step 4: Submit or run the command6768If `$ARGUMENTS` contains a command or script to run:69701. Determine if it needs a batch job (long-running, GPU, heavy CPU) or can run directly (quick debugging, <5 min).712. For batch jobs: create a job script using the templates from the cluster-specific instructions, then submit it.723. For quick commands on a compute node: run directly.734. For quick commands on a login node:74 - **CX3**: Use `qsub -I` for an interactive session.75 - **MMM Young NG**: Use `srun` with a partition/QoS from `mmm-slurm.md`.76 - **MMM old Young**: Use `qsub` with flags from `mmm-sge.md`; do not run tests directly on the login node.77 - **Isambard**: Use `srun` for an interactive session.7879If no arguments are provided, just report which cluster and node type you detected.