Changes between Version 2 and Version 3 of camhpc


Ignore:
Timestamp:
10/19/16 13:10:38 (8 years ago)
Author:
Mathieu Morlighem
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • camhpc

    v2 v3  
     1== Getting an account ==
    12
    2 ~/.ssh/config
     3Talk to Neil...
    34
    4 Do the rss key thing on both citadel and login.hpc.cam.ac.uk
     5== ssh configuration ==
    56
    6 From outside campus:
    7 
     7You can add the following lines to `~/.ssh/config` on your local machine if you are running ISSM from outside campus:
     8{{{
     9#!sh
    810Host camhpc darwin login.hpc.cam.ac.uk
    911  HostName login.hpc.cam.ac.uk
    10   User nsa12
    11   ProxyCommand ssh nsa12@citadel.ch.cam.ac.uk nc %h %p 2> /dev/null
     12  User YOURHPCUSERNAME
     13  ProxyCommand ssh YOURUSERNAME@citadel.ch.cam.ac.uk nc %h %p 2> /dev/null
    1214  HostKeyAlias login.hpc.cam.ac.uk
    13 
    14 from campus:
    15 
     15}}}
     16If you can ssh to hoc directly (from campus), you don't need to go through citadel and you can log in directly:
     17{{{
     18#!sh
    1619Host camhpc darwin login.hpc.cam.ac.uk
    1720  HostName login.hpc.cam.ac.uk
    18   User nsa12
     21  User YOURHPCUSERNAME
     22}}}
     23and replace `YOURHPCUSERNAME` by your hoc username.
    1924
     25Once this is done, you can ssh to HPC by simply doing:
     26
     27{{{
     28#!sh
     29ssh camhpc
     30}}}
     31
     32== Password-less ssh ==
     33
     34Once you have the account, you can setup a public key authentification in order to avoid having to input your password for each run.
     35You need to have a SSH public/private key pair. If you already have one, you can skip their creation described below. 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):
     36{{{
     37#!sh
     38$your_localhost% ssh-keygen -t rsa
     39Generating public/private rsa key pair.
     40Enter file in which to save the key (/Users/username/.ssh/id_rsa):RETURN
     41Enter passphrase (empty for no passphrase):RETURN
     42Enter same passphrase again:RETURN
     43Your identification has been saved in /Users/username/.ssh/id_rsa.
     44Your public key has been saved in /Users/username/.ssh/id_rsa.pub.
     45}}}
     46
     47Two 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 greenplanet account:
     48
     49{{{
     50#!sh
     51$your_localhost%scp ~/.ssh/id_rsa.pub username@your_remotehost:~
     52}}}
     53
     54Now on '''Greenplanet''', copy the content of id_rsa.pub:
     55
     56{{{
     57#!sh
     58$your_remotehost%cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
     59$your_remotehost%rm ~/id_rsa.pub
     60}}}
     61
     62== Environment ==
     63
     64On HPC, add the following lines to `~/.bashrc`:
     65{{{
     66#!sh
     67export ISSM_DIR=PATHTOTRUNK
     68source $ISSM_DIR/etc/environment.sh
     69module load petsc/3.6.4
     70}}}
     71
     72''Log out and log back in'' to apply this change.
     73
     74== Installing ISSM on Greenplanet ==
     75
     76Greenplanet will ''only'' be used to run the code, you will use your local machine for pre and post processing, you will never use Greenplanet's matlab. You can check out ISSM and install the following packages:
     77 - automake (the one provided by default is too old)
     78 - m1qn3
     79
     80Use the following configuration script (adapt to your needs):
     81
     82{{{
     83#!sh
     84./configure \
     85   --prefix=$ISSM_DIR \
     86   --with-wrappers=no \
     87   --with-kml=no \
     88   --with-bamg=no \
     89   --with-metis-dir="/usr/local/Cluster-Apps/petsc/3.6.4/intel12.1-impi/" \
     90   --with-petsc-dir="/usr/local/Cluster-Apps/petsc/3.6.4/intel12.1-impi/" \
     91   --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \
     92   --with-mpi-include="/usr/local/Cluster-Apps/intel/impi/4.1.3.045/include64/" \
     93   --with-mpi-libflags="-L/usr/local/Cluster-Apps/intel/impi/4.1.3.045/lib64 -lmpi" \
     94   --with-mkl-libflags="-L/usr/local/Cluster-Apps/intel/mkl/10.3.10.319/composer_xe_2011_sp1.10.319/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm" \
     95   --with-mumps-dir="/usr/local/Cluster-Apps/petsc/3.6.4/intel12.1-impi/" \
     96   --with-cxxoptflags="-DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX "
     97}}}
     98== camhpc_settings.m ==
     99
     100You have to add a file in `$ISSM_DIR/src/m` entitled `camhpc_settings.m` with your personal settings:
     101
     102{{{
     103#!m
     104cluster.login='nsa12';
     105cluster.partition='sandybridge';
     106cluster.project='ARNOLD-SL3';
     107cluster.port=0;
     108cluster.codepath='/home/nsa12/trunk-jpl/bin';
     109cluster.executionpath='/home/nsa12/trunk-jpl/execution/';
     110cluster.numnodes=1;
     111cluster.cpuspernode=3;
     112cluster.time=2;
     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=camhpc()`
     116
     117== Running jobs on HPC ==
     118
     119On HPC, you can use up to XX cores per node. The more nodes and the longer the requested time, the more you will have to wait in the queue. Per job you can only request up to XXXGB of RAM. So choose your settings wisely:
     120
     121 {{{
     122#!m
     123md.cluster=camhpc('numnodes',1,'cpuspernode',8);
     124md.cluster.time=10;
     125}}}
     126
     127to have a maximum job time of 10 minutes and 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.
     128
     129Now if you want to check the status of your job and the queue you are using, type in:
     130
     131 {{{
     132#!sh
     133squeue -u username
     134}}}
     135
     136You can delete your job manually by typing:
     137
     138{{{
     139#!sh
     140scancel JOBID
     141}}}
     142
     143where 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.
     144
     145If 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 `$ISSM_DIR/execution/LAUNCHSTRING/JOBNAME.lock `, you copy the LAUNCHSTRING and you type in Matlab:
     146
     147{{{
     148#!m
     149md=loadresultsfromcluster(md,'LAUNCHSTRING');
     150}}}
     151
     152== slurm ==
     153
     154A comparision of PBS to slurm commands can be found here: http://slurm.schedmd.com/rosetta.pdf
     155
     156Useful commands:
     157
     158Graphical overview over greenplanet usage:
     159{{{
     160sview
     161}}}
     162
     163Get number of idle nodes:
     164{{{
     165sinfo --states=idle
     166}}}
     167
     168See jobs of <username>:
     169{{{
     170squeue -u <username>
     171}}}
     172
     173Get more information on jobs of user:
     174{{{
     175sacct -u <username> --format=User,JobID,account,Timelimit,elapsed,ReqMem,MaxRss,ExitCode
     176}}}
     177
     178Get information on partition (here c6145):
     179{{{
     180scontrol show partition=c6145
     181}}}
     182
     183Get sorted list of users on partition:
     184{{{
     185squeue  | grep -i c6145 | awk '{print $4}' | sort | uniq -c | sort -rn
     186}}}