For access to Stern Research Computing resources and services, fill out the User Account Request Form.
For questions, email to: scrc-list@stern.nyu.edu.
You log in to the SCRC cluster with SSH, using your NYU NetID and password. Off campus, or anywhere other than a wired connection in a Stern building, connect to the NYU VPN first.
You can use the cluster from your browser, including a remote desktop and VS Code. See the Open On-Demand page for more information. Fastest way to get started. Recommended.
Mac: open preferred terminal app( Terminal, iTerm2, Ghostty).
Windows: open PowerShell. SSH is built into Windows 10 and 11, so you don't need to install anything.
Linux: open any terminal app.
Then type this, replacing NetID with your own:
The first time you connect, SSH asks whether you trust the server. Type yes and press Enter. Then enter your password. Nothing appears on screen while you type it, which is normal.
When you see a command prompt, you're logged in. Type exit to log out.
If Windows says ssh is not recognized, turn on "OpenSSH Client" under Optional features in Windows Settings, then open a new PowerShell window.
From the same terminal on your own computer (not while logged in to the cluster), use scp. To copy a file to your bigdata directory on the cluster:
scp myfile.py NetID@login.scrc.nyu.edu:~/bigdata/
To copy a file from the cluster to the folder you're in on your computer:
scp NetID@login.scrc.nyu.edu:~/bigdata/results.csv .
If you'd rather drag and drop, use FileZilla. Connect with Host login.scrc.nyu.edu, your NetID and password, and Port 22. Your computer's files appear on the left and your cluster files on the right.
SCRC's Linux computers use a command line called the shell (BASH by default). After you log in, you start in your home directory and type commands at the prompt. These are enough to follow the example on this page.
pwd Show the directory you are in
ls -l List files with size, date and permissions
mkdir myproject Create a directory
cd myproject Move into a directory (cd .. moves up one level)
nano myfile.py Create or edit a file (ctrl-o saves, ctrl-x exits)
more myfile.py View a file (space for the next page, q to quit)
cp old new Copy a file
mv old new Rename or move a file
rm myfile.py Delete a file
man ls, ls --help Get help on a command
A few things worth knowing:
Linux is case-sensitive, so costProject and costproject are different names.
There is no undo. A file deleted with rm is gone, so before using a wildcard such as rm data*, run ls data* to see what it matches.
Press Tab to complete a file name, the up arrow to reuse a command, and ctrl-c to cancel a command that is stuck.
Learn more about Linux:
Learning the Shell: a short, step-by-step introduction. Start here if the command line is new to you.
The Unix Shell: a hands-on lesson from Software Carpentry, aimed at researchers.
The Linux Command Line: a free, complete book for going deeper, including file permissions, redirection and pipes.
explainshell: paste in a command to see what each part of it does.
Slurm is the scheduler for the SCRC cluster. You write a job script that says what resources you need and what to run, submit it from a login node, and Slurm runs it on a compute node when resources are free. Run your programs through Slurm, not directly on a login node.
sbatch myjob.sbatch Submit a job script
squeue -u $USER Show your queued and running jobs
scancel <jobid> Cancel a job
sinfo Show partitions and node availability
sacct -j <jobid> --format=JobID,Elapsed,MaxRSS,AllocCPUS,State
Show time and memory used by a finished job
Options in a job script go on lines that start with exactly #SBATCH, placed before the first command in the script. If the # is missing you will see "SBATCH: command not found", and if a command comes first Slurm silently ignores the options after it. In both cases the job can still run, but without the time, memory or email settings you asked for.
Learn more about Slurm:
SCRC Tutorials: worked examples for Python, R, SAS and MATLAB on this cluster.
Slurm Quick Start User Guide: the official overview.
sbatch reference: every option you can use in a job script.
squeue reference: including what job states and reason codes mean.
scancel reference: cancelling jobs and job arrays.
Job arrays: running one script many times with different inputs.
Introduction
This tutorial is intended to familiarize you with the process of running and scheduling jobs on the SCRC Slurm cluster. You will use the Simple Python Job to run a basic Python script that outputs the text Hello World!. Make sure you are logged in to a Linux terminal with SSH. Instructions can be found at Accessing the SCRC Systems.
Writing Python Code
Using a text editing program such as nano, vim, code, or emacs, create a python script hello-world.py.
'''
hello-world.py
Print string "Hello World!" to output
'''
# --------------------------------
# main
# --------------------------------
def main():
print("Hello World!")
if __name__ == '__main__':
main()
Creating the Slurm Script
To run a Python script use a Slurm sbatch file to allocate the necessary compute resources. It contains directives for Slurm to interpret as well as programs for it to execute. Here is an example sbatch file, hello-world.sbatch, that submits the python job to the Slurm cluster.
#!/bin/bash
#
# [hello-world.sbatch]
#
#SBATCH --job-name=hello # Job name
#SBATCH --output=hello.out # Output file name
#SBATCH --time=00:01:00 # Set max runtime of job = 1 minute
#SBATCH --mem=2G # Request 2 gigabytes of memory
#SBATCH --mail-type=BEGIN,END,FAIL # Send email notifications
#SBATCH --mail-user=<netID>@stern.nyu.edu # email TO
module purge # Start with a clean environment
module load python/3.9.7 # Load python module
python hello-world.py # Run the script using the loaded Python module
The .sbatch extension is just a convention that makes job scripts easy to spot. Slurm doesn't care what the file is called.
Lines beginning with #SBATCH are Slurm directives that specify job options, resource requests, and scheduling parameters for a job submitted to a Slurm cluster.
The module command is used to manage environment modules, which allow users to easily load and unload software and environment settings on systems such as HPC clusters. The purge subcommand clears all loaded modules, while the load subcommand loads a specific module.
The python hello-world.py command executes the Python script named hello-world.py using the Python interpreter. The script is run with the version of Python that was loaded via the environment module.
Executing the Slurm Script
Submit the job with the command:
sbatch hello-world.sbatch
The job is now queued and as soon as the requested resources are available, Slurm schedules the job onto one of the Slurm compute nodes. If the requested resources cannot be met, the job waits in the queue.
To check the status of your submitted jobs:
squeue -u $USER
To check all jobs in the queue and running on the cluster:
squeue
For more examples, including array jobs, R, SAS and MATLAB, see the SCRC Tutorials.