Skip to content

Intro to HPC Workshop Materials

Video recordings and slides of previous Intro to HPC workshops are available here on this page. The more recent workshops will have more updated information, but older workshops are also available.

Interactive Materials

Logging In

Instructions on Logging In

Activity: Let’s run a batch job!

Let’s write a basic Python script, then submit it to the queue

Process:

  1. write a Python script
  2. write a batch script
  3. submit the batch script

Step 1: Write a Python script

You can write anything you want! It can be as simple as print(‘hello world’), or you can make it more interesting.. up to you ;)

  1. If you haven't already, log onto the HPC
  2. create a blank python file: touch myscript.py
  3. edit the script: nano myscript.py

    a. feel free to use vim or emacs or any other text editor if you are more comfortable with one of those

    b. add something simple like print(“hello world!”) 4. be sure to save it!

Step 2: Write your batch script

Batch Script

Part 1: Use directives to tell the scheduler what resources you want

#!/bin/bash
#SBATCH --job-name=test 
#SBATCH --output=test_%A.out 
#SBATCH --error=test_%A.err 
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --partition=standard 
#SBATCH --account=<your_account> 
#SBATCH --time=00:05:00

Part 2: Load your modules

module load python/3.11

Part 3: Run your script

python3 myscript.py

Step 3: Submit your job

  1. Send to scheduler

    sbatch myscript.slurm
    
    2. Check the queue

    squeue --user=<my netid>
    
  2. View the output files

    cat <name>.out
    cat <name>.err
    
    4. View the job history report

    job-history <job id>
    

Congrats! You just ran your first batch job!

Additional Resources

The HPC Consult Team is here for you!