Lonestar (TACC)

Table of Contents

  1. Getting an Account
  2. SSH Configuration
    1. Password-less SSH
  3. Environment
  4. Installing ISSM on Lonestar
  5. Installing ISSM with Dakota on Lonestar
  6. Cluster Class Settings
  7. Running Jobs on Lonestar
  8. Running PINNICLE on Lonestar

Getting an Account

Coming soon…

SSH Configuration

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

Host lonestar ls6.tacc.utexas.edu
    HostName ls6.tacc.utexas.edu
    User <USERNAME>
    HostKeyAlias ls6.tacc.utexas.edu
    HostbasedAuthentication no

replacing <USERNAME> with your Lonestar6 username. Then, you can ssh to Lonestar6 with,

ssh lonestar

Password-less SSH

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

export ISSM_DIR=<PATH_TO_ISSM>
source $ISSM_DIR/etc/environment.sh

module load intel/18.0.2
module load gsl

replacing <PATH_TO_ISSM> with the path to the directory that you cloned the ISSM source code repository to. Then, run,

source ~/.bashrc

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

Installing ISSM on Lonestar

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

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

  • petsc (use the latest available version for Lonestar)
  • m1qn3

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

./configure \
    --prefix="${ISSM_DIR}" \
    --enable-debugging \
    --enable-development \
    --enable-standalone-libraries \
    --with-wrappers=no \
    --with-vendor="intel-lonestar" \
    --with-fortran-lib="-L/opt/apps/gcc/6.3.0/lib64/ -lgfortran -L/opt/intel/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64/ -lifcore -lifport" \
    --with-mpi-include="/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include/" \
    --with-mpi-libflags="-L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib/ -lmpich" \
    --with-mkl-libflags="-L${TACC_MKL_LIB} -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm" \
    --with-metis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
    --with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
    --with-m1qn3-dir="${ISSM_DIR}/externalpackages/m1qn3/install" \
    --with-mumps-dir="${ISSM_DIR}/externalpackages/petsc/install" \
    --with-scalapack-dir="${ISSM_DIR}/externalpackages/petsc/install"

Installing ISSM with Dakota on Lonestar

For Dakota to run, you you will still need to compile PETSc, and m1qn3. You will need to install the following additional packages in order:

  • boost (use the Lonestar script)
  • dakota (use the Lonestar script)

Use the following configuration script (adapt to your needs, making sure to not include --with-petsc-dir),

./configure \
    --prefix="${ISSM_DIR}" \
    --enable-debugging \
    --enable-development \
    --enable-standalone-libraries \
    --with-wrappers=no \
    --with-vendor="intel-lonestar" \
    --with-fortran-lib="-L/opt/apps/gcc/6.3.0/lib64/ -lgfortran -L/opt/intel/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64/ -lifcore -lifport" \
    --with-mpi-include="/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include/" \
    --with-mpi-libflags="-L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib/ -lmpich" \
    --with-mkl-libflags="-L${TACC_MKL_LIB} -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm" \
    --with-metis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
    --with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
    --with-m1qn3-dir="${ISSM_DIR}/externalpackages/m1qn3/install" \
    --with-mumps-dir="${ISSM_DIR}/externalpackages/petsc/install" \
    --with-scalapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \
    --with-boost-dir="${ISSM_DIR}/externalpackages/boost/install" \
    --with-dakota-dir="${ISSM_DIR}/externalpackages/dakota/install"

Cluster Class Settings

In order to connect to Lonestar 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 $ISSM_DIR/src/m/lonestar_settings.m, which might include,

cluster.login='<USERNAME>';
cluster.codepath='<PATH_TO_ISSM_ON_CLUSTER>/bin/';
cluster.executionpath='<PATH_TO_ISSM_ON_CLUSTER>/bin/execution';

Cluster class lonestar.py still needs to be developed.

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

Note that the `executionpath’ creates temporary binary files that can be removed once the job is complete. For this reason, you can set the path to be somewhere on the $SCRATCH filesystem, which provides unlimited temporary storage on Lonestar6.

Running Jobs on Lonestar

On Lonestar, each node has 24 cores and you can use any multiple of 24 for the total number of processors. The more nodes and the longer the requested time, the more you will have to wait in the queue, so choose your settings wisely. For example, use,

md.cluster=lonestar('numnodes',2,'cpuspernode',12);

Cluster class lonestar.py still needs to be developed.

to have a job with 2 nodes and 12 CPUs per node for a total of 24 cores.

Before you run your job, make sure to open a port first and enter the port number in md.cluster. Here is a handy alias,

alias ls6tunnel='ssh -L 1099:localhost:22 ls6'

This will open port number 1099 that you can then use in ISSM so that you don’t need to enter your password.

To submit a job on Lonestar, run,

sbatch job.queue

If you want to check the status of your job and the node you are using on Lonestar, run,

showq -u <USERNAME>

replacing <USERNAME> with your TACC username.

You can delete a job manually with,

scancel <JOBID>

where <JOBID> is the ID of the job indicated in the MATLAB session. MATLAB also indicates the directory where you job is running, which contains the files <JOBNAME>.outlog and <JOBNAME>.errlog. The outlog file contains any information that would appear if you were running your job on your local machine and the errlog file contains any information pertaining to errors that the job encounters.

Running PINNICLE on Lonestar

Lonestar supports containers with Apptainer. A precompiled image with Tensorflow v.2 backend is available at docker://chenggongdartmouth/pinnicle_ls6:v0.1.

You need to build this apptainer image from the Docker image on Lonestar. First, create an interactive session in Lonestar’ gpu-a100-dev or gpu-a100 queue,

idev -t 1:00:00 -N 1 -n 4 -p gpu-a100-dev

You will need to load the cuda and apptainer modules with,

module load cuda/11.4 cudnn/8.2.4 nccl/2.11.4
module load tacc-apptainer

cd to your <YOUR_WORKING_PATH> directory on Lonestar, which should look something like /work/xxxxx/<USERNAME>/ls6.

Build the apptainer image from the Docker image with --nv,

apptainer build --nv <YOUR_WORKING_PATH>/<YOUR_IMAGE_NAME> docker://chenggongdartmouth/pinnicle_ls6:v0.1

After building the image, you can run it with,

apptainer shell --nv <YOUR_WORKING_PATH>/<YOUR_IMAGE_NAME>

You can also submit a job in the queue with,

#!/bin/bash

#SBATCH -J job_name           # job name
#SBATCH -o output.%j          # output file named, output.jobID
#SBATCH -e error.%j           # error file named, error.jobID
#SBATCH -p gpu-a100           # queue name
#SBATCH -N 1                  # number of nodes requested
#SBATCH --ntasks-per-node 4   # tasks per node
#SBATCH -t 10:00:00           # time, hh:mm:ss
#SBATCH --mail-user=<EMAIL_ADDRESS>
#SBATCH --mail-type=all

module load cuda/11.4 cudnn/8.2.4 nccl/2.11.4
module load tacc-apptainer
apptainer exec --nv <YOUR_WORKING_PATH>/<YOUR_IMAGE_NAME> python test.py