Changes between Initial Version and Version 1 of discovery


Ignore:
Timestamp:
08/18/21 10:56:33 (4 years ago)
Author:
Mathieu Morlighem
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • discovery

    v1 v1  
     1== Getting an account ==
     2
     3Go to [https://rc.dartmouth.edu/index.php/discoveryhpc/], you will need a Dartmouth NetID.
     4
     5== ssh configuration ==
     6
     7You can add the following lines to `~/.ssh/config` on your local machine:
     8{{{
     9#!sh
     10Host hpc hpc.oit.uci.edu
     11  HostName hpc.oit.uci.edu
     12  User YOURHPCUSERNAME
     13  HostKeyAlias hpc.uci.edu
     14  HostbasedAuthentication no
     15}}}
     16and replace `YOURHPCUSERNAME` by your hpc username.
     17
     18Once this is done, you can ssh hpc by simply doing:
     19
     20{{{
     21#!sh
     22ssh hpc
     23}}}
     24
     25== Password-less ssh ==
     26
     27Once you have the account, you can setup a public key authentification in order to avoid having to input your password for each run.
     28You 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):
     29{{{
     30#!sh
     31$your_localhost% ssh-keygen -t rsa
     32Generating public/private rsa key pair.
     33Enter file in which to save the key (/Users/username/.ssh/id_rsa):RETURN
     34Enter passphrase (empty for no passphrase):RETURN
     35Enter same passphrase again:RETURN
     36Your identification has been saved in /Users/username/.ssh/id_rsa.
     37Your public key has been saved in /Users/username/.ssh/id_rsa.pub.
     38}}}
     39
     40Two 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 hpc account:
     41
     42{{{
     43#!sh
     44$your_localhost%scp ~/.ssh/id_rsa.pub username@your_remotehost:~
     45}}}
     46
     47Now on '''hpc''', copy the content of id_rsa.pub:
     48
     49{{{
     50#!sh
     51$your_remotehost%cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
     52$your_remotehost%rm ~/id_rsa.pub
     53}}}
     54
     55== Environment ==
     56
     57On hpc, add the following lines to `~/.bashrc`:
     58{{{
     59#!sh
     60export ISSM_DIR=PATHTOTRUNK
     61source $ISSM_DIR/etc/environment.sh
     62module purge
     63module load intel-compilers/19.3
     64module load mpich/3.3.0-intel19.3
     65module load mkl/19.3
     66module load cmake/3.10.1
     67}}}
     68
     69''Log out and log back in'' to apply this change.
     70
     71== Installing ISSM on hpc ==
     72
     73hpc will ''only'' be used to run the code, you will use your local machine for pre and post processing, you will never use hpc's matlab. You can check out ISSM and install the following packages:
     74 - autotools
     75 - PETSc 3.15 (use the discovery script)
     76 - m1qn3
     77
     78Use the following configuration script (adapt to your needs):
     79
     80{{{
     81#!sh
     82./configure \
     83 --prefix=$ISSM_DIR \
     84 --with-wrappers=no \
     85 --with-kml=no \
     86 --with-bamg=no \
     87 --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
     88 --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
     89 --with-m1qn3-dir=$ISSM_DIR/externalpackages/m1qn3/install \
     90 --with-mpi-include="/data/apps/mpi/openmpi-1.8.3/gcc/4.8.3/include" \
     91 --with-mpi-libflags="-L/data/apps/mpi/openmpi-1.8.3/gcc/4.8.3/lib -lmpi_cxx -lmpi -lmpi_usempi" \
     92 --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
     93 --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     94 --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
     95 --with-numthreads=16 \
     96 --with-fortran-lib="-L/data/apps/gcc/4.7.3/lib64 -lgfortran" \
     97 --enable-debugging \
     98 --enable-development
     99}}}
     100== hpc_settings.m ==
     101
     102HPC staff ask that no "serious work" should be done on your home directory, you should create an execution directory as `/pub/$USERNAME/execution`.
     103
     104You have to add a file in `$ISSM_DIR/src/m` entitled `hpc_settings.m` with your personal settings on your local ism install:
     105
     106{{{
     107#!m
     108cluster.login='mmorligh';
     109cluster.port=8000;
     110cluster.queue='pub64';
     111cluster.codepath='/data/users/mmorligh/trunk-jpl/bin/';
     112cluster.executionpath='/data/users/mmorligh/trunk-jpl/execution/';
     113}}}
     114
     115use your username 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=hpc()`
     116
     117== Running jobs on hpc  ==
     118
     119On hpc, 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:
     120
     121 {{{
     122#!m
     123md.cluster=hpc('numnodes',1,'cpuspernode',8);
     124}}}
     125
     126The list of available queues is `'pub64','free64','free48','free*,pub64'` and `'free*'`.
     127
     128to have a job of 8 cores on one node. If the run lasts longer than 10 minutes, it will be killed and you will not be able to retrieve your results.
     129
     130Now if you want to check the status of your job and the queue you are using, type in the bash with the hpc session:
     131
     132 {{{
     133#!sh
     134qstat -u USERNAME
     135}}}
     136
     137You can delete your job manually by typing:
     138
     139{{{
     140#!sh
     141qdel JOBID
     142}}}
     143
     144where 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 informations 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.
     145
     146If 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 informations Matlab gave you `/home/srebuffi/trunk-jpl/execution//SOMETHING/JOBNAME.lock `, you copy the SOMETHING and you type in Matlab:
     147
     148{{{
     149#!m
     150md=loadresultsfromcluster(md,'SOMETHING');
     151}}}