Quick viewing(Text Mode)

Introduction to High Performance Computing at Case Western Reserve University

Introduction to High Performance Computing at Case Western Reserve University

Introduction to High Performance Computing at Case Western Reserve University

! Research Computing and CyberInfrastructure team

! Presenters Emily Dragowsky Daniel Balagué Guardia Hadrian Djohari KSL Data Center Sanjaya Gajurel Bootcamp Outline

Who we are Case HPC resources Working with the Cluster Basic Job Scripting Open Discussion/Q&A Who we are

• Research Computing and 5th floor, around back CyberInfrastructure Team from the elevators • [U]TECH • University Staff, academic ties • CWRU grads • Research group members • Skilled practitioners • Strong collaboration with Network, Servers and Storage teams RCCI Training

Sessions - Spring 2018 • 2/6/18 - Advancing with Software Installation • 2/20/18 - Working with Data Transfer • 3/6/18 - Exploring Amazon Web Services for Researchers • 3/21/18 - Advancing with the Linux Shell • 4/3/18 - Advancing with Matlab Toepfer Room, Adelbert Hall, 2nd floor RCCI Services Cyberinfrastructure Support • High Performance • Education and Awareness Computing • Consultation and Award Pre-support • Research Networking services • Database Design • Research Storage and • Visualization Archival solutions • Secure Research • Programming Services Environment for computing • Concierge for off-premise services on regulated data (XSEDE,OSC,AWS) • Public Cloud and Off- Premise Services CASE HPC Cluster • Designed for computationally intensive jobs • long-running, number crunching • Optimized for batch jobs • combine resources as needed (cpu, memory, gnu) • Supports interactive/graphically intensive jobs • OS version emphasizes stability • Linux (Red Hat Enterprise Linux 7.4) • Accessible from Linux, Mac and Windows • Some level of Linux expertise is needed - why we’re here today! • Clusters: redcat (slurm), and hadoop HPC Cluster Glossary • Head Nodes: Development, Analysis, Job Submission • Compute Nodes: Computational Computers • Panasas: Engineered File System, fastest storage • DELL Fluid File System: “Value” storage • Data Transfer Nodes: hpctransfer, dtn1 • Science DMZ: lowest “resistance” Data Pathway • SLURM: Cluster workload manager & Scheduler) HPC Cluster Components Resource Manager

redcat.case.edu

! Science Admin DMZ Nodes Dell FFS Storage Head Nodes SLURM Master

Data Transfer Nodes Panasas Storage

Batch nodes GPU nodes SMP nodes HPC Cluster Components Resource Manager

! redcat.case.edu University ! Firewall Science Admin DMZ Nodes Dell FFS Storage Head Nodes SLURM Master

Data Transfer Nodes Panasas Storage

Batch nodes GPU nodes SMP nodes Working on the Cluster How To: ~ access the cluster ~ get my data onto the cluster ~ establish interactive sessions ~ submit jobs through the scheduler ~ monitor jobs • a.k.a. why is my job not running!?!?! • work with others within the cluster Access the Cluster You can login from anywhere You will need: • An approved cluster account • Enter your CaseID and the Single Sign-On password • ssh (secure shell) utility [detailed instructions for all platforms]! • We recommend x2go-client • Putty or cygwin (Windows), Terminal (Mac/Linux) will work for non-graphical output sessions.

! If Off-campus Location,! then Connect through VPN, using two-factor authentication Case Guest wireless == “of-campus” Access the Cluster Access the Cluster

Owner Group

Permissions { Working within Group Allocations - I • What are linux groups? • Manage affiliations in the multiuser environment • Set “in-between” permissions • Groups are administered — contact [email protected] • Switching the active group: “newgrp - ” [mrd20@hpc3 ~] groups tas35 oscsys gaussian hpcadmin schrodinger ccm4 singularity [mrd20@hpc3 ~] newgrp - hpcadmin [mrd20@hpc3 ~] groups hpcadmin oscsys gaussian tas35 schrodinger ccm4 singularity Active Linux group affects group ownership of new files Access the Cluster Graphically w/ x2goclient Transfer Data scp command scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2

• Copy from HPC to your local PC • scp -r [email protected]:/home/mrd20/data/vLOS.dat . • ‘.’ — full stop means ‘this directory’ • From your PC to HPC • scp orange.py mrd20@redcat:! • ‘:’ — colon denotes hostname Transfer Data Globus

Setup Instructions: https://sites.google.com/a/case.edu/hpc-upgraded-cluster/ home/important-notes-for-new-users/transferring-files HPC Environment Your Full Cluster Resources

Your HPC account, sponsored by your PI, provides: ! •Group afliation — resources shared amongst group members •Storage •/home — permanent storage, replicated & “snapshot” protected •/scratch/pbsjobs — up to 1 TB temporary storage •/scratch/users — small-scale temporary storage ➡ exceeding quota(s) will prevent using account!! ! •Cores: member groups allocation of 32+ for an “8-share” • Wall-time: 320-hour limit for member shares (32 hours for guest shares) HPC Environment Your /home

• Allocated storage space in the HPC filesystem for your work • Create subdirectories underneath your /home/CaseID, ideally each job has its own subdirectory ! cd — linux command to change the current directory examples to change to “home” ‣ cd /home/ ‣ cd ~ ‣ cd $HOME ! $HOME is an environment variable that points to /home/ HPC Environment Beyond /home

Linux systems have hierarchical directory structure User files: /home System files: /bin, /dev, /etc, /log, /opt, /var Application files: /usr/local// ! ! Consider Python: 4 versions installed ‣ /bin/python — 2.6.6 ‣ /usr/local/python/ ‣ 2.7.8 ‣ 2.7.10 ‣ 3.5.2 Module Hierarchies HPC Environment: Environment Variables on Rider

Keeping organized ! ‣ echo $PATH /usr/local/intel-17/openmpi/2.0.1/bin:/usr/local/intel/17/compilers_and_libraries_2017/linux/bin/intel64:/ usr/lib64/-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/dell/srvadmin/bin! ! ‣ echo $LD_LIBRARY_PATH /usr/local/intel-17/openmpi/2.0.1/lib:/usr/local/intel/17/tbb/lib/intel64/gcc4.7:/usr/local/intel/17/ compilers_and_libraries_2017/linux/mkl/lib/intel64:/usr/local/intel/17/compilers_and_libraries_2017/ linux/lib/intel64::/usr/local/lib

Changes: slurm commands in /usr/bin —> no longer referenced in the PATH, etc Modules and Environment

Module command: avail, spider, list, load, unload Manage the environment necessary to run your applications (binary, libraries, shortcuts)

Modify environment variables using module commands: >>module avail & spider — learn what is available and how to load it >>module list (shows modules loaded in your environment) >>module load python (loads default version) >>module load python/3.5.1 (loads specific version) >>module unload python/3.5.1 (unloads specific version) ------Modules and Environment

On Rider, you might need to load a particular version of a compiler and OpenMPI in order to find your module. ! Command Rider Shows the list of the current loadable modules of a module avail hierarchy. It also shows, visually, which modules are loaded.

module spider Shows the list of all modules and description.

Shows the list of all modules and description, module spider including instructions on how to load module. Modules and Environment

On Rider, you might need to load a particular version of a compiler and OpenMPI in order to find your module. !

Command Rider Redcat Shows the list of the current Shows the list of all installed loadable modules of a modules and versions (almost module avail hierarchy. It also shows, all modules are loadable as a visually, which modules are result of the plain system). loaded. loaded. Shows the list of all modules module spider Shows the list of all modules. and how to load them. Modules and Environment Redcat

Linux uses branching directory structure — independence • User files: /home • System files: /bin, /dev, /etc, /log, /opt, /var • Application files: /usr/local// ! ! Consider Python: 4 versions installed ‣ /bin/python — 2.6.6 ‣ /usr/local/python/ ‣ 2.7.8 ‣ 2.7.10 ‣ 3.5.2 — how were they compiled? Modules and Environment Rider

Lua module hierarchies — independence & accountability • Core — persistent, independent: no run-time dependence on other packages • Compilers - either intel/17 or gcc/6.3.0 • MPI - currently openmpi/2.0.1 with each compiler option ! Directory structure changes • compiler directory trees [here are the compiler files & executables] • /usr/local// • /usr/local/intel/17 • compiled packages • /usr/local/-// • /usr/local/intel-17/openmpi/2.0.1 Modules and Environment Rider

Consider Python: what versions are installed/available? ‣ Which hierarchy is active? ‘module avail’ ! ‣ which python: /bin/python — 2.7.5 ‣ /usr/local/python/ — no such file or directory - run-time dependencies ! ‣ ‘module avail python’ ‣ python/3.5.1 python2/2.7.13 spyder/3.2.0-python2 ‣ ‘module spider python’ — information about python package! ‣ python/3.5.1 ! ‣ other possible module matches: python2 Intel + OpenMPI Hierarchy

[mrd20@hpclogin ~]$ module avail ! ------/usr/local/share/modulefiles/MPI/intel/17/openmpi/2.0.1 ------amber/16-17 eigen3/3.3.4 hdf5/1.10.1 lammps/2017 (D) netcdf/4.4.1.1 python/3.5.1 relion/2.1.b1 /8.0.1 bcftools/1.5 fftw/3.3.6-pl2 imagemagick/7.0.4-10 namd/2.12-cuda neuron/7.5 python2/2.7.13 samtools/1.5 boost/1.63 grace/5.1.25 lammps/2017-gpu namd/2.12 (D) openfoam/4.1 qtgrace/0.26 spyder/3.2.0-python2 ! ------/usr/local/share/modulefiles/Compiler/intel/17 ------bowtie2/2.3.2 gnuplot/4.6.2 /0.10.36 kim/1.9.1 openmpi/2.0.1 (L,D) qt/4.8.7 cmake/3.8.2 gnuplot/5.0.6 (D) gstreamer/1.10.3 (D) lapack/3.7.0 /4.9.1 qt/5.8.0 (D) ffmpeg/3.2.4 gsl/2.3 julia/0.5.1 openmpi/1.8.8 poppler-qt5/0.51.0 /2.12.4 ! ------/usr/local/share/modulefiles/Core ------MKL/17 circos/0.69-6 gatk/3.8 git/2.15.1 libgit2/0.26.0 /2.3.8 singularity/2.3.1 STAR/2.5.3a cuda/8.0 gaussian/g16-avx hisat2/2.1.0 ls-dyna/r9.1.0 pandoc/1.19.2.1 skewer/0.2.2 X11/20170521 cufflinks/2.2.1 gaussian/g16-avx2 icu/52.1 mathematica/11.2 pdsh/2.26 slurm-drmaa/1.0.7 ansys/16.1 ds3/3.5.0 gaussian/g16-sse (D) impute/2.3.2 /R2016b (D) pgi/17.10 texinfo/5.1 ansys/18.2 (D) /1.51n gaussview/gv6 intel/17 (L) matlab/R2017b picard/2.11 texlive/2016 base/8.0 flacs/10.5 gcc/6.3.0 java/8u121 maxwell/3.1 plink/1.90b3.44 tophat/2.1.1 bin2c/git freesurfer/6.0.0 gdc-client/1.3.0 king/1.4 /3.18.0 schrodinger/2017-3 vmd/1.9.3 bwa/0.7.17 fsl/5.0.10 ghostscript/9.20 king/2.1 (D) merlin/1.1.2 shapeit/v2.r837 voro++/0.4.6 ! ------/usr/local/lmod/lmod/modulefiles/Core ------StdEnv (L) lmod/7.3 settarg/7.3 ! Where: L: Module is loaded D: Default Module ! Use "module spider" to find all possible modules. Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys". Gcc + OpenMPI Hierarchy

[mrd20@hpclogin ~]$ module avail ! ------/usr/local/share/modulefiles/MPI/gcc/6.3.0/openmpi/2.0.1 ------R/3.2.5 boost/1.63.0 gromacs/2016.4 kallisto/0.43.1 ngs-bits/2018 python2/2.7.13 rstudio/1.0.153 (D) R/3.3.3 (D) caffe/1.0 hdf5/1.10.1 microsoft-r/3.3 nvcaffe/0.16.4 relion/2.1.b1 samrai/3.11.4 R/3.4.2 fftw/3.3.6-pl2 imagemagick/7.0.4-10 netcdf/4.4.1.1 /3.2.0 rstudio/1.0.136 spyder/3.2.0-python2 ! ------/usr/local/share/modulefiles/Compiler/gcc/6.3.0 ------atlas/3.10.3 eigensoft/7.2.1 gsl/2.3 lapack/3.7.0 openmpi/1.8.8 poppler-qt5/0.51.0 qt/5.8.0 (D) blas/3.7.0 ffmpeg/3.2.4 gstreamer/0.10.36 leveldb/1.20 openmpi/2.0.1 (L,D) protobuf-cpp/3.5.0 snappy/1.1.7 cmake/3.8.2 gflags/2.2.1 gstreamer/1.10.3 (D) libbsd/0.8.6 openmpi/2.1.0 qpdf/7.0.0 tensorflow/1.4.1-py2 dsi-studio/17.10 glog/0.3.5 +3/3.22.8 lmdb/0.9.21 phonon/4.9.1 qt/4.8.7 ! ------/usr/local/share/modulefiles/Core ------MKL/17 circos/0.69-6 gatk/3.8 git/2.15.1 libgit2/0.26.0 motif/2.3.8 singularity/2.3.1 STAR/2.5.3a cuda/8.0 gaussian/g16-avx hisat2/2.1.0 ls-dyna/r9.1.0 pandoc/1.19.2.1 skewer/0.2.2 X11/20170521 cufflinks/2.2.1 gaussian/g16-avx2 icu/52.1 mathematica/11.2 pdsh/2.26 slurm-drmaa/1.0.7 ansys/16.1 ds3/3.5.0 gaussian/g16-sse (D) impute/2.3.2 matlab/R2016b (D) pgi/17.10 texinfo/5.1 ansys/18.2 (D) fiji/1.51n gaussview/gv6 intel/17 matlab/R2017b picard/2.11 texlive/2016 base/8.0 flacs/10.5 gcc/6.3.0 (L) java/8u121 maxwell/3.1 plink/1.90b3.44 tophat/2.1.1 bin2c/git freesurfer/6.0.0 gdc-client/1.3.0 king/1.4 meld/3.18.0 schrodinger/2017-3 vmd/1.9.3 bwa/0.7.17 fsl/5.0.10 ghostscript/9.20 king/2.1 (D) merlin/1.1.2 shapeit/v2.r837 voro++/0.4.6 ! ------/usr/local/lmod/lmod/modulefiles/Core ------StdEnv (L) lmod/7.3 settarg/7.3 ! Where: L: Module is loaded D: Default Module ! Use "module spider" to find all possible modules. Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys". Module Hierarchy Exercise

• Establish session on Rider (ssh or x2go)

• Use module commands to view default software available HPC Resources using ‘si’

[mrd20@hpclogin ~]$ si PARTITION AVAIL_FEATURES AVA TIMELIMIT NODE STATE CPUS(A/I/O/T) NODELIST batch* dodeca96gb up 13-08:00:0 1 comp 0/24/0/24 comp225t batch* hex48gb up 13-08:00:0 1 mix 8/4/0/12 comp086t batch* octa64gb up 13-08:00:0 9 mix 97/47/0/144 comp169t,comp171t,comp172t,comp173t,comp174t,comp175t,comp177t,comp178t,comp179t batch* dodeca96gb up 13-08:00:0 38 mix 436/476/0/912 comp201t,comp202t,comp203t,comp204t,comp205t,comp206t,comp207t,comp208t,comp209t,comp210t,comp211t,comp212t,comp214t,comp215t,comp217t,comp218t,comp219t,c omp220t,comp221t,comp222t,comp223t,comp226t,comp227t,comp228t,comp229t,comp230t,comp231t,comp232t,comp233t,comp234t,comp245t,comp246t,comp247t,comp248t,co mp249t,comp250t,comp251t,comp252t batch* hex24gb up 13-08:00:0 1 alloc 12/0/0/12 comp029t batch* octa64gb up 13-08:00:0 2 alloc 32/0/0/32 comp176t,comp180t batch* dodeca96gb up 13-08:00:0 12 alloc 288/0/0/288 comp213t,comp224t,comp235t,comp236t,comp237t,comp238t,comp239t,comp240t,comp241t,comp242t,comp243t,comp244t batch* hex24gb up 13-08:00:0 3 idle 0/36/0/36 comp031t,comp050t,comp067t batch* hex48gb up 13-08:00:0 20 idle 0/240/0/240 comp081t,comp082t,comp083t,comp084t,comp085t,comp087t,comp088t,comp089t,comp090t,comp091t,comp092t,comp093t,comp094t,comp095t,comp096t,comp097t,comp098t,c omp099t,comp100t,comp110t batch* dodeca96gb up 13-08:00:0 1 idle 0/24/0/24 comp216t gpu gpup100 up 13-08:00:0 7 mix 18/122/0/140 gpu031t,gpu032t,gpu033t,gpu034t,gpu036t,gpu037t,gpu038t gpu gpup100 up 13-08:00:0 1 alloc 20/0/0/20 gpu035t gpu gpufermi up 13-08:00:0 2 idle 0/24/0/24 gpu023t,gpu024t gpu gpuk40 up 13-08:00:0 3 idle 0/60/0/60 gpu028t,gpu029t,gpu030t smp (null) up 13-08:00:0 2 mix 38/34/0/72 smp04t,smp05t smp (null) up 13-08:00:0 2 idle 0/48/0/48 smp06t,smp07t ! CPUS(A/I/O/T) 949/1139/0/2088 Processors Utilization: 45.4502% ! NODES(A/I/O/T) 74/31/0/105 Nodes Utilization: 70.4762% ! Abbreviations: A=allocated, I=idle, O=out, T=total) HPC Resources — Constraints & Features

Features specified by the [mrd20@hpclogin ~]$ si PARTITION AVAIL_FEATURES NODELIST constraints flag! batch* hex24gb comp001t — comp074t ! batch* hex48gb comp086t — comp110t batch* octa64gb comp169t — comp180t ‘-C gpup100’! batch* dodeca96gb comp201t — comp252t ‘-C dodeca96gb’! ! gpu gpufermi gpu023t,gpu024t ! gpu gpuk40 gpu028t — gpu030t Greek cardinal references! gpu gpup100 gpu031t — gpu038t ! hex: 6 ‘cores’ x 2: 12 cpu! smp (null) smp04t,smp05t octa: 8 ‘cores’, 16 cpu! smp (null) smp06t,smp07t dodeca: 12 ‘cores’, 24 cpu Running Jobs Interactive Sessions Scheduler Job submission Start an Interactive GUI Session

• Create a session on compute node, not on the head node • srun – Create a job allocation (if needed) and launch a job

! • srun --x11 [-p batch -n 4 -t 1:00:00] --pty /bin/bash • --x11 invokes X-forwarding • --pty psuedoterminal, type of shell = bash • -p partition (batch, gpufermi, gpuk40, smp) • -n nodes • -t duration of resource allocation Examples: Interactive GUI Session • Accepting the defaults • srun --x11 --pty /bin/bash

! • More tasks (default 1 cpu-per-task) • srun --x11 -p batch -n 4 -t 1:00:00 --pty /bin/bash

! • Alternate account (related to linux groups) • srun —x11 -A -p batch -n 4 -t 1:00:00 --pty /bin/bash

! • Graphically intensive session (default duration 10 hours) • srun --x11 -p gpu -C gpufermi --gres:gpu=1 -n 6 --pty /bin/bash Now Let’s Take time for… reflection… beverages…! stretching the legs… washing of hands… booking a flight… checking email… quiet contemplation… talkingwithourneighbors… Working Big on the CWRU HPC Cluster

• Many people at once • Many jobs running, and queued awaiting resources • Slurm workload manager software has three key functions: • allocates access to resources (compute nodes) to users for some duration of time so they can perform work. • Provides a framework for starting, executing, and monitoring work (normally a parallel job) on the set of allocated nodes. • Arbitrates contention for resources by managing a queue of pending work. Simple Linux Utility for Resource Management

• Slurm has three key functions. • allocates access to resources (compute nodes) to users for some duration of time so they can perform work. • Provides a framework for starting, executing, and monitoring work (normally a parallel job) on the set of allocated nodes. • Arbitrates contention for resources by managing a queue of pending work.

!39 Simple Linux Utility for Resource Management

SLURM Control SLURM Database Daemon Daemon

Accounting & Configuration records

(TCOGYQTMHQT SLURM daemons on 4GUQWTEG#NNQECVKQP compute nodes #TDKVTCVKQP Monitor Cluster Status

• Workload management for collective benefit of HPC community • sinfo – View information about Slurm nodes and partitions

! • sinfo [flags] • -n nodes by name • -o format output: sinfo -o "%10P %.3a %.10l %.4D %.8t %.14C %N" • PARTITION AVA TIMELIMIT NODE STATE CPUS(A/I/O/T) NODELIST

! • si script invoking sinfo with a set of standard flags • exercise: > less `which si`, examine bash script contents Submit a Job through the Scheduler

• Workload management for collective benefit of HPC community • sbatch – Create a resource allocation request to launch a job step

! • sbatch [-p batch -N 1 -t 2-1:00:00] script • script — a bash shell script • -p partition (batch, gpufermi, gpuk40, smp) • -N nodes • -t duration of resource allocation [dd-hh:mm:ss] • Other common flags: -A, --ntasks, --cpus-per-task, --mem-per-cpu Example Job Script! hexacarbonyl-16.slurm #!/bin/bash #SBATCH --time=30:00 #SBATCH --nodes=2 #SBATCH --ntasks=6 #SBATCH --cpus-per-task=2 #SBATCH --job-name=hexacarbonyl-16_job

# Load the Gaussian module module load gaussian/16-sse # Run Gaussian srun g16 hexacarbonyl-16.com Checking Job Status (I)

• squeue – view information about jobs in scheduling queue

! • squeue [options] • -u • -A • -l standard “long” output fields • -o select fields for output (~90 fields exist) • - -start show estimated start times for pending jobs • full documentation: slurm.schedmd.com/squeue.html Checking Job Status (II)

• scontrol – view and modify Slurm configuration and state • most functionality reserved for system administrators • scontrol [options] [commands]

! • scontrol show job • scontrol show node (refer to HPC Resource View) Working within Group Allocations - I • What are linux groups? • Manage affiliations in the multiuser environment • Set “in-between” permissions • Groups are administered — contact [email protected] • Switching the active group: “newgrp -

[mrd20@hpc3 ~] groups tas35 oscsys gaussian hpcadmin schrodinger ccm4 singularity [mrd20@hpc3 ~] newgrp - hpcadmin [mrd20@hpc3 ~] groups hpcadmin oscsys gaussian tas35 schrodinger ccm4 singularity Working within Group Allocations - II • Group Name / ID: eecs338 / 10222 (course) • Resources • CPUs • RAM • max duration: 1-12:00:00 • Checking group usage with squeue: squeue -o "%A %C %e %E %g %l %m %N %T %u" | awk 'NR==1 || /eecs338/' JOBID CPUS END_TIME DEPENDENCY GROUP TIME_LIMIT MIN_MEMORY NODELIST STATE USER 148137 1 2016-01-26T16:54:22 eecs338 2:00:00 1900 comp145t RUNNING xyz123 148146 1 2016-01-27T01:14:27 eecs338 10:00:00 1900 comp148t RUNNING xyz321 SLURM Resources – Reading List

• Case HPC SLURM command summary • CPU Management User and Administrator Guide http://slurm.schedmd.com/cpu_management.html • Support for Multi-core/Multi-Thread Architectures http://slurm.schedmd.com/mc_support.html • Slides from Tutorial for Beginners http://www.schedmd.com/cray/Tutorial.Begin.pdf • SLURM manual pages http://slurm.schedmd.com/.html Case Cluster: How to Learn Web Search: CWRU HPC https://sites.google.com/a/case.edu/hpc-upgraded-cluster/home [email protected] Summary

Headnodes reserved for organizing work Compute nodes meant for performing work Low-Impedence Network for large-scale Data Transfer SLURM Workload Manager & Scheduler RCCI Staff on-hand for aid Jump in and learn! [email protected]

RCCI Team: Roger Bielefeld, Mike Warfe, Hadrian Djohari! Daniel Balagué, Brian Christian, Emily Dragowsky, Jeremy Fondran,! Sanjaya Gajurel, Matt Garvey, Theresa Griegger, Cindy Martin, Lee Zickel