using the eastchem research computing facility · pdf fileusing the eastchem research...

30
Using the EaStCHEM Research Computing Facility An Introduction to Linux, SLURM, CYGWIN and many other cryptic acronyms Herbert Früchtl

Upload: vokhanh

Post on 13-Mar-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Using theEaStCHEM Research

Computing Facility

An Introduction to Linux, SLURM, CYGWINand many other cryptic acronyms

Herbert Früchtl

Page 2: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

OverviewThe EaStCHEM Research Computing FacilityConnect to a Linux computer from Windows using

CYGWIN Installation UseIntroduction to Linux Basic Linux commands Editing with Emacs and vi Transfering files between desktop and Linux serverRunning calculations through SLURM or SGE A typical job script How to submit and monitor jobsRules of useSecurity and privacy

Page 3: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Current St Andrews Clusters

wardlawwith Maths & Astronomy

290 x 12-core150 TB disk space

Accessible to allSt Andrews researchers

obelix

7 x 12 + 1 x 16 cores18 TB disk space

computationalchemistry group

knox

18 x 8 cores3 TB disk space

Bühl group andcollaborators

chpc-hf63-3

6 x 8 cores2 TB disk space

Früchtl group andcollaborators

kennedywith Astronomy

54 x 32-core250 TB disk space

Accessible to allSt Andrews researchersPaid-for access possible

Page 4: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

The St Andrews Cluster Wardlaw

Page 5: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Molecular QuantumChemistry

GaussianNWChemGAMESS-UKGAMESS-USORCADALTONMOLPROTurbomole

Application Areas and Programs

Plane Wave DFTCASTEPVASPCPMDNWChemPWscf

Molecular MechanicsGULPNWChemDL_POLY

Other Periodic MethodsWien2kCRYSTALSIESTACP2K

Page 6: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Connecting from Windows:XMing and PuTTY

InstallationXMing:

Download fromhttps://sourceforge.net/projects/xming/and install(in case of graphics problems later, get Xming-mesa fromhttp://www.straightrunning.com/XmingNotes/)

PuTTY

Download Windows installer fromhttp://www.chiark.greenend.org.uk/~sgtatham/putty/download.htmland execute it

Page 7: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Starting PuTTY Terminal

Start Xming (runs in

background)

Start PuTTY

Make sure X11 forwardingis enabled

Can save session settingsand recall

Specify host in Sessionwindow

Start terminal

Page 8: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

File TransferUsing cygwin (or Linux) command line:

sftp <user>@wardlaw10.mcs.st-andrews.ac.uklogin, password…put <file> PC -> wardlawget <file> wardlaw -> PCexit

Alternative: WinSCP

http://winscp.net/eng/index.php

graphical user interface (drag and drop)

Convert text files (newline character differs between UNIX and DOS/Windows)

dos2unix <file> Windows -> Linux both commands should workunix2dos <file> Linux -> Windows on cluster and in CYGWIN

Not doing this can lead to weird errors!

Page 9: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Creating and Using ssh KeysOn Linux, Mac or Cygwin:

Enter commandssh-keygen

Accept all default filenames

Choose (and remember) passphrase when prompted

Email file ~/.ssh/id_rsa.pub to system administrator.(In Cygwin, this is C:\cygwin64\home\<username>\.ssh\id_rsa.pub)

Do NOT send the private key (id_rsa without suffix)

Page 10: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Creating ssh Keys with PuTTYgen

PuTTYgen • Start PuttyGEN (in PuTTYfolder in start menu).

• Select "Generate"

• Move mouse randomlythrough grey area in windowuntil finished.

• Save private key. You willneed this to connect.

• Copy long string in upperwindow into text file.

• Email this file to sysadmin.

Page 11: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Using ssh Key with PuTTY

PuTTY

• Select Auth tab underConnection -> SSH

• Use browser menu to findprivate key (.ppk)

You can save settings (key location and X11 enabling in theSession tab.

Page 12: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Using ssh Key with WinSCP

• Select Advanced settings

• SSH -> Authentication tab

• Use browser menu to find private key (.ppk)

Page 13: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Linux commandsman <command>

manual page for <command>

exit

quit current shell (log out if this is the login shell)

passwd

change password

use a cryptic one!

Not necessary on wardlaw, kennedy or knox(authentication is via ssh keys).

Page 14: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Linux commands

ls

list current directory

ls -l

list directory in detail

ls -lrt (same as ls -l -t -r)

list current directory in detail,ordered by time, in reverse order

ls <dir>

list directory <dir>

man ls ...

Page 15: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

more Linux commands

cd <directory>

“change directory”: change working directory (folder)

.. parent directory (one up in the tree)

. current directory

/ between parent and child (not \ as in Windows)

pwd“print working directory”: show where we are

mkdir <directory>

create directoryrmdir <directory>

delete (empty) directory

Page 16: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Still more Linux commands

cp <file1> <file2>

copy

mv <file1> <file2>

rename (“move”)

mv <file1> <dir>

move <file1> into directory <dir> (works also with cp)

rm <file>

delete <file>

rm -r <dir>

delete <dir> and all subdirectories!

Page 17: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

A few more useful ones...head <file>

show first 10 lines of file

head -20 <file>

show first 20 lines (works for any number)

tail <file>

show last 10 lines (e.g. check if output file is complete)

tail –20 <file>

guess what…

tail –f <file>

“follow”: keep showing newly added lines. Exit with Ctrl-c

Page 18: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

And the last one for now

grep <pattern> <file>

show all lines in <file> containing <pattern>

Page 19: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Wildcards Most file/directory commands accept “wildcard

characters”. Most commonly used ones are

? Any single character

* Any number of characters (including 0)

Page 20: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Editing with Emacs

emacs <file> &

Opens Emacs window on your desktop

& executes (any) program in background, soyou can go on working in the same window

Page 21: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Using Emacs

Menus are self-

explanatory

Try to remembersome keyboardshortcuts, in case youneed to use it withoutX client (emacs -nw)

Ctrl-x-s save

Ctrl-x-c exit

Ctrl-x-w save underdifferentname

Page 22: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Editing with vi Faster over a network

No separate window start with

A bit cryptic at first… vi <file>

Two modes

Command Mode: cursor keysand 1-2 letter commands

x delete character

dd delete line

D delete rest of line

i insert before cursor

a append after cursor enter

o new line below input

O new line above mode

:w save

:x save and exit

Input Mode

Write text

Delete with backspace key

[ESC] key: back to command mode

Many tutorials and “cheatsheets” available

Google “vi editor”

Page 23: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Running SLURM Batch Jobs

Submit script to batch queuefor execution when computenodes are available

Job script with SLURMdirectives at the start:

Name of job

Request one nodeUse 12 coresRun for 48h maxUse complete nodesScript to run Gaussian

SLURM directives

Commands toexecute when jobstarts

Page 24: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Managing jobs

sbatch <jobscript>submit job

squeueshow running or queued jobs

scancel <jobnumber>delete job

Page 25: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Other Queueing Systems

Other clusters (knox, chpc-hf63):SGE or PBS queueing system

sbatch => qsubsqueue => qstatscancel => qdel

Get an example job from your supervisor!

Page 26: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Privacy and Data Protection

UNIX File permissions:

user (=owner)

group (same group as owner)

others (anybody else)

read

write

execute (file) or access (dir)

To change:

chmod go-rwx

(remove all permissions from yourgroup and others)

chmod g+r

(give your group read permission)

man chmod …

Root user can read (or write) anything!

Page 27: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Security

Passwords

• Don’t share. Get your ownaccount

• Make it difficult to guess(no names, dictionarywords, birth dates; usespecial characters)

• Change if compromised

Don’t run unknown programs

Don’t log in from a PC thatmay have viruses

Page 28: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

Rules of Use

Wardlaw and kennedy open to any St Andrewschemist

Higher priority access available for £500/y

Be considerate: don’t flood the machines whenthey are already full.

Other clusters: ask your supervisor

Page 29: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

How to get an Account or Advice

Contact me!

[email protected]

Wardlaw website

http://www-solar.mcs.st-and.ac.uk/~herbert/cluster/

Go down to “Software and usage”.

Page 30: Using the EaStCHEM Research Computing Facility · PDF fileUsing the EaStCHEM Research Computing Facility An Introduction to Linux, ... Editing with Emacs and vi ... cp   copy

EaStCHEM/SUPA postgrad course Introduction to Computational Chemistry

9 lectures starting October

Email your name and supervisor to Tanja van Mourik

[email protected]

Other Lectures and SeminarsLectures on

Molecular Quantum Chemistry

DFT on Periodic Systems

Computation in Chemistry Seminars

See Chemistry Newsletter

Sign up to mailing list with Tanja van Mourik

EaStCHEM PgCert course Computational Chemistry and Modellinghttp://www.ed.ac.uk/studying/postgraduate/degrees/index.php

Free for St Andrews PG students