Updated 2021-05-17

Run Julia on the Cluster


  • In the PBS script load julia with module load julia/1.0.0. You can use module avail julia to see what versions of julia are available.
  • In the computation part of your PBS script, enter the folder where you have stored the julia script (using cd). If it is in the same dir you have/are submitting the PBS script from, you can use cd $PBS_O_WORKDIR
  • To run the Julia script, use julia -p x <juliaScriptName.rb> to run the script. Make sure you use the -p flag (for num processors), where x is the num of processors you requested in the PBS script.

Run Interactively

  • Julia has an interactive shell, like python
  • If you want to run Julia interactively, start a vnc session, open the terminal, load julia, then type julia to start the interactive shell.
  • Guide on how to start a vnc session here

Walkthrough: Run Julia on the Cluster

  • This walkthrough will use a simple Julia script that calculates the area of a circle based on radius.
  • Julia script: test.jl
  • PBS script: julia.pbs
  • You can transfer the files to your account on the cluster to follow along. The file transfer guide may be helpful.

Part 1: The PBS Script

#PBS -N juliaTest
#PBS -A [Account]
#PBS -l nodes=1:ppn=2
#PBS -l pmem=2gb
#PBS -l walltime=1:00
#PBS -q inferno
#PBS -j oe
#PBS -o julia.out

module load julia/1.0.0
julia -p 2 test.jl
  • The #PBS directives are standard, requesting just 1 minute of walltime and 1 node with 2 cores. More on #PBS directives can be found in the PBS guide
  • $PBS_O_WORKDIR is simply a variable that represents the directory you submit the PBS script from.


Make sure the julia script you want to run (in this case, test.jl) is in the same directory you put the PBS script.

  • julia -p 2 test.jl runs the script


  • You must use the -p 2 option, where 2 is the number of cores you requested in the #PBS directives part of the PBS script

Part 2: Submit Job and Check Status

  • Make sure you're in the dir that contains the PBS Script
  • Submit as normal, with qsub <pbs script name>. In this case qsub julia.pbs
  • Check job status with qstat -u <gtusername3> -n, replacing "gtusername3" with your gt username
  • You can delete the job with qdel 22182721 , replacing the number with the jobid returned after running qsub

Part 3: Collecting Results

  • In the directory where you submitted the PBS script, you should see a julia.out file. Use cat julia.out or open the file in a text editor to take a look.
  • julia.out should look like this:
Job name:   juliaTest
Queue:      inferno
End PBS Prologue Fri Sep 21 10:06:50 EDT 2018
area = 12.566
Begin PBS Epilogue Fri Sep 21 10:06:54 EDT 2018
Job ID:     22489577.shared-sched.pace.gatech.edu

  • After the result files are produced, you can move the files off the cluster, refer to the file transfer guide for help.
  • Congratulations! You successfully ran a Julia script on the cluster.