Skip to content

Getting Started on Niagara

Alyssa Dai edited this page Mar 3, 2023 · 19 revisions

Logging into Niagara

Log in with your Compute Canada credentials:

You will need to setup SSH keys for Niagara, first see, https://docs.computecanada.ca/wiki/SSH_Keys

ssh MYCCUSERNAME@niagara.computecanada.ca

For more info on directories, modules, and running jobs in Niagara, see https://docs.scinet.utoronto.ca/index.php/Niagara_Quickstart. In general, the SciNet docs are very extensive, so any question you have regarding the Niagara cluster likely will have an answer there!

Setup the CoBrA lab software modules

Niagara has an extensive library of software you should learn how to navigate. The use a piece of software called environment-modules to manage it all, and there is a great write up on their wiki on how to use it.

The CoBrA lab has its own set of software you can use through the same "modules" system. Here's how you can get access to it:

  1. cp /project/m/mchakrav/bashrc-template ~/.bashrc You may get a warning that you are overwriting a file, this is okay and expected, select yes.
  2. source ~/.bashrc
  3. ln -s $SCRATCH ~/scratch

Now CoBrALab modules are available for your account on Niagara. Note that you only need to do the above steps once, after that you should have access to the modules immediately after logging in.

Running module load cobralab/2019b is the most convenient way to load most of the core CoBrALab modules (such as minc-toolkit, RMINC) on Niagara.

Moving data to/from Niagara

This can be accomplished with rsync. The general format, as with any rsync command, is rsync [options] <source path> <destination path>. If you are moving files to/from your local machine, and either the source or destination is a remote server, the corresponding path will need to be prepended with the username and hostname used to access the remote server, i.e., [username@hostname]:.

Between your local machine and Niagara

On your local machine, run:

rsync -avz username@niagara.computecanada.ca:/path/to/files/on/remote /path/to/save/files/on/local

Between Niagara and the CIC

On the CIC, run:

# Niagara -> CIC
rsync -avz username@niagara.computecanada.ca:/path/to/files/on/niagara /path/to/save/files/on/cic

# CIC -> Niagara
rsync -avz /path/to/files/on/cic username@niagara.computecanada.ca:/path/to/save/files/on/niagara

Note that if you are moving >10 GB of data, you should use the Niagara datamover nodes rather than the login nodes:

nia-datamover1.scinet.utoronto.ca
nia-datamover2.scinet.utoronto.ca

Do not use rsync while logged into Niagara/Beluga nodes to transfer data to/from the CIC computers! This will impact the usability of remote access for all users.

Data on Niagara, commands locally

Instead of copying files down from Niagara, you can view and even manipulate them from the CIC terminal with the following command. Create a directory that you want to mount (e.g. for DBM outputs)

mkdir /data/chamal/projects/lani/neonate/dbm_outputs
sshfs lanicupo@niagara.computecanada.ca:/home/m/mchakrav/lanicupo/scratch/20220328_neonate_dbm/output /data/chamal/projects/lani/neonate/dbm_outputs

The command always takes the form:

sshfs user@remote:/remote/path /local/target/path

Then, you can use commands as usual (Display, mv, register, etc) but the data (and any created files) stay on Niagara. Don't forget that Niagara periodically empties your folders, though!

Clone this wiki locally