Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Linux and Supercomputers

Similar presentations


Presentation on theme: "Introduction to Linux and Supercomputers"— Presentation transcript:

1 Introduction to Linux and Supercomputers
Doug Crabill Senior Academic IT Specialist Department of Statistics Purdue University

2 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

3 The rice.rcac.purdue.edu cluster

4 The rice.rcac.purdue.edu cluster

5 An individual node

6 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.

7 Why Linux?

8 Why Linux?

9 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

10 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

11 But where are the keyboards, mice, and monitors?

12 But where are the keyboards, mice, and monitors?

13 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

14 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

15 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!

16 Logging into Thinlinc

17 Thinlinc screenshot

18 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

19 Terminal Window

20 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

21 Shell prompt

22 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

23 Connect to Rice front-end

24 Rice front-end prompt

25 Connect to a Rice node

26 Connect to a Rice node

27

28

29 Let’s all log in!

30 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

31 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)

32 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.

33 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.

34 Filesystems on Rice

35 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.

36 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

37 Shell features (cont.) Filename completion (using “Tab” key)
Command completion (using “Tab” key) Command line editing using arrow keys (up-arrow key to go to the previous command)

38 Let’s get dirty!

39 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

40 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

41 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!

42 Editing, copying, moving files

43 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

44 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!

45 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

46 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 &

47 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

48 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

49 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 Type top again to confirm they are gone

50 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

51 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!)

52 Pipes

53 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

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

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

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

57

58


Download ppt "Introduction to Linux and Supercomputers"

Similar presentations


Ads by Google