SLURM Job Scheduling on Sagehen HPC
Welcome to Workshop 9: SLURM Job Scheduling on Sagehen
This workshop is designed to teach you how to effectively schedule and manage your computational jobs on Sagehen, Pomona College’s research computing cluster. Whether you’re running machine learning models, statistical analyses, molecular simulations, or other compute-intensive work, understanding SLURM job scheduling is essential to making the most of Sagehen’s powerful computing resources.
What You’ll Learn
By the end of this workshop, you will be able to:
- Understand the role of job schedulers and why SLURM is used on Sagehen
- Navigate the Sagehen cluster architecture and available resources
- Submit interactive jobs for exploratory work and debugging
- Create and submit batch scripts for long-running computations
- Monitor and manage your jobs effectively
- Request and utilize GPU resources appropriately
- Optimize your job submissions using advanced SLURM features
About Sagehen
Sagehen (sagehen.hpc.pomona.edu) is Pomona College’s research computing cluster managed by Information Technology Services (ITS). The cluster features:
- Computing nodes: AMD-based compute nodes with 128 CPUs and 500GB RAM each
- GPU nodes: Specialized nodes with NVIDIA GPUs (A100, L40S, RTX PRO 6000)
- Storage: Home directories, shared lab storage, and high-speed scratch space
- Job scheduler: SLURM (Simple Linux Utility for Resource Management)
- Multi-user environment: Safe resource sharing among hundreds of researchers
Workshop Structure
This 7-episode workshop is organized as follows:
- Introduction to SLURM - Learn what job schedulers do and basic SLURM concepts
- Partitions and Resources - Explore Sagehen’s available compute partitions and how to choose the right one
-
Interactive Jobs - Run interactive sessions with
srunfor immediate feedback -
Batch Jobs - Create reproducible batch scripts with
sbatchfor production runs - Monitoring and Managing - Track and control your submitted jobs
- GPU Jobs - Harness the power of Sagehen’s GPU resources
- Advanced Tips - Optimize performance with scratch storage, job arrays, and troubleshooting
Prerequisites
Before starting this workshop, you should have: - Access to Sagehen: An active HPC account (contact its-hpc@pomona.edu if you need one) - SSH client: Ability to connect to a remote system via SSH - Basic Linux knowledge: Comfort with command line operations (files, directories, basic commands) - Text editor: Familiarity with editing text files (nano, vim, or your preferred editor)
If you’re new to Linux or command line work, we recommend completing a Linux basics workshop first.
How to Use This Workshop
- For learners: Each episode includes hands-on challenges. We recommend working through them on Sagehen as you learn.
- For instructors: See the Instructor Notes for timing, common issues, and teaching tips.
- For reference: Check the Quick Reference Card for common SLURM commands.
Getting Help
Questions or issues? Reach out to:
- Email: its-hpc@pomona.edu
- Director of Research Computing: Andrew Wilson
- In-person: Visit ITS in person during office hours
About Carpentries Workbench
This workshop is built using The Carpentries Workbench, a modern lesson development framework that emphasizes hands-on learning and community collaboration.
Learn more about The Carpentries
Ready to get started? Begin with Episode 1: Introduction to SLURM.
Acknowledgments
Developed by Andrew Wilson, Director of Research Computing and Digital Scholarship at Pomona College, with Andrei Motchenko, who tested, edited and produced screenshots for the workshop series.
| Setup Instructions | Download files required for the lesson | |
| Duration: 00h 00m | 1. Introduction to SLURM |
What is a job scheduler and why do we need one? What is SLURM? Why can’t I just run jobs on the head node? |
| Duration: 00h 20m | 2. Partitions and Resources |
What partitions are available on Sagehen HPC? How do I choose the right partition for my job? What GPU types are available? |
| Duration: 00h 45m | 3. Requesting Resources |
How do I specify CPU, memory, time, and GPU resources in SLURM? How do I estimate what resources my job needs? What storage options are available during a job? |
| Duration: 01h 10m | 4. Interactive Jobs |
How do I get an interactive shell on a compute node? How do I request resources for an interactive session? When should I use interactive vs batch jobs? |
| Duration: 01h 40m | 5. Writing Batch Scripts |
What is a batch script and how is it structured? What are the essential SBATCH directives? How do I load modules and run code in batch scripts? |
| Duration: 02h 05m | 6. Batch Job Submission |
How do I submit a batch job? How do I check job status and progress? Where are my job results, and how do I follow them in real time? How do I get email notifications without spamming myself? |
| Duration: 02h 40m | 7. Monitoring Running Jobs |
How do I monitor what my job is doing? How do I check the history of completed jobs? How efficient was my job? Did I waste resources? |
| Duration: 03h 05m | 8. Managing and Canceling Jobs |
How do I cancel a running or queued job? What do I do when a job is stuck pending? How do I troubleshoot common job failures? |
| Duration: 03h 25m | 9. GPU Job Basics |
When should I use a GPU? How do I request GPUs in SLURM? Which GPU type should I choose? How do I write a GPU batch script? |
| Duration: 03h 50m | 10. Advanced GPU Workflows |
How do I monitor GPU utilization? How do I write PyTorch and TensorFlow GPU code? How do I run multi-GPU training? How do I troubleshoot GPU errors? |
| Duration: 04h 10m | 11. Job Arrays and Dependencies |
How can I run many similar jobs efficiently? How do job arrays work? How do I use scratch and tmpfs storage? |
| Duration: 04h 35m | 12. Advanced Tips and Troubleshooting |
How can I improve job reliability? How do I check my group’s resource quota? What are common SLURM errors and how do I fix them? How can I optimize job performance? |
| Duration: 04h 50m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Getting Started with Sagehen HPC
This page will guide you through setting up access to Sagehen, Pomona College’s research computing cluster. By the end, you’ll be able to connect and start running jobs.
Prerequisites
Before we begin, you need:
- Pomona College credentials: Your @pomona.edu email and password
- DUO authentication: Access to your Pomona DUO account (for two-factor authentication)
- A computer with: Terminal or SSH client (macOS/Linux have this built-in; Windows users can use PowerShell, WSL, or PuTTY)
- An HPC account: Contact its-hpc@pomona.edu to request one if you don’t have it
Step 1: Request an HPC Account
If you don’t already have access to Sagehen:
-
Email its-hpc@pomona.edu with:
- Your full name
- Your @pomona.edu email
- Your department and advisor/PI name
- Brief description of your research
The HPC team will set up your account (usually 1-2 business days)
You’ll receive confirmation when your account is ready
Step 2: Set Up SSH Access
SSH (Secure Shell) is how you connect to Sagehen. The connection address is:
sagehen.hpc.pomona.edu
On macOS or Linux
Open Terminal
-
Connect to Sagehen:
Replace
usernamewith your Pomona username (part before @pomona.edu) -
First time connecting, you’ll see:
The authenticity of host 'sagehen.hpc.pomona.edu' can't be established. ECDSA key fingerprint is SHA256:... Are you sure you want to continue connecting (yes/no/[fingerprint])?Type
yesand press Enter
On Windows
Option A: Use PowerShell (Windows 10 and newer)
Open PowerShell (search for “PowerShell” in Start menu)
-
Connect to Sagehen:
Option B: Use WSL (Windows Subsystem for Linux)
Install WSL: Follow Microsoft’s WSL installation guide
Open WSL terminal
-
Connect to Sagehen:
Option C: Use PuTTY
- Download PuTTY from https://www.putty.org/
- Install and open PuTTY
- In the “Host Name” field, enter:
sagehen.hpc.pomona.edu - Leave Port as 22
- Click “Open”
- When prompted, type your username
Step 3: Complete DUO Authentication
When you connect, you’ll see:
Pomona DUO for Sagehen HPC
Duo Authentication
1. Push 'Approve' on your Pomona Duo app
2. Enter an authentication code
Passcode or option (1-3):
Option 1: Use Duo Mobile App (Recommended)
- Open the Duo Mobile app on your phone/device
- You’ll see a push notification for “Pomona College”
- Tap “Approve”
- Wait for the app to confirm
Option 2: Enter an Authentication Code
If you don’t have the app or can’t use push:
- Type
2and press Enter to get an SMS code - Check your Pomona-registered phone for a text
- Enter the 6-digit code when prompted
Option 3: Backup Code
If you’ve lost access to Duo, you can use a backup code (if you saved one earlier):
- Type your backup code
- Note: This uses up one of your limited backup codes
Step 4: First Login Test
After authenticating with Duo, you should see:
[<myusername>@sagehen ~]$
Great! You’re connected to the head node.
Step 5: Configure Your Environment (Optional)
You can customize your shell environment by editing
~/.bashrc:
Useful additions:
BASH
# Set default editor
export EDITOR=nano
# Add helpful aliases
alias sq='squeue -u $USER'
alias sa='sacct -u $USER'
alias ll='ls -lah'
# Set up your favorite modules to auto-load
module load miniconda3 # Load by default
Save with Ctrl+O, Enter, Ctrl+X.
Troubleshooting
“Permission denied (publickey)”
Problem: SSH key issue or wrong credentials
Solution: - Verify username is correct (not email,
just the part before @) - Example: if email is alice@pomona.edu,
username is alice - Check you’re connecting to correct
host: sagehen.hpc.pomona.edu
“DUO authentication failed”
Problem: Two-factor authentication didn’t work
Solutions: - Confirm Duo app is installed and
registered with Pomona - Check phone/device for push notification (might
be silent) - Try SMS option (type 2 for SMS code) - Verify
phone number registered with Pomona is correct - Contact its-hpc@pomona.edu if
still having issues
“Connection timeout” or “No route to host”
Problem: Can’t reach sagehen.hpc.pomona.edu
Solutions: - Check internet connection - Verify you can reach other Pomona services (email, Canvas) - If on off-campus network, you may need to use Pomona VPN - Contact its-hpc@pomona.edu to verify your account is active
Next Steps
Once connected, you’re ready to begin the workshop:
- Start with Episode 1: Introduction to SLURM
- Work through each episode in order
- Complete the challenges to build your skills
- Refer to the Quick Reference Card for command syntax
Getting Help
If you encounter issues:
- Technical problems: Email its-hpc@pomona.edu
- Questions about this workshop: Ask your instructor
- Job failures: Check Episode 7: Monitoring Jobs for troubleshooting
Important Reminders
Your First Session Checklist
Once all these work, proceed to the first episode!