Hexagon (Sigma2)

Table of Contents

  1. Getting an Account
  2. SSH Configuration
    1. Password-less SSH
  3. Environment
  4. Installing ISSM on Hexagon
    1. Troubleshooting
  5. Cluster Class Settings
  6. Running Jobs on Hexagon (NEEDS TO BE UPDATED)

Warning

Hexagon was decommissioned in 2017. 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 hexagon hexagon.hpc.uib.no
    HostName hexagon.hpc.uib.no
    User <USERNAME>

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

ssh fram

Password-less SSH

You can setup public key authentication in order to avoid having to input your password all the time you log onto Hexagon. 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 Hexagon 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 Hexagon, add the following lines to ~/.bashrc,

export ISSM_DIR=<PATH_TO_ISSM>
export CRAYPE_LINK_TYPE=dynamic

# Load modules
module unload xtpe-interlagos
module unload notur
module switch PrgEnv-cray/5.2.40 PrgEnv-gnu
module load craype-barcelona
module load automake
module load cray-petsc
module load cray-tpsl
module load cray-mpich
module load gsl

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

source ~/.bashrc

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

Installing ISSM on Hexagon

Hexagon will only be used to run the code: you will use your local machine for pre- and post-processing; you will never use Hexagon’ 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

# Configure ISSM
./configure \
    --prefix="${ISSM_DIR}" \
    --enable-development \
    --with-mpi-include="${CRAY_MPICH2_DIR}/include" \
    --with-mpi-libflags="-L${CRAY_MPICH2_DIR}/lib -lmpich -lmpl -lfmpich -lmpichcxx -lmpichf90" \
    --with-petsc-dir="${PETSC_DIR}" \
    --with-m1qn3-dir="${ISSM_DIR}/externalpackages/m1qn3/install" \
    --with-metis-dir="${CRAY_TPSL_PREFIX_DIR}" \
    --with-mumps-dir="${CRAY_TPSL_PREFIX_DIR}" \
    --with-gsl-dir="/work/apps/gsl/1.16-gnu/"

Note that $ISSM_DIR should resolve to some subdirectory of /work/ so that it is accessible to the cluster nodes.

Troubleshooting

When running the Autotools, you may run into the following error message,

src/c/Makefile.am:9: Libtool library used but `LIBTOOL' is undefined
src/c/Makefile.am:9:   The usual way to define `LIBTOOL' is to add `LT_INIT'
src/c/Makefile.am:9:   to `configure.ac' and run `aclocal' and `autoconf' again.
src/c/Makefile.am:9:   If `LT_INIT' is in `configure.ac', make sure
src/c/Makefile.am:9:   its definition is in aclocal's search path.

Running libtoolize should resolve this issue.

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 Hexagon 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.

Cluster class hexagon.m still needs to be developed.

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

def hexagon_settings(md):
    md.cluster.login='<USERNAME>'
    md.cluster.queue='normal'
    md.cluster.codepath='<PATH_TO_ISSM_ON_CLUSTER>/bin/'
    md.cluster.executionpath='<PATH_TO_ISSM_ON_CLUSTER>/execution/'
    md.cluster.accountname='bjerknes'
    md.cluster.numnodes=1
    return md

replacing <USERNAME> with your Hexagon username and entering your code path and execution path. These settings will be picked up automatically when you run md.cluster=hexagon().

Running Jobs on Hexagon (NEEDS TO BE UPDATED)

Hexagon is intended for large jobs. As on Vilje, the accounting is done as if you are using 32 processes per nodes even if you are using less. So, if you don’t need a large amount of memory for your model, try to restrict the number of nodes you are using. The scheduler also prioritizes jobs with high CPU counts. Scheduler job priorities.

There are some limitations to the resources that a single user can ask for,

  • 4096 CPU cores (total number used by all running jobs)
  • 8-22 running (active) jobs (depending on load)
  • 2 idle jobs

If you want to check the ordering of the queue and your jobs position you can use in your active Hexagon session:

showq          # display jobs
showq -u $USER # display jobs for $USER
showq -i       # display only jobs in eligible (idle) queue waiting for execution