wiki:discovery

Version 19 (modified by Mathieu Morlighem, 19 months ago) ( diff )

--

Getting an account

Go to https://rc.dartmouth.edu/index.php/discoveryhpc/, you will need a Dartmouth NetID. If applicable, make sure you are added to the ICE DartFS Lab share and the ice Slurm account. Ask to make the ice Slurm account your default.

ssh configuration

You can add the following lines to ~/.ssh/config on your local machine:

Host discovery discovery7.dartmouth.edu
   Hostname discovery7.dartmouth.edu
   User USERNAME

and replace USERNAME by your Discovery username (which should be your Dartmouth NetID).

Once this is done, you can ssh Discovery by simply doing:

ssh discovery

Password-less ssh

Discovery officially suggests using GSSAPI for passwordless access, see here.

On your local machine, you will need to enter:

kinit -f -l 7d username@KIEWIT.DARTMOUTH.EDU

with your NetID at username and the password for NetID to request a ticket for 7 days (or any time period you need), then you can use ssh discovery without entering a password.

Environment

On Discovery, add the following lines to ~/.bashrc:

export ISSM_DIR=PATHTOTRUNK
source $ISSM_DIR/etc/environment.sh
module purge
module load intel-compilers/19.3
module load mpich/3.3.0-intel19.3
module load mkl/19.3
module load cmake/3.10.1

Use:

source ~/.bashrc

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

Installing ISSM on Discovery

Discovery will only be used to run the code, you will use your local machine for pre and post-processing, you will never use Discovery's MATLAB. You can check out ISSM and install the following packages:

  • PETSc 3.19 (use the discovery script)
  • m1qn3

Follow the detailed instructions for compiling ISSM: https://issm.jpl.nasa.gov/download/unix/

Use the following configuration script (adapt to your needs):

./configure \
   --prefix=$ISSM_DIR \
   --with-wrappers=no \
   --with-petsc-dir="$ISSM_DIR/externalpackages/petsc/install" \
   --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \
   --with-mpi-include="/optnfs/el7/mpich/3.3-intel19.3/include" \
   --with-mpi-libflags=" -lmpi -lifport" \
   --with-mkl-libflags="$MKL_LIB" \
   --with-metis-dir="$ISSM_DIR/externalpackages/petsc/install" \
   --with-mumps-dir="$ISSM_DIR/externalpackages/petsc/install" \
   --with-scalapack-dir="$ISSM_DIR/externalpackages/petsc/install" \
   --with-cxxoptflags="-g -O2 -std=c++11" \
   --enable-development

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 Discovery

You will need to install the following additional packages:

  • codipack
  • medipack

Use the following configuration script (adapt to your needs, make sure to NOT include --with-petsc-dir):

./configure \
   --prefix=$ISSM_DIR \
   --with-wrappers=no \
   --without-kriging \
   --without-kml \
   --without-Love \
   --without-Sealevelchange \
   --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \
   --with-mpi-include="/optnfs/el7/mpich/3.3-intel19.3/include" \
   --with-mpi-libflags=" -lmpi -lifport" \
   --with-mkl-libflags="$MKL_LIB" \
   --with-metis-dir="$ISSM_DIR/externalpackages/petsc/install" \
   --with-mumps-dir="$ISSM_DIR/externalpackages/petsc/install" \
   --with-scalapack-dir="$ISSM_DIR/externalpackages/petsc/install" \
   --with-codipack-dir="$ISSM_DIR/externalpackages/codipack/install" \
   --with-medipack-dir="$ISSM_DIR/externalpackages/medipack/install" \
   --with-cxxoptflags="-g -O2 -fPIC -std=c++11 -DCODI_ForcedInlines -wd2196" \
   --enable-tape-alloc \
   --enable-development \
   --enable-debugging

discovery_settings.m

You have to add a file in $ISSM_DIR/src/m entitled discovery_settings.m with your personal settings on your local ism install:

cluster.login='yourNetID';
cluster.codepath='/dartfs/rc/lab/I/ICE/yourpath/trunk-jpl/bin/';
cluster.executionpath='/dartfs/rc/lab/I/ICE/yourpath/trunk-jpl/execution/';

use your NetID for the login and enter your code path and execution path. These settings will be picked up automatically by matlab when you do md.cluster= discovery()

The file sytem on Discovery is called DartFS (or DarFS-hpc). Your home directory on DartFS is only 50GB, it would be better to use the lab folder which has 1TB:

/dartfs/rc/lab/I/ICE/yourpath/

Read more here: https://services.dartmouth.edu/TDClient/1806/Portal/KB/ArticleDet?ID=64619

Running jobs on Discovery

On Discovery, 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:

md.cluster= discovery('numnodes',1,'cpuspernode',8);

to have a job of 8 cores on one node. See cluster details: https://services.dartmouth.edu/TDClient/1806/Portal/KB/ArticleDet?ID=134058.

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 by entering on Discovery:

sinfo

If you are running something interactively on Discovery, there may be a credential limit for the DartFS system of 10 hours. Read more here: https://services.dartmouth.edu/TDClient/1806/Portal/KB/ArticleDet?ID=76691

Now if you want to check the status of your job and the node you are using, type in the bash with the Discovery session:

squeue -u username

You can delete your job manually by typing:

scancel JOBID

where JOBID is the ID of your job (indicated in the Matlab session). Matlab indicates too the directory of your job where you can find the files JOBNAME.outlog and JOBNAME.errlog. The outlog file contains the information that would appear if you were running your job on your local machine and the errlog file contains the error information in case the job encounters an error.

If you want to load results from the cluster manually (for example if you have an error due to an internet interruption), you find in the information Matlab gave you $ISSM_DIR/execution/LAUNCHSTRING/JOBNAME.lock, you copy the LAUNCHSTRING and you type in Matlab:

md=loadresultsfromcluster(md,'LAUNCHSTRING','JOBNAME');

Obs.: in the case where md.settings.waitonlock>0 and you need to load manually (e.g., internet interruption), it is necessary to set md.private.runtimename=LAUNCHSTRING; before calling loadresultsfromcluster.

Other notes about running on Discovery

If you want to use more than one node (not recommended), the current (temporary) solution is to:
1) start the job
2) go to Discovery and see which nodes discovery is using (see squeue usage below)
3) cancel the job (see scancel usage below)
4) find the .queue script for your run and manually edit the start of the mpirun command to look like:

mpirun -n 40 --hosts $NODELIST

where $NODELIST is the list of nodes separated by commas (e.g., q03,q09).
5) restart your run with:

sbatch <filename>.queue

If you do not do this, then your job will run on just one node.

To get more information about your job while it's running, from Discovery you can ssh into 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

If your job is in the queue for a long time, there may be several reasons for this. 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 can be found here: http://slurm.schedmd.com/rosetta.pdf

An overview of slurm is found here: https://services.dartmouth.edu/TDClient/1806/Portal/KB/ArticleDet?ID=132625

Useful commands:

Get number of idle nodes:

sinfo --states=idle

See jobs of <username>:

squeue -u <username>

Get more information on jobs of user:

sacct -u <username> --format=User,JobID,account,Timelimit,elapsed,ReqMem,MaxRss,ExitCode

MITgcm

Instructions to install MITgcm coming soon...

Note: See TracWiki for help on using the wiki.