Reading Using Julia on Compute Canada clusters

Last updated: January 12, 2023

Logging to the cluster

Open a terminal emulator.

Windows users, launch MobaXTerm.
MacOS users, launch Terminal.
Linux users, launch xterm or the terminal emulator of your choice.

$ ssh

# enter password

You are now in our training cluster.

Loading the Julia module

This is done with the Lmod tool through the module command. You can find the full documentation here and below are the subcommands you will need:

# Get help on the module command
$ module help
$ module --help
$ module -h

# List modules that are already loaded
$ module list

# See which modules are available for Julia
$ module spider julia

# See how to load the latest version (julia 1.4.1)
$ module spider julia/1.4.1

# Load julia 1.4.1 with the required gcc module first
# (the order is important)
$ module load gcc/7.3.0 julia/1.4.1

# You can see that we now have Julia loaded
$ module list

Copying files to the cluster

If you need to copy files to the cluster, you can use scp .

From your computer

If you are in a local shell, run:

[local]$ scp /local/path/file

From the cluster

If you are in a remote shell (through ssh), run:

[cluster]$ scp  /local/path

Job scripts

To submit a job to Slurm (the job scheduler used by the Compute Canada clusters), you need to write an sbatch script:

#SBATCH --job-name=<name>			# job name
#SBATCH --time=<time>				# max walltime
#SBATCH --cpus-per-task=<n>         # number of cores
#SBATCH --mem=<mem>					# max memory (default unit is megabytes)
#SBATCH --output=<file%j.out>		# file name for the output
#SBATCH --error=<file%j.err>		# file name for errors
# %j gets replaced with the job number


To submit a job to the cluster:

$ cd /dir/containing/script
$ sbatch

And we can check its status with:

$ sq

PD stands for pending and R for running.

Comments & questions