hcc workshop august 29, 2014. introduction to linux ●operating system like windows or os x (but...
TRANSCRIPT
HCC WorkshopAugust 29, 2014
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)
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
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”
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
Getting Started - Logging in
● Quick start guide for Windows● Quick start guide for Mac/Linux
Basic exercise - create directory/file
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
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).
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
One editor : nano or any other you preferStart nano by running ‘nano’.
Save: Control + o Exit: Control + x
#!/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.
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
Exercise - Submit hello world job
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
Exercise - Run BLAST job