wiki:discovery

Version 8 (modified by Mathieu Morlighem, 22 months ago) ( diff )

--

Getting an account

Go to https://rc.dartmouth.edu/index.php/discoveryhpc/, you will need a Dartmouth NetID.

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.

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.


The following might not be necessary

Once you have the account, you can setup a public key authentification in order to avoid having to input your password for each run. You need to have a SSH public/private key pair. If you do not, you can create a SSH public/private key pair by typing the following command and following the prompts (no passphrase necessary):

$your_localhost% ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa):RETURN
Enter passphrase (empty for no passphrase):RETURN
Enter same passphrase again:RETURN
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 were created: your private key /Users/username/.ssh/id_rsa, and the public key /Users/username/.ssh/id_rsa.pub. The private key is read-only and only for you, it is used to decrypt all correspondence encrypted with the public key. The contents of the public key need to be copied to ~/.ssh/authorized_keys on your Discovery account:

$your_localhost%scp ~/.ssh/id_rsa.pub username@your_remotehost:~

Now on Discovery, copy the content of id_rsa.pub:

$your_remotehost%cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
$your_remotehost%rm ~/id_rsa.pub

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.15 (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 -O3 -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

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

There is no specific time limit on Discovery, however, jobs longer than 10 hours may need credential to DartFS system. 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 queue 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.

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.