GreenPlanet (UCI)

Table of Contents

  1. Getting an Account
  2. SSH Configuration
    1. Password-less SSH
  3. Environment
  4. Installing ISSM on GreenPlanet
  5. Cluster Class Settings
  6. Running Jobs on GreenPlanet
  7. slurm

Getting an Account

Request an account on GreenPlanet.

SSH Configuration

Add the following lines to ~/.ssh/config on your local machine,

Host gp greenplanet gplogin1.ps.uci.edu gplogin2.ps.uci.edu
    HostName gplogin1.ps.uci.edu
    User <USERNAME>
    HostKeyAlias gplogin1.ps.uci.edu
    HostbasedAuthentication no

replacing <USERNAME> with your GreenPlanet username. Then, you can ssh to GreenPlanet with,

ssh gp

Note

gplogin2.ps.uci.edu is preferred over gplogin1.ps.uci.edu (gplogin2 is faster, has 48 cores, new nodes, and allows to access the DFS-B disk which features faster I/O). Ideally, submit jobs on ilg2.3. Full list of partitions on GreenPlanet.

Password-less SSH

You can setup public key authentication in order to avoid having to input your password all the time you log onto GreenPlanet. You need an SSH public/private key pair on your local machine. If you do not have one, you can create one by executing the following command on your local machine (no passphrase necessary; press Enter at each prompt to accept the defaults),

localhost$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
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 are created:

  • your private key /Users/username/.ssh/id_rsa, and
  • the public key /Users/username/.ssh/id_rsa.pub.

The private key must be kept private and never shared — keep its file permissions restricted (600). The contents of the public key need to be copied to ~/.ssh/authorized_keys on the remote machine,

localhost$ scp ~/.ssh/id_rsa.pub username@remotehost:~

Now, log onto GreenPlanet and add the content of id_rsa.pub to ~/.ssh/authorized_keys,

remotehost$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
remotehost$ rm ~/id_rsa.pub

If you get an error message about /home/username/.ssh/authorized_keys: No such file or directory, you may need to create a .ssh directory first,

remotehost$ mkdir ~/.ssh
remotehost$ chmod 700 ~/.ssh

Environment

On GreenPlanet, add the following lines to ~/.bashrc,

# Load modules
ml intel/2018.3 openmpi/3.1.2-slim

# ISSM
export ISSM_DIR=<PATH_TO_ISSM>
source $ISSM_DIR/etc/environment.sh

replacing <PATH_TO_ISSM> with the path to the directory that you cloned the ISSM source code repository to. Then, run,

source ~/.bashrc

or log out and log back in to apply this change.

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’ Python.

Clone the ISSM source code repository on GitHub and install the following packages:

  • autotools
  • petsc
  • m1qn3

Follow the detailed instructions for compiling ISSM on Linux, and use the following configuration script (adapt to your needs),

#!/bin/sh

export CXXFLAGS="-O3 -fPIC -std=c++11"

./configure \
    --prefix="${ISSM_DIR}" \
    --with-wrappers=no \
    --with-vendor=intel-gp \
    --with-kriging=no \
    --with-kml=no \
    --with-bamg=no \
    --without-Love \
    --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-metis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
    --with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
    --with-m1qn3-dir="${ISSM_DIR}/externalpackages/m1qn3/install" \
    --with-mumps-dir="${ISSM_DIR}/externalpackages/petsc/install" \
    --with-scalapack-dir="${ISSM_DIR}/externalpackages/petsc/install"

Cluster Class Settings

In order to connect to GreenPlanet from the machine that you are doing model setup and results analysis on, you will need to create a cluster class settings file for your chosen scripting interface.

Create $ISSM_DIR/src/m/greenplanet_settings.m, which might include,

cluster.login='<USERNAME>';
cluster.queue='ilg2.3';
cluster.port='';
cluster.codepath='<PATH_TO_ISSM_ON_CLUSTER>/bin/';
cluster.executionpath='<PATH_TO_ISSM_ON_CLUSTER>/execution/';

Cluster class greenplanet.py still needs to be developed.

replacing <USERNAME> with your GreenPlanet username and entering your code path and execution path. These settings will be picked up automatically when you run md.cluster=greenplanet().

Running Jobs on GreenPlanet

On GreenPlanet, you can use up to 30 cores per node and up to 125GB of RAM per job (partition ilg2.3). The more nodes and the longer the requested time, the more you will have to wait in the queue, so choose your settings accordingly. For example,

md.cluster=greenplanet('numnodes',1,'cpuspernode',8);
md.cluster.time=10;

Cluster class greenplanet.py still needs to be developed.

will request 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.

If you want to check the status of your job and the queue that you are using, run,

squeue -u username

You can delete your job manually by typing,

scancel JOBID

where <JOB_ID> is the job ID reported on your local machine when you submitted your solution request. Also reported is the directory where you can find log files associated with the run (i.e. <JOB_ID>.outlog and <JOB_ID>.errlog). The outlog contains the information that would normally be printed to the console if you were running the job on your local machine. Likewise, the errlog contains any information printed in case of error.

If you would like to load results from the cluster manually (for example, if you encountered an error due to network disconnection), run,

md=loadresultsfromcluster(md,'runtimename','<EXEC_DIR>');

where <EXEC_DIR> is the parent of the job on your local machine, for example,

${ISSM_DIR}/execution/<EXEC_DIR>/<JOB_ID>.lock

Note

In the case where md.settings.waitonlock > 0 and you need to load manually (e.g., connection interruption), it is necessary to set md.private.runtimename=<LAUNCHSTRING>; before calling loadresultsfromcluster.

slurm

A comparison of PBS to slurm commands.

Useful commands:

  • Graphical overview over GreenPlanet usage,
    sview
    
  • Get number of idle nodes,
    sinfo --states=idle
    
  • See a user’s jobs,
    squeue -u <USERNAME>
    
  • Get more information on a user’s jobs,
    sacct -u <USERNAME> format=User,JobID,account,Timelimit,elapsed,ReqMem,MaxRss,ExitCode
    
  • Get information on partition (for example, 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