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 userxxx@cassiopeia.c3.ca

# 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  userxxx@cassiopeia.c3.ca:path/cluster

From the cluster

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

[cluster]$ scp userxxx@cassiopeia.c3.ca:cluster/path/file  /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:

#!/bin/bash
#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

<body>

To submit a job to the cluster:

$ cd /dir/containing/script
$ sbatch script.sh

And we can check its status with:

$ sq

PD stands for pending and R for running.

Comments & questions