Files
Castor/docs/Using SHARCNET.ipynb
2018-01-24 20:11:26 -05:00

4.0 KiB

Step 1: Register

  1. Create an account on the Compute Canada website
  2. You will be asked for Compute Canada Role Identifier (CCRI) of your sponsor or supervisor. A CCRI is an identifier of the form abc-123-01.
  3. You and your supervisor will receive an email after creating the account; please confirm your application.

Step 2: SSH Setup

  1. Update your SSH configuration
cat >> ~/.ssh/config
  1. Copy the following content after adding your username
Host sharc
User <username>
Hostname graham.computecanada.ca
ServerAliveInterval 30
TCPKeepAlive yes
Protocol 2,1
Identityfile ~/.ssh/id_rsa
  1. Copy your SSH key to the server as an authorized key:
ssh-copy-id sharc
  1. Login. You may have to wait for sometime for your account to be updated on the server.
ssh sharc

Step 3: Environment Setup

  1. Download and setup Anaconda
cd projects
wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
chmod +x Anaconda3-5.0.1-Linux-x86_64.sh
./Anaconda3-5.0.1-Linux-x86_64.sh
  1. Update ~/.bashrc by adding the following:
export PATH=/home/<username>/anaconda3/bin:$PATH
  1. Source
source ~/.bashrc

Step 4: Setup SM model

  1. Follow the detailed instructions from here

Step 5: SHARCNET basics

Following are the list of common commands on SLURM. For more details, refer this

Basic commands:

1.To submit a job:

sbatch <job_name.sh>

Your job should have atleast the following as a part of the preamble:

  • CPU job:
#!/bin/bash
#SBATCH --time=00:01:00
#SBATCH --account=def-<name-of-the-sponsor>
  • GPU job:
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --gres=gpu:2
#SBATCH --ntasks-per-node=32
#SBATCH --mem=12288
#SBATCH --time=10:00
#SBATCH --account=def-<name-of-the-sponsor>

The output of the job will be stored in the slurm-<jobid>.out file

2.To monitor jobs in the queue:

squeue -u <username>

3.To see the completed jobs:

sacct

4.To cancel a job:

scancel <jobid>
In [ ]: