Run Julia on the Cluster¶
- In the
PBSscript load julia with
module load julia/1.0.0. You can use
module avail juliato see what versions of julia are available.
- In the computation part of your
PBSscript, enter the folder where you have stored the julia script (using
cd). If it is in the same dir you have/are submitting the
PBSscript from, you can use
- To run the Julia script, use
julia -p x <juliaScriptName.rb>to run the script. Make sure you use the
-pflag (for num processors), where x is the num of processors you requested in the
- Julia has an interactive shell, like python
- If you wan to run Julia interactively, start a vnc session, open the terminal, load julia, then type
juliato 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 -l nodes=1:ppn=2 #PBS -l pmem=2gb #PBS -l walltime=1:00 #PBS -q force-6 #PBS -j oe #PBS -o julia.out cd $PBS_O_WORKDIR module load julia/1.0.0 julia -p 2 test.jl
#PBSdirectives are standard, requesting just 1 minute of walltime and 1 node with 2 cores. More on
#PBSdirectives can be found in the PBS guide
$PBS_O_WORKDIRis 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.jlruns the script
- You must use the
-p 2option, where 2 is the number of cores you requested in the
#PBSdirectives part of the
Part 2: Submit Job and Check Status¶
- Make sure you're in the dir that contains the
- Submit as normal, with
qsub <pbs script name>. In this case
- 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
PBSscript, you should see a
cat julia.outor open the file in a text editor to take a look.
julia.outshould look like this:
Job name: juliaTest Queue: force-6 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.