Introduction to Linux and Supercomputers

Similar documents
Introduction to Linux and Cluster Computing Environments for Bioinformatics

Introduction to Linux and Cluster Computing Environments for Bioinformatics

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

Session 1: Accessing MUGrid and Command Line Basics

Linux Command Line Primer. By: Scott Marshall

CS Fundamentals of Programming II Fall Very Basic UNIX

STA 303 / 1002 Using SAS on CQUEST

CS CS Tutorial 2 2 Winter 2018

Unix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based.

ENCM 339 Fall 2017: Editing and Running Programs in the Lab

Introduction: What is Unix?

Introduction to Linux. Fundamentals of Computer Science

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Unix Tutorial Haverford Astronomy 2014/2015

Linux at the Command Line Don Johnson of BU IS&T

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

Guided Tour (Version 3.3) By Steven Castellucci as Modified by Brandon Haworth

Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18

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

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

Using the Zoo Workstations

Chap2: Operating-System Structures

Introduction to the Linux Command Line

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

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Parallel Programming Pre-Assignment. Setting up the Software Environment

Introduction to Linux Spring 2014, Section 02, Lecture 3 Jason Tang

Hitchhiker s Guide to VLSI Design with Cadence & Synopsys

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

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

Working with Basic Linux. Daniel Balagué

Operating Systems and Using Linux. Topics What is an Operating System? Linux Overview Frequently Used Linux Commands

Scripting Languages Course 1. Diana Trandabăț

Linux Bootcamp Fall 2015

Intro to Linux & Command Line

Basic UNIX commands. HORT Lab 2 Instructor: Kranthi Varala

Tutorial 1: Unix Basics

EE516: Embedded Software Project 1. Setting Up Environment for Projects

CISC 220 fall 2011, set 1: Linux basics

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

The Command Line. Matthew Bender. September 10, CMSC Command Line Workshop. Matthew Bender (2015) The Command Line September 10, / 25

Unix/Linux Primer. Taras V. Pogorelov and Mike Hallock School of Chemical Sciences, University of Illinois

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

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

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

Unix background. COMP9021, Session 2, Using the Terminal application, open an x-term window. You type your commands in an x-term window.

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

A Brief Introduction to the Linux Shell for Data Science

Introduction to Linux for BlueBEAR. January

Linux File System and Basic Commands

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

Introduction to UNIX command-line

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Unix Introduction to UNIX

Guided Tour (Version 3.4) By Steven Castellucci

ROS-Industrial Basic Developer s Training Class: Linux Basics. Southwest Research Institute Last Updated 2017

An Introduction to Cluster Computing Using Newton

Operating System Interaction via bash

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

Essential Linux Shell Commands

Operating systems fundamentals - B02

New User Tutorial. OSU High Performance Computing Center

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

5/8/2012. Creating and Changing Directories Chapter 7

Lab 2: Linux/Unix shell

Perl and R Scripting for Biologists

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

Principles of Bioinformatics. BIO540/STA569/CSI660 Fall 2010

15-122: Principles of Imperative Computation

Computer Architecture Lab 1 (Starting with Linux)

Chapter-3. Introduction to Unix: Fundamental Commands

Introduction to Linux

Introduction to Unix: Fundamental Commands

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you.

Chapter 4. Unix Tutorial. Unix Shell

Week 2 Lecture 3. Unix

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

User Guide Version 2.0

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

Programming Studio #1 ECE 190

The Unix Shell & Shell Scripts

CSE 391 Lecture 1. introduction to Linux/Unix environment

LAB #7 Linux Tutorial

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

Linux Introduction Martin Dahlö Valentin Georgiev

CSE 391 Lecture 1. introduction to Linux/Unix environment

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

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

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

CS370 Operating Systems

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017

Getting Started With UNIX Lab Exercises

Part 1: Basic Commands/U3li3es

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

CMSC 201 Spring 2018 Lab 01 Hello World

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

Parts of this tutorial has been adapted from M. Stonebank s UNIX Tutorial for Beginners (

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

Transcription:

Introduction to Linux and Supercomputers Doug Crabill Senior Academic IT Specialist Department of Statistics Purdue University dgc@purdue.edu

What you will learn How to log into a Linux Supercomputer Basics of a Linux shell, including moving/editing/creating/deleting files The basic filesystem structure for the data files and scripts you will be using How to launch programs, see their progress, and terminate them early if necessary

The rice.rcac.purdue.edu cluster

The rice.rcac.purdue.edu cluster

An individual node

Rice supercomputer stats 660 Nodes, 13,200 total CPU cores Each nodes has 20 CPU cores, 64GB RAM 1.7 Petabytes of scratch space for this cluster alone Several Petabytes of long term storage shared among all clusters Currently #319 on top500.org, Conte is #100.

Why Linux?

Why Linux?

Why Linux? Can be desktops, but tend to be larger servers in some remote, environmentally controlled data center Multiple CPU cores per server (~20) Large amounts of RAM (64GB 256GB is common) Multiple users can use the same computer simultaneously

Why Linux? (cont.) Can interact with a graphical interface More common to interact with a text based interface Servers tend to stay up for a long time between reboots (months) Commonly launch programs and walk away for days, weeks, or months as they run Computations can scale up as servers added

But where are the keyboards, mice, and monitors?

But where are the keyboards, mice, and monitors?

We use four computer systems Windows Desktop: computer in front of you Thinlinc: Linux server accessed in a web browser to gain a graphical interface Rice front-end: four of them, used to access Rice nodes, submit large jobs to the cluster Rice node, aka compute node, back-end node: 660 of them, this is where we compute

Doug s cute analogy Thinlinc: Like the bus you take from the airport to the hotel Rice front-end: Like the front desk at the hotel lobby where we make room reservations Rice node, aka compute node, back-end node: Like a private hotel room, where you are free to do your thing

Thinlinc Linux graphical interface We will use Thinlinc in a web browser (Firefox) to provide a graphical user interface for us to log into a Rice front-end, then a Rice node, where we will do the real computing Here is what it looks like!

Logging into Thinlinc

Thinlinc screenshot

Thinlinc sessions can persist! Programs/windows that are open and running can persist after closing browser Smile patiently while I demonstrate persistence If you explicitly click, you will be logged completely out and windows will not persist

Terminal Window

What is a shell? A text-based user interface used to launch programs Allows arguments to be passed to programs, specifying input/output files, running multiple programs at once The shell we use is called bash Terminal is one way of accessing a shell

Shell prompt

Use ssh to connect to Linux Implementations of ssh, available on Windows, Mac, Linux, Android, IOS, etc. Many implementations of ssh exist on each OS, any can be used. Similar to how many web browsers exist, and any can be used ssh alone provides a text-based interface When used in conjunction with other technologies, graphical interface can be used

Connect to Rice front-end

Rice front-end prompt

Connect to a Rice node

Connect to a Rice node

Let s all log in!

Multiple Terminal windows Always check your prompt name/color to make sure where your commands will run To open an additional Terminal window on the same server as an existing Terminal, type: Terminal & If you omit the &, the first Terminal cannot be used again until the second is closed Type exit to log out of a shell

Using copy/paste Using the Windows shortcuts Control-C and Control-V will generally not work, because those keys are special Either select the text and select Edit/Copy and Edit/Paste Or select the text which implicitly copies it, and press down on the mouse wheel to paste (don t roll it, press down like it s a button)

Filesystems Filesystems on Linux similar to network drives on Windows, but without drive letters Example directories on different filesystems: /home/train01, /depot/nihomics, /scratch/rice/t/train01 Hierarchical. Directory names separated by /, not by \ like with Windows. Avoid spaces in filenames and directory names.

Filesystems Filesystems on Linux similar to network drives on Windows, but without drive letters Example directories on different filesystems: /home/train01, /depot/nihomics, /scratch/rice/t/train01 Hierarchical. Directory names separated by /, not by \ like with Windows. Avoid spaces in filenames and directory names.

Filesystems on Rice

Filesystems visible from Windows You have an O: drive which corresponds to the /depot/nihomics course material folder on Rice. This area is read-only. You cannot create/delete/modify files there. You have an R: drive which corresponds to the scratch directory in your home directory on Rice (really /scratch/rice/t/trainnn). This is fully read-write for your accounts.

Shell features Shell environment variables used to control settings for how certain things work Thousands of potential commands can be executed Commands available varies from one Linux computer to the next, depending on what has been installed, and the value of your PATH environment variable

Shell features (cont.) Filename completion (using Tab key) Command completion (using Tab key) Command line editing using arrow keys (uparrow key to go to the previous command)

Let s get dirty!

Listing files in Terminal Type ls to list files in the current directory Type ls -l to list files with more detail Type ll to list files with even more detail

Navigating directories in Terminal Type pwd to see full path to current directory Type cd dirname to change directories Type cd.. to go to the parent directory, or cd../.. to go to the grandparent, etc. Type cd ~ to go to your home directory cd /depot/nihomics/data Absolute paths start with /, relative paths are relative to the current directory

Special directories /home/trainnn Your home directory /depot/nihomics Contains data files and scripts used in the workshop (O: drive) /home/trainnn/scratch Scratch directory where you will be saving output files, scripts (R: drive) /scratch/rice/t/trainnn SAME PLACE AS ABOVE!

Editing, copying, moving files

Editing, copying, moving files gedit filename Edits filename mv oldname newname Moves a file or directory, possibly to a new directory, possibly renaming the file or directory in the process cp oldname newname Copies files cp r olddir newdir Copies olddir and all files and subdirectories within

Create/Remove directories, files rm filename removes filename mkdir dirname creates dirname Rmdir dirname removes dirname, but only if dirname is empty Let s practice, and use filename completion and command line editing while we are at it!

Can copy/move/delete with GUI You can always fall back to using the O: drive and R: drive on Windows to move/delete files On a rice node (green/bold prompt!), open a graphical file browser to move/delete files via: thunar & If you accidentally omit the &, your Terminal cannot be used again until thunar is closed

Terminating a program If you are running a program in a terminal window that you would like to terminate, press Control-C This won t work if you started that program it with an &

See what programs are running ps xuww - Show what programs we are running now PID column shows the Process ID of each program Can use top to see most CPU intensive programs currently running by everyone on this server. Press q or just control-c to exit top

Terminate or kill or program Must first know the process id number (PID) using either ps xuww or top kill NNNNN Will kill most programs kill HUP NNNNN Use if the previous doesn t work kill -9 NNNNN Use if the previous doesn t work

Let s practice starting/killing progs On a Rice node, type busy 1000 & Type it again a few times (use the up-arrow!) Type top to see the PIDs of all the jobs running, press q to quit Kill all of the busy jobs by typing something like: kill 24933 24937 24939 24944 Type top again to confirm they are gone

Redirecting input/ouput Some programs write output to the Terminal/shell screen We can save it using output redirection qstat -a > out1 Saves results of the command qstat -a to the file out1 head < out1 See the first 10 lines of out1 head < out1 > out2 Save to out2

Redirecting input/ouput Can only save the text output that would have normally appeared on the screen. If a program wouldn t normally generate any text output, nothing will be saved Terminal > out3 (Nothing is saved!)

Pipes

Pipes Pipes are a feature of the shell that permit the output of one program to read as the input of another program, without having to save an intermediate file All programs involved run simultaneously and process data as they receive it

Example without pipes qstat -a > out1 awk {print $2} < out1 > out2 sort < out2 > out3 uniq -c < out3 > out4 sort -n < out4

Same example using pipes qstat -a awk {print $2} sort uniq -c sort n

Where to find these slides From Windows, in: O:\etc\doug\bigtap-comp1.pdf From a Rice node, in: /depot/nihomics/etc/doug/bigtapcomp1.pdf