Andes (Dartmouth Research Computing)
Table of Contents
- Getting an Account
- SSH Configuration
- Environment
- Installing ISSM on Andes
- Installing ISSM with CoDiPack (AD) on Andes
- Cluster Class Settings
- Running jobs on Andes
- Other Notes About Running on Andes
- slurm
- Running jobs with GPUs
Getting an Account
To request a Dartmouth HPC account you will need a Dartmouth NetID. If applicable, make sure you are added to the ICE DartFS Lab share and the ice Slurm account and ask that the ice Slurm account be made the default for your HPC account.
SSH Configuration
Add the following lines to ~/.ssh/config on your local machine,
Host andes andes8.dartmouth.edu
Hostname andes8.dartmouth.edu
User <USERNAME>
GSSAPIAuthentication yes
GSSAPIDelegateCredentials yes
replacing <USERNAME> with your Andes username (which should be your Dartmouth NetID). Then, you can ssh to Andes with,
ssh andes
Password-less SSH
Dartmouth officially suggests using GSSAPI for password-less SSH access.
On your local machine, run,
kinit -f -l 7d <USERNAME>@KIEWIT.DARTMOUTH.EDU
replacing <USERNAME> with your Dartmouth NetID. -l 7d requests a ticket with a 7-day lifetime; adjust this option as needed. Enter your Dartmouth NetIS password when prompted. Subsequent SSH connections to Andes will not require a password.
Troubleshooting
If you can’t log in anymore (or if you get an error message about wrong permission for your home directory), you will need to destroy all active Kerberos authorization tickets. To do this:
- Connect to Andes:
ssh NetID@andes8.dartmouth.edu - Once on Andes (even with the error thrown), do:
kdestroy -A - Exit out of Andes, go back to your
~/.ssh/configand comment out the GSSAPI lines with a# - On your local computer (or Totten, whichever you’re using) run:
kdestroy -A - Now try to
sshto Andes again with your password and it should work!
In some instances, the return key produces ^M and the password cannot be entered. If this happens, run,
stty sane
Environment
On Andes, add the following lines to ~/.bashrc,
export ISSM_DIR=<PATH_TO_ISSM>
source $ISSM_DIR/etc/environment.sh
# Load modules
module purge
module load cmake/3.23.2
module load intel-compilers/23.2
module load mkl/19.3
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 Andes
Andes will only be used to run the code: you will use your local machine for pre- and post-processing; you will never use Andes’ MATLAB.
Clone the ISSM source code repository on GitHub and install the following packages:
- petsc (use the latest available version for Andes)
Follow the detailed instructions for compiling ISSM on Linux, and use the following configuration script (adapt to your needs),
export CC=mpicc
export CXX=mpicxx
export FC=mpifort
export CXXFLAGS="-g -O3 -std=c++11 -fp-model=precise"
./configure \
--prefix="${ISSM_DIR}" \
--enable-development \
--with-wrappers=no \
--with-mpi-include="${ISSM_DIR}/externalpackages/petsc/install/include" \
--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpifort -lifcore" \
--with-mkl-libflags="${MKL_LIB}" \
--with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-metis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-scalapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-mumps-dir="${ISSM_DIR}/externalpackages/petsc/install"
It is highly recommended to use batch or interactive job to compile ISSM since the login node has very limited computational resources.
To request resources for an interactive job,
srun --nodes=1 --ntasks-per-node=16 --pty /bin/bash
Installing ISSM with CoDiPack (AD) on Andes
You will need to install the following additional packages in order:
- codipack
- medipack
- adjointpetsc (use the Andes script)
Use the following configuration script (adapt to your needs, making sure to not include --with-petsc-dir),
export CC=mpicc
export CXX=mpicxx
export FC=mpifort
export CXXFLAGS="-g -O2 -fPIC -std=c++11 -DCODI_ForcedInlines -fp-model=precise"
export LDFLAGS="-L/optnfs/common/intel/compilers_and_libraries_2023.2.0/compiler/2023.2.0/linux/compiler/lib/intel64_lin/ -lifcoremt"
./configure \
--prefix="${ISSM_DIR}" \
--enable-development \
--enable-debugging \
--enable-tape-alloc \
--with-wrappers=no \
--without-kriging \
--without-Love \
--without-Sealevelchange \
--with-mpi-include="${ISSM_DIR}/externalpackages/petsc/install/include" \
--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpifort"\
--with-fortran-lib="-L/usr/lib64/ -lgfortran" \
--with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-adjointpetsc-dir="${ISSM_DIR}/externalpackages/adjointpetsc/install" \
--with-metis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-parmetis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-blas-lapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-scalapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-mumps-dir="${ISSM_DIR}/externalpackages/petsc/install" \
--with-codipack-dir="${ISSM_DIR}/externalpackages/codipack/install" \
--with-medipack-dir="${ISSM_DIR}/externalpackages/medipack/install"
Cluster Class Settings
In order to connect to Andes 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/andes_settings.m, which might include,
cluster.login='<USERNAME>';
cluster.codepath='<PATH_TO_ISSM_ON_CLUSTER>/bin/';
cluster.executionpath='<PATH_TO_ISSM_ON_CLUSTER>/execution/';
Cluster class andes.py still needs to be developed.
replacing <USERNAME> with your Dartmouth NetID and entering your code path and execution path. These settings will be picked up automatically when you run md.cluster=andes().
The file system on Andes is called DartFS (or DarFS-hpc). Your home directory on DartFS is only 50GB, so it is better to use the lab folder, which has 1TB,
/dartfs/rc/lab/I/ICE/yourpath/
More about Research Computing accounts.
Running jobs on Andes
On Andes, you can use up to 64 cores per node. 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=discovery('numnodes',1,'cpuspernode',8);
Cluster class andes.py still needs to be developed.
to have a job of 8 cores on one node.
More about cluster details (requires Dartmouth NetID).
Each node has it’s own time limit for jobs that are being run from the queue, but they tend to be 10 or 30 days. You can find the time limit of each node on Andes by running,
sinfo
If you are running something interactively on Andes, there may be a credential limit for the DartFS system of 10 hours. More about Dart FS system (requires Dartmouth NetID).
If you want to check the status of your job and the node you are using on Andes, run,
squeue -u <USERNAME>
replacing <USERNAME> with your Dartmouth NetID.
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.
If you want to load results from the cluster manually (for example if you have an error due to a connection interruption), inspect your MATLAB session, using $ISSM_DIR/execution/<LAUNCHSTRING>/<JOBNAME>.lock to populate and run,
md=loadresultsfromcluster(md,'<LAUNCHSTRING>','<JOBNAME>');
Note
In the case where
md.settings.waitonlock > 0and you need to load manually (e.g., connection interruption), it is necessary to setmd.private.runtimename=<LAUNCHSTRING>;before callingloadresultsfromcluster.
Other Notes About Running on Andes
If you want to use more than one node (not recommended), the current (temporary) solution is to:
- start the job
- go to Andes and see which nodes discovery is using (see
squeueusage below) - cancel the job (see
scancelusage below) - find the
.queuescript for your run and manually edit the start of thempiruncommand to look like,mpirun -n 40 --hosts <NODELIST>where
<NODELIST>is the list of nodes separated by commas (e.g.,q03,q09). - restart your run with,
sbatch <FILENAME>.queueIf you do not do this, your job will will run on just one node.
To get more information about your job while it’s running, ssh from Andes to the node given by squeue -u <USERNAME> and then run htop. Once in htop, if you want to see information for a specific user, type u and then start typing the user ID until the correct one is highlighted and hit ENTER. You can also get more information about a job by entering,
scontrol show job <JOBID>
There may be several reasons for a job being in the queue for a long time. First, try reducing the amount of time you’re requesting. Another thing to try is to add the following line to your <run_name>.queue file and restarting your job,
#SBATCH --partition preemptable
This may give you access to some idle nodes, but note that your job can be stopped if a higher priority job wants your resources.
slurm
A comparison of PBS to slurm commands.
Overview of slurm (requires Dartmouth NetID).
Useful commands:
- Get number of idle nodes,
sinfo --states=idle - See a user’s jobs,
squeue -u <USERNAME> - Get more information on a user’s jobs,
sacct -u <USERNAME> format=User,JobID,account,Timelimit,elapsed,ReqMem,MaxRss,ExitCode
Running jobs with GPUs
Andes has 12 GPU nodes: g01-g12. To submit a job to these nodes, you will need to specify,
#SBATCH --partition gpuq
#SBATCH --gres=gpu:1
where 1 means to use 1 GPU.