Vilje (Sigma2)

Table of Contents

  1. Getting an Account
  2. SSH Configuration
    1. Password-less SSH
  3. Environment
  4. Installing ISSM on Vilje
    1. Troubleshooting
  5. Cluster Class Settings

Warning

Vilje was decommissioned in 2021. Documentation is maintained here in case it helps installation on Sigma2 HPC systems in production.

Getting an Account

Apply for a Sigma2 account.

SSH Configuration

Add the following lines to ~/.ssh/config on your local machine,

Host vilje vilje.hpc.ntnu.no
    HostName vilje.hpc.ntnu.no
    User <USERNAME>

replacing <USERNAME> with your Vilje username (which should be your Sigma2 username). Then, you can ssh to Vilje with,

ssh vilje

Password-less SSH

You can setup public key authentication in order to avoid having to input your password all the time you log onto Vilje. You need an SSH public/private key pair on your local machine. If you do not have one, you can create one by executing the following command on your local machine (no passphrase necessary; press Enter at each prompt to accept the defaults),

localhost$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/username/.ssh/id_rsa.
Your public key has been saved in /Users/username/.ssh/id_rsa.pub.

Two files are created:

  • your private key /Users/username/.ssh/id_rsa, and
  • the public key /Users/username/.ssh/id_rsa.pub.

The private key must be kept private and never shared — keep its file permissions restricted (600). The contents of the public key need to be copied to ~/.ssh/authorized_keys on the remote machine,

localhost$ scp ~/.ssh/id_rsa.pub username@remotehost:~

Now, log onto Vilje and add the content of id_rsa.pub to ~/.ssh/authorized_keys,

remotehost$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
remotehost$ rm ~/id_rsa.pub

If you get an error message about /home/username/.ssh/authorized_keys: No such file or directory, you may need to create a .ssh directory first,

remotehost$ mkdir ~/.ssh
remotehost$ chmod 700 ~/.ssh

Environment

On Vilje, add the following lines to ~/.bashrc,

export ISSM_DIR=<PATH_TO_ISSM>

# Load modules
module load intelcomp/17.0.0 mpt/2.14 petsc/3.7.4d
module load parmetis/4.0.3 mumps/5.0.2
module load automake

replacing <PATH_TO_ISSM> with the path to the directory that you cloned the ISSM source code repository to (note that this should be a subdirectory of /cluster/work/users/<USERNAME>/). Then, run,

source ~/.bashrc

or log out and log back in to apply this change.

Installing ISSM on Vilje

Vilje will only be used to run the code: you will use your local machine for pre- and post-processing; you will never use Vilje’ Python.

Clone the ISSM source code repository on GitHub and install the following packages:

  • m1qn3

Follow the detailed instructions for compiling ISSM on Linux, and use the following configuration script (adapt to your needs),

#!/bin/sh
export CXXFLAGS="-O2 -xAVX"
./configure \
    --prefix="${ISSM_DIR}" \
    --enable-development \
    --with-wrappers=no \
    --without-kriging \
    --with-mpi-include="/sw/sgi/mpt/mpt-2.14/include/" \
    --with-mpi-libflags="-L/sw/sgi/mpt/mpt-2.14/lib -lmpi -lmpi++" \
    --with-petsc-dir="/sw/sdev/Modules/petsc/petsc-3.7.4" \
    --with-metis-dir="/sw/sdev/Modules/parmetis/parmetis-4.0.3/include" \
    --with-mumps-dir="/sw/sdev/Modules/mumps/mumps-5.0.2" \
    --with-m1qn3-dir="${ISSM_DIR}/externalpackages/m1qn3/install" \

You can then make your configuration file executable (if it is not already) and execute it to compile and install ISSM,

chmod +x configure.sh
./configure.sh
make install

Troubleshooting

Due to the fact that the Autotools on this machine are out of date, you should comment out the following line in src/c/main/EnvironmentInit.cpp,

if(!my_rank) printf("(website: %s contact: %s)\n",PACKAGE_URL,PACKAGE_BUGREPORT);

Cluster Class Settings

In order to connect to Vilje from the machine that you are doing model setup and results analysis on, you will need to create a cluster class settings file for your chosen scripting interface.

Create file $ISSM_DIR/src/m/vilje_settings.m, which might include,

cluster.login='<USERNAME>';
cluster.queue='workq';
cluster.codepath='<PATH_TO_ISSM_ON_CLUSTER>/bin/';
cluster.executionpath='<PATH_TO_ISSM_ON_CLUSTER>/execution/';
cluster.accountname='nn4659k'; % this is for ice2ice
cluster.numnodes=1;
cluster.numprocess=8;

Create file $ISSM_DIR/src/py/vilje_settings.py, which might include,

def vilje_settings(md):
    md.cluster.login='<USERNAME>'
    md.cluster.queue='workq'
    md.cluster.codepath='<PATH_TO_ISSM_ON_CLUSTER>/bin/'
    md.cluster.executionpath='<PATH_TO_ISSM_ON_CLUSTER>/execution/'
    md.cluster.accountname='nn4659k' # this is for ice2ice
    md.cluster.numnodes=1
    md.cluster.numprocess=8
    return md

replacing <USERNAME> with your Vilje username and entering your code path and execution path (<PATH_TO_ISSM_ON_CLUSTER> should be in /work/<USERNAME>/). These settings will be picked up automatically by MATLAB when you run md.cluster=vlije().