Submitting a Python Job with Hello World

Let’s learn how to submit a job to the HPC!


To start, open up an IDE of your choice and write code that will output “Hello World” into the terminal:

print("Hello World")

Next, upload your file onto the HPC. Depending on your system/OS, you may have to follow different steps to put your file onto the HPC. For that, follow this tutorial.



Next, we must create a basic BASH file to submit to the HPC. The BASH file acts as sort of a set of instructions for the HPC, including what resources the HPC will provide, the length of the job we shall submit, the modules we will need for the job (in this case, python 3.8.7) and the file we will run (our python file, which in this case is animal.py).

#!/bin/bash

#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=1G
#SBATCH --partition=acomputeq
#SBATCH --job-name=basicname

echo "*** Running Python on: "$(hostname)

python animal.py

After we include the right instructions into our BASH file, we are now able to upload/add it to our home directory of the HPC (link for how to transfer files to the HPC and use the command sbatch to begin the job. Once the job has submitted and finished, you should recieve an output file within your directory–this contains the “hello world” output you’d typically see on your terminal:

Open the file in a text editor, and you should see your output!




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Jupyter Notebook on the HPC
  • How to Run a Text Classification Model
  • Creating an Account
  • How to View Your Virtual Desktop + Tips