An Introduction to Cluster Computing Using Newton

Similar documents
A Hands-On Tutorial: RNA Sequencing Using High-Performance Computing

UoW HPC Quick Start. Information Technology Services University of Wollongong. ( Last updated on October 10, 2011)

New User Tutorial. OSU High Performance Computing Center

Working with Basic Linux. Daniel Balagué

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

Short Read Sequencing Analysis Workshop

Linux Command Line Interface. December 27, 2017

The cluster system. Introduction 22th February Jan Saalbach Scientific Computing Group

High Performance Computing (HPC) Club Training Session. Xinsheng (Shawn) Qin

Introduction to remote command line Linux. Research Computing Team University of Birmingham

Introduction to UNIX command-line

Carnegie Mellon. Linux Boot Camp. Jack, Matthew, Nishad, Stanley 6 Sep 2016

Using ISMLL Cluster. Tutorial Lec 5. Mohsan Jameel, Information Systems and Machine Learning Lab, University of Hildesheim

Introduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017

COMS 6100 Class Notes 3

Introduction: What is Unix?

CS197U: A Hands on Introduction to Unix

CSE 390a Lecture 1. introduction to Linux/Unix environment

Running Sentaurus on the DOE Network

Introduction to Linux Environment. Yun-Wen Chen

CS CS Tutorial 2 2 Winter 2018

CSE 390a Lecture 2. Exploring Shell Commands, Streams, Redirection, and Processes

Using the computational resources at the GACRC

Joint High Performance Computing Exchange (JHPCE) Cluster Orientation.

Introduction to the Linux Command Line

Hitchhiker s Guide to VLSI Design with Cadence & Synopsys

Introduction to Linux and Cluster Computing Environments for Bioinformatics

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

Introduction to Linux Workshop 1

Name Department/Research Area Have you used the Linux command line?

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

C++ Programming on Linux

Computer Systems and Architecture

Session 1: Accessing MUGrid and Command Line Basics

Bioinformatics? Reads, assembly, annotation, comparative genomics and a bit of phylogeny.

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

CSE 390a Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

Exercise 1: Connecting to BW using ssh: NOTE: $ = command starts here, =means one space between words/characters.

Introduction to HPC Resources and Linux

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

High Performance Computing Cluster Basic course

Lab 2: Linux/Unix shell

Network Monitoring & Management. A few Linux basics

Introduction to Linux and Supercomputers

A Brief Introduction to the Linux Shell for Data Science

AMS 200: Working on Linux/Unix Machines

CMSC 201 Spring 2018 Lab 01 Hello World

Parallel Programming Pre-Assignment. Setting up the Software Environment

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

Introduction to Unix: Fundamental Commands

Introduction to UNIX/Linux

Introduction to Linux for BlueBEAR. January

Introduction To. Barry Grant

Introduction to Linux. Fundamentals of Computer Science

Find out where you currently are in the path Change directories to be at the root of your home directory (/home/username) cd ~

Basic UNIX commands. HORT Lab 2 Instructor: Kranthi Varala

Chapter-3. Introduction to Unix: Fundamental Commands

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011

NBIC TechTrack PBS Tutorial

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Lab #2 Physics 91SI Spring 2013

Lab 1 Introduction to UNIX and C

Filesystem and common commands

Unix Tutorial Haverford Astronomy 2014/2015

Chap2: Operating-System Structures

UNIX Quick Reference

Linux Command Line Primer. By: Scott Marshall

Computational Skills Primer. Lecture 2

HPC Introductory Course - Exercises

Unix Processes. What is a Process?

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

bwunicluster Tutorial Access, Data Transfer, Compiling, Modulefiles, Batch Jobs

Command-line interpreters

DATA 301 Introduction to Data Analytics Command Line. Dr. Ramon Lawrence University of British Columbia Okanagan

Why learn the Command Line? The command line is the text interface to the computer. DATA 301 Introduction to Data Analytics Command Line

CMSC 201 Spring 2017 Lab 01 Hello World

Exercise Sheet 2. (Classifications of Operating Systems)

CISC 220 fall 2011, set 1: Linux basics

Batch system usage arm euthen F azo he Z J. B T

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands

Introduction to Linux

Study Guide Processes & Job Control

Linux Introduction Martin Dahlö

Lab 1: Introduction to Linux Networking

Advanced Linux Commands & Shell Scripting

unix intro Documentation

Physics REU Unix Tutorial

COSC UNIX. Textbook. Grading Scheme

bwunicluster Tutorial Access, Data Transfer, Compiling, Modulefiles, Batch Jobs

Introduction to HPC Using zcluster at GACRC

CS 3410 Intro to Unix, shell commands, etc... (slides from Hussam Abu-Libdeh and David Slater)

CSE 391 Lecture 1. introduction to Linux/Unix environment

NBIC TechTrack PBS Tutorial. by Marcel Kempenaar, NBIC Bioinformatics Research Support group, University Medical Center Groningen

CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C

CS 261 Recitation 1 Compiling C on UNIX

For Dr Landau s PHYS8602 course

Transcription:

An Introduction to Cluster Computing Using Newton Jason Harris and Dylan Storey March 25th, 2014 Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 1 / 26

Workshop design. Slides are going to be up here mostly for you to stare at and so that I remember what I m supposed to be talking about. Mostly you will be getting onto newton and submitting a few trivial jobs so that you ll be more comfortable in the future. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 2 / 26

What is a cluster? Simply put, a cluster is a number of computers that are connected together over a LAN that act like one large computer by being able to talk with each other. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 3 / 26

When should I use the cluster? You should look to using the cluster when computing becomes a bottle neck. You have many of the same processes to run serially. A few intensive processes to run. A process that needs to use more CPUs than you have on your current computer. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 4 / 26

Why should I be using the cluster? Free support Technical advising You don t need to buy your own hardware. You don t need to maintain your own hardware and software. Basically, you get a resource without having to pay for and maintain it yourself. None of this is free, but as a student you do get non priority access to the equipment and individuals can invest in the cluster to get more computing resources. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 5 / 26

Newton Specs In total Newton has: 4,200 cores 8TB of RAM 50TB of Lustre Storage 50TB of Network Attached Storage 50TB off site backup Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 6 / 26

Access to Newton All students and faculty have access to this resource. How much priority you have depends on money. To register : Go To: https://newton.utk.edu/manager/ Register for an account. Wait If you remember everyone who didn t know what Newton was gave me their UT username several months ago. Your accounts are already made. Some of you didn t write legibly you ll need to do this yourself. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 7 / 26

Connecting to Newton Connecting to Newton is a trivial matter Linux/UNIX : type ssh username@newlogin.newton.utk.edu into your terminal PuTTy : Hostname newlogin.newton.utk.edu Username NetID Password NetID password Remote port to connect to 22 A successful connection will open up a bash shell for you to use. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 8 / 26

Linux Refresher Linux Bash Shell Cheat Sheet Basic Commands Basic Terminal Shortcuts Basic file manipulation CTRL L = Clear the terminal cat <filename> = show content of file CTRL D = Logout (less, more) SHIFT Page Up/Down = Go up/down the terminal head = from the top CTRL A = Cursor to start of line -n <#oflines> <filename> CTRL E = Cursor the end of line CTRL U = Delete left of the cursor tail = from the bottom CTRL K = Delete right of the cursor -n <#oflines> <filename> CTRL W = Delete word on the left CTRL Y = Paste (after CTRL U,K or W) mkdir = create new folder TAB = auto completion of file or command mkdir mystuff.. CTRL R = reverse search history mkdir mystuff/pictures/..!! = repeat last command CTRL Z = stops the current command (resume with fg in foreground or bg in background) cp image.jpg newimage.jpg = copy and rename a file Basic Terminal Navigation cp image.jpg <foldername>/ = copy to folder cp image.jpg folder/sameimagenewname.jpg ls -a = list all files and folders cp -R stuff otherstuff = copy and rename a folder ls <foldername> = list files in folder cp *.txt stuff/ = copy all of *<file type> to folder ls -lh = Detailed list, Human readable ls -l *.jpg = list jpeg files only mv file.txt Documents/ = move file to a folder ls -lh <filename> = Result for file only mv <foldername> <foldername2> = move folder in folder mv filename.txt filename2.txt = rename file cd <foldername> = change directory mv <filename> stuff/newfilename if folder name has spaces use mv <foldername>/.. = move folder up in hierarchy cd / = go to root cd.. = go up one folder, tip:../../../ rm <filename>.. = delete file (s) rm -i <filename>.. = ask for confirmation each file du -h: Disk usage of folders, human readable rm -f <filename> = force deletion of a file du -ah: files & folders, Human readable rm -r <foldername>/ = delete folder du -sh: only show disc usage of folders touch <filename> = create or update a file pwd = print working directory ln file1 file2 = physical link man <command> = shows manual (RTFM) ln -s file1 file2 = symbolic link Courtesy of cli.learncodethehardway.org Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 9 / 26

Transfering Files Of course logging into Newton isn t enough. You ll need to get data to and from the cluster as well. There are a number of tools for this that exist. Command line: scp - Secure Copy. Its just like cp but over SSH. wget - gets content from web servers. (HTTP,HTTPS,FTP) rsync - Linux/Unix synchronization utility. Good for lots of files or if only a few changes are being made between files. GUI: FileZilla, Drag and drop file queuing and transfer program. Fugu, another popular file transfer interface for Mac OSX. Most Linux file managers have built in functionality for this as well. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 10 / 26

Screen Shots, Because it Happened Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 11 / 26

Screen Shots, Because it Happened Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 12 / 26

Screen Shots, Because it Happened Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 13 / 26

Screen Shots, Because it Happened Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 14 / 26

Screen Shots, Because it Happened Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 15 / 26

Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 16 / 26

The Sun Gride Engine Once you connect to the cluster you ll be able to do a few basic things like: edit files compile code run basic programs But keep in mind that you re resource limited and if you try to run any resource intensive jobs you ll anger the admin gods. In order to use the cluster effectively you ll need to submit jobs to the Grid Engine. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 17 / 26

Submitting a Job to SGE This process goes as follows: Create a file that tells the scheduler what you need and how longtable you ll need it for. Grid Engine finds the resources on the cluster for you to use and reserves them. Once all of the resources are collected the Grid Engine runs your job. While the job is running, the Grid Engine collects stderr and stdout and writes them to log files. Upon completion, resources are freed. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 18 / 26

Queues on the Newton Cluster The queue you request tells Newton how long you want a job to run for. If your job runs longer than the queue you re in, Newton will kill the job before it finishes so make sure to pick an appropriate queue. Queue selection also changes the number of resources you can request for a job as well. short- 256 cpus, 2 hours max run time medium - 128 cpus, 24 hours max run time long - priority groups only Don t just put everything in the medium queue, it will effect how fast your jobs are executed. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 19 / 26

A Basic Job, Single CPU! Create your first SGE file by opening a new basic text document on your computer Type the following lines into the file and save. #$ N Test #$ cwd #$ q s h o r t uname a s l e e p 30 Copy this file to your home directory on Newton (/home/username/) Submit your job by typing the following : qsub Basicjob.sge Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 20 / 26

Monitoring your Job(s) Type qstat to get a list of your currently running or submitted jobs. You can check the state column to find if your job is queued and waiting (qw), running(r), or in error (e). You can also check the direct status of running jobs by looking at output generated during the run. These file are named by the Name you submitted in your script, followd by an e or o for each stream. Pro Tip : Typing qstat repeatedly is annoying, try typing watch qstat and it will check the command regularly for you! Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 21 / 26

Requesting More Resources Obviously if you re using this resource you probably have software capable of using multiple CPUs. In order to do this you need to ask for those CPUs before you can use them. Pro Tip: It s also important to tell the program you re running how many CPUs it is allowed to use in order to make sure you re not using resources that aren t allocated to you. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 22 / 26

Multiple CPUs on a Single Node If you want to run a job in which you ll be using multiple CPUs on a single node your job file might look something like this: #$ pe t h r e a d s 4 #$ N Test #$ cwd #$ q s h o r t / l u s t r e /home/ d s t o r e y / W o r k s h o p F i l e s / t h r e a d s. p l You ll notice a new line requesting 2 threads. This tells the scheduler to find you two CPUs on the same node. The files and an example script for this available at : /lustre/home/dstorey/threads/ Remember, you can only ask for resources that exist. If no nodes exist with the number of threads you request your job can t run. Try out the qhost command and see what it says! Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 23 / 26

Trivially Parallel Jobs Sometimes you need to execute the same job repeatedly. The Grid Engine has a specific way of managing these tasks called array jobs. The files and an example script for this available at : /lustre/home/dstorey/array/ To use an array job: Break your data in to x number of files with the names having sequential integers. Submit your job file with the option #$-t 1-x The job then accesses an enviroment variable $SGE TASK ID to determine the file to use. Your Job File should look something like this : #$ N Test #$ cwd #$ q s h o r t #$ t 1 100 / l u s t r e /home/ d s t o r e y / W o r k s h o p F i l e s / Array / a v e r a g e. p l $SGE TASK ID. dat Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 24 / 26

Trivially Parallel Jobs I m sure you can already see that this is not always a feasible method for submitting jobs. Thankfully you can use scripts to write and submit job files for you. I ve included and example script for to do this if you need any ideas(/lustre/home/dstorey/workshopfiles/generate and submit jobs.pl). Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 25 / 26

Other Methods There are other methods of requesting resources: MPI jobs request many CPUs from many Nodes. Hybridized jobs request specific number of CPUs on a node across a number of Nodes. This is all I m going to say about these. Know that they exist and you may want to use them one day. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 26 / 26

Modules on Newton The module system provides you with a way of managing all of the enviromental variables in your session. Each module corresponds to a specific application. Use the module system with the module command. For example if you wanted to submit a job that uses the signalp module and calls signalp your sun grid engine would look something like this: #$ N Test #$ cwd #$ q s h o r t module l o a d s i g n a l p s i g n a l p m y p e p t i d e. f a s You can get a complete list of modules available by typing module avail. Jason Harris and Dylan Storey Introduction to Cluster Computing March 25th, 2014 27 / 26