Changes between Version 1 and Version 2 of docker


Ignore:
Timestamp:
11/16/20 13:32:49 (4 years ago)
Author:
downs
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • docker

    v1 v2  
    1 == Download Docker ==
     1== Install ISSM on Docker ==
    22
    3  - do this
    4  - do that
     3
     4= Installing Matlab on Docker =
     5
     6You can add the following lines to `~/.ssh/config` on your local machine if you are running ISSM from outside campus:
     7{{{
     8#!sh
     9Host camhpc darwin login.hpc.cam.ac.uk
     10  HostName login.hpc.cam.ac.uk
     11  User YOURHPCUSERNAME
     12  ProxyCommand ssh YOURUSERNAME@citadel.ch.cam.ac.uk nc %h %p 2> /dev/null
     13  HostKeyAlias login.hpc.cam.ac.uk
     14}}}
     15If you can ssh to hpc directly (from campus), you don't need to go through citadel and you can log in directly:
     16{{{
     17#!sh
     18Host camhpc darwin login.hpc.cam.ac.uk
     19  HostName login.hpc.cam.ac.uk
     20  User YOURHPCUSERNAME
     21}}}
     22and replace `YOURHPCUSERNAME` by your hpc username.
     23
     24Once this is done, you can ssh to HPC by simply doing:
     25
     26{{{
     27#!sh
     28ssh camhpc
     29}}}
     30
     31== Password-less ssh ==
     32
     33Once you have the account, you can setup a public key authentification in order to avoid having to input your password for each run.
     34You 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):
     35{{{
     36#!sh
     37$your_localhost% ssh-keygen -t rsa
     38Generating public/private rsa key pair.
     39Enter file in which to save the key (/Users/username/.ssh/id_rsa):RETURN
     40Enter passphrase (empty for no passphrase):RETURN
     41Enter same passphrase again:RETURN
     42Your identification has been saved in /Users/username/.ssh/id_rsa.
     43Your public key has been saved in /Users/username/.ssh/id_rsa.pub.
     44}}}
     45
     46Two 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 hoc account:
     47
     48{{{
     49#!sh
     50$your_localhost%scp ~/.ssh/id_rsa.pub username@your_remotehost:~
     51}}}
     52
     53Now on '''HPC''', copy the content of id_rsa.pub:
     54
     55{{{
     56#!sh
     57$your_remotehost%cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
     58$your_remotehost%rm ~/id_rsa.pub
     59}}}
     60
     61== Environment ==
     62
     63On HPC, add the following lines to `~/.bashrc`:
     64{{{
     65#!sh
     66export ISSM_DIR=PATHTOTRUNK
     67source $ISSM_DIR/etc/environment.sh
     68module load petsc/3.6.4
     69}}}
     70
     71''Log out and log back in'' to apply this change.
     72
     73== Installing ISSM on HPC  ==
     74
     75HPC 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:
     76 - automake (the one provided by default is too old)
     77 - m1qn3
     78
     79Use the following configuration script (adapt to your needs):
     80
     81{{{
     82#!sh
     83./configure \
     84   --prefix=$ISSM_DIR \
     85   --with-wrappers=no \
     86   --with-kml=no \
     87   --with-bamg=no \
     88   --with-metis-dir="/usr/local/Cluster-Apps/petsc/3.6.4/intel12.1-impi/" \
     89   --with-petsc-dir="/usr/local/Cluster-Apps/petsc/3.6.4/intel12.1-impi/" \
     90   --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \
     91   --with-mpi-include="/usr/local/Cluster-Apps/intel/impi/4.1.3.045/include64/" \
     92   --with-mpi-libflags="-L/usr/local/Cluster-Apps/intel/impi/4.1.3.045/lib64 -lmpi" \
     93   --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" \
     94   --with-mumps-dir="/usr/local/Cluster-Apps/petsc/3.6.4/intel12.1-impi/" \
     95   --with-cxxoptflags="-DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX "
     96}}}
     97== camhpc_settings.m ==
     98
     99You have to add a file in `$ISSM_DIR/src/m` entitled `camhpc_settings.m` with your personal settings:
     100
     101{{{
     102#!m
     103cluster.login='nsa12';
     104cluster.partition='sandybridge';
     105cluster.project='ARNOLD-SL3';
     106cluster.port=0;
     107cluster.codepath='/home/nsa12/trunk-jpl/bin';
     108cluster.executionpath='/home/nsa12/trunk-jpl/execution/';
     109cluster.numnodes=1;
     110cluster.cpuspernode=3;
     111cluster.time=2;
     112}}}
     113
     114use 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()`
     115
     116== Running jobs on HPC ==
     117
     118On 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:
     119
     120 {{{
     121#!m
     122md.cluster=camhpc('numnodes',1,'cpuspernode',8);
     123md.cluster.time=10;
     124}}}
     125
     126to 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.
     127
     128Now if you want to check the status of your job and the queue you are using, type in:
     129
     130 {{{
     131#!sh
     132squeue -u username
     133}}}
     134
     135You can delete your job manually by typing:
     136
     137{{{
     138#!sh
     139scancel JOBID
     140}}}
     141
     142where 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.
     143
     144If 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:
     145
     146{{{
     147#!m
     148md=loadresultsfromcluster(md,'LAUNCHSTRING');
     149}}}