Version 4 (modified by 4 years ago) ( diff ) | ,
---|
ssh configuration
You can add the following lines to ~/.ssh/config
on your local machine:
Host gscc login.gscc.umt.edu HostName login.gscc.umt.edu User USERNAME HostKeyAlias login.gscc.umt.edu HostbasedAuthentication no
and replace USERNAME
by your gscc username.
Once this is done, you can ssh gscc by simply doing:
ssh gscc
Password-less ssh
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 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):
$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 gscc account:
$your_localhost%scp ~/.ssh/id_rsa.pub username@your_remotehost:~
Now on gscc, copy the content of id_rsa.pub:
$your_remotehost%cat ~/id_rsa.pub >> ~/.ssh/authorized_keys $your_remotehost%rm ~/id_rsa.pub
Install
Install Anaconda
We will install ISSM within an Anaconda environment on GSCC. To install Anaconda3 run
wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh chmod 755 Anaconda3-2020.11-Linux-x86_64.sh ./Anaconda3-2020.11-Linux-x86_64.sh
Answer no at the final prompt. Activate Anaconda by typing.
source ~/anaconda3/bin/activate
Setup Anaconda3 environment
Now we'll set up an Anaconda environment called issm. Create a file on GSCC called environment.yml. Copy the following contents:
name: issm channels: - conda-forge - dbanas dependencies: - python=3.7 - gcc_linux-64 - gxx_linux-64 - fortran-compiler - petsc=3.12 - numpy - scipy - matplotlib - cmake - libtool - lapack - netcdf4 - triangle - chaco - mpi
With Anacodna activated, run
conda env create -f environment.yml
Install ISSM
Copy ISSM files on your home directory on GSCC, add the following lines to your ~/.bashrc
on GSCC:
module unload rocks-openmpi export ISSM_DIR=/home/USERNAME/trunk-jpl/ export CONDA_DIR=/home/USERNAME/anaconda3/envs/test/ source $ISSM_DIR/etc/environment.sh
Create a file called environment.yml with the following contents:
Make sure that Anaconda is activated and do
Installing ISSM on Greenplanet
Greenplanet 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:
- autotools (the one provided by default is too old)
- PETSc 3.14
- m1qn3
Use the following configuration script (adapt to your needs):
./configure \ --prefix=$ISSM_DIR \ --with-wrappers=no \ --with-kriging=no \ --with-kml=no \ --with-bamg=no \ --without-Love \ --with-metis-dir="$ISSM_DIR/externalpackages/petsc/install" \ --with-petsc-dir="$ISSM_DIR/externalpackages/petsc/install" \ --with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \ --with-mpi-include="/sopt/OpenMPI/3.1.2/intel-2018.3-slim/include" \ --with-mpi-libflags="-L/sopt/OpenMPI/3.1.2/intel-2018.3-slim/lib -lmpi -lm -lmpi_mpifh" \ --with-mkl-libflags="-L/sopt/MKL/2018.3/lib -mkl=cluster" \ --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \ --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \ --with-cxxoptflags="-O3 -fPIC -std=c++11" \ --with-vendor=intel-gp
greenplanet_settings.m
You have to add a file in $ISSM_DIR/src/m
entitled greenplanet_settings.m
with your personal settings:
cluster.login='morlighem'; cluster.queue='ilg2.3'; cluster.port=''; cluster.codepath='/DFS-B/DATA/morlighem/trunk-jpl/bin/'; cluster.executionpath='/DFS-B/DATA/morlighem/trunk-jpl/execution/';
Use your username for the login
and enter your codepath
and executionpath
. These settings will be picked up automatically by Matlab when you do md.cluster=greenplanet()
Running jobs on Greenplanet
On Greenplanet, you can use up to 30 cores per node (partition ilg2.3
). 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 125GB of RAM. So choose your settings wisely:
md.cluster=greenplanet('numnodes',1,'cpuspernode',8); md.cluster.time=10;
to 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.
Now if you want to check the status of your job and the queue you are using, type in the bash on Greenplanet 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
Useful commands:
Graphical overview over greenplanet usage:
sview
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
Get information on partition (here ilg2.3):
scontrol show partition=ilg2.3
Get sorted list of users on partition:
squeue | grep -i ilg2.3 | awk '{print $4}' | sort | uniq -c | sort -rn