hcc workshop august 29, 2014. introduction to linux ●operating system like windows or os x (but...

16
HCC Workshop August 29, 2014

Upload: milton-knight

Post on 11-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

HCC WorkshopAugust 29, 2014

Page 2: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Introduction to LINUX

● Operating system like Windows or OS X (but different)

● OS used by HCC

● Means of communicating with computer

● Command Line Interface (instead of GUI)

Page 3: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

The Terminal Window

After logging in to your account, commands are entered in a terminal window:

Working in LINUX, you are always located somewhere in your directory tree.

Most common commands: navigating within directory tree, creating, editing, moving and removing files and directories.

You are here

Page 4: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Your Directories on HCC Computers

Work Directory - not backed up

/work/<group>/<userid>or just$WORK

Use for: temporary scratch space (not long-term storage)I/O for running jobs

Home Directory- smaller space than work (quota limited by group)

/home/<group>/<userid>or just$HOME

Use for:program binaries, source code, configuration files, etc.

Your directories are not shared/mounted across all HCC clusters (ie. Tusker and Crane have separate file systems.)

“print working directory”

“change directory”

Page 5: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Other commands to cover

Move/rename files: mv Example: mv oldname newnameCopy files: cp Example: cp myfile myfilecopyChange the current directory: cd Example: cd mydirectorySee contents of the directory: lsSee directory contents with more details: ls -lPrint working directory: pwdPrint file to screen: more Example: more myfileMerging multiple files: cat Example: cat file1 file2 > combinedfileCreate empty file: touch Example: touch newfileSearch a string in a file: grep Example: grep mystring myfileCompress & decompress files: tar, zip, gzipRemove files: rm Example: rm filetodeleteRemove entire directory: rm -rf Example: rm -rf directorytodeleteSee more at: http://www.comptechdoc.org/os/linux/usersguide/linux_ugbasics.html

Page 6: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Getting Started - Logging in

● Quick start guide for Windows● Quick start guide for Mac/Linux

Page 7: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Basic exercise - create directory/file

Page 8: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Use Globus Connect to:● Transfer files between HCC clusters

(Tusker, Crane, & Sandhills)

● Transfer files between your laptop/pc and HCC clusters

● Share files with colleagues

Globus Connect

Page 9: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Globus Connect

Getting Started: (HCC-DOCS full instructions)

● Sign up for a Globus account

● Install Globus Connect Personal on your computer

● Activate HCC endpoint(s): hcc#tusker, hcc#crane, hcc#sandhills

● Log in to Globus account (online) and start making transfers

Important:

/home is read-only via Globus Connect (transfer from /home, but not to /home).

/work is readable/writable via Globus Connect (can transfer files to and from /work).

Page 10: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Exercise: Transfer files with GlobusOption 1: Transfer file with Globus

1. Download example query file to your laptop:Blast query file

2. Transfer file from your laptop to your Crane work directory using Globus

Option 2: Copy file into your work directory2. Log in to crane3. Copy query file to work with the following command:

cp /work/demo/shared/blastexample/query/mouse.query $WORK

Page 11: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

One editor : nano or any other you preferStart nano by running ‘nano’.

Save: Control + o Exit: Control + x

Page 12: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

#!/bin/sh#SBATCH --time=00:05:00#SBATCH --job-name=helloworld#SBATCH --error=helloworld.%J.err#SBATCH --output=helloworld.%J.out#SBATCH --qos=short

echo “this is my first slurm job”sleep 30

Exercise - Create submit script

Using nano, create the text file to the right.

Save it as ‘helloworld.submit’.

We will submit it to SLURM later.

Page 13: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Cluster Basics

● Every job must be run through a scheduler:Submitting Jobs using SLURM

● Software is managed through the module software:

Using Module● Every user has two directories to use:

Where to Put Data

Page 14: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Exercise - Submit hello world job

Page 15: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Exercise - Run BLAST job

● Use the example mouse.query file we copied using Globus earlier

● Example submit script provided at:/work/demo/shared/blastexample/blast.submit

● Uses small example database

Page 16: HCC Workshop August 29, 2014. Introduction to LINUX ●Operating system like Windows or OS X (but different) ●OS used by HCC ●Means of communicating with

Exercise - Run BLAST job