Skip to content

Instantly share code, notes, and snippets.

@nperraud
Forked from jirikuncar/.a README.md
Last active April 20, 2021 15:58
Show Gist options
  • Save nperraud/a52351fd23e6dbe275325b1bf413787c to your computer and use it in GitHub Desktop.
Save nperraud/a52351fd23e6dbe275325b1bf413787c to your computer and use it in GitHub Desktop.
Remote Jupyter Kernel at CSCS

Configuration

Direct Access to Computing Systems

  1. Get an Account and store your account name export CSCS_USER=unixname.

  2. Configure direct access to the computing system. You can use the ssh_config template:

    $ cat >> ~/.ssh/config <<EOF
    
    Host ela.cscs.ch
     User $CSCS_USER
    
    Match host !ela.cscs.ch,*.cscs.ch
     ControlMaster auto
     ControlPath ~/.ssh/%r@%h:%p
     ControlPersist 1
     User $CSCS_USER
     ProxyCommand ssh -q -Y ela.cscs.ch -W %h:%p
    EOF
    

    NOTE: check that you don't have any conflicting rules in ~/.ssh/config.

  3. Connect to the computing system (in following example use export CSCS_SYSTEM=daint.cscs.ch) using ssh $CSCS_SYSTEM.

Compute Node

  1. Make sure you are connected to $CSCS_SYSTEM (check previous section).
  2. Configure direct access to nodes without password:
    $ ssh-keygen
    $ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
  3. Start new compute node in interactive mode: srun -C gpu -J test -v -u bash -i and check the output of uname -a.
  4. From new terminal start new SSH connection to $CSCS_SYSTEM and check the job:
    (local)$ ssh $CSCS_SYSTEM
    ($CSCS_SYSTEM)$ squeue -u $USER -l
    Tue May  9 07:43:20 2017
      JOBID PARTITION     NAME     USER    STATE       TIME TIME_LIMI  NODES NODELIST(REASON)
     123456    normal     test    $USER  RUNNING       0:15   1:00:00      1 nid00000
    
    ($CSCS_SYSTEM)$ export CSCS_NODE=nid00000  # the name in last column 
    ($CSCS_SYSTEM)$ ssh $CSCS_NODE
    ($CSCS_NODE)$ uname -a
    Linux nid00000 3.12.60-52.49.1_2.0-cray_ari_c #1 SMP Mon Nov 21 15:40:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    Compare the output from step 2 and if they are equal the connection was successful. Now close this terminal.
  5. Close the running srun command by pressing ctrc+c twice.

Things to know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment