25
Lecture 2: Useful Tools and Cluster Warm-up (An Interactive Tutorial) Nicolas Savva 28 Jan 2014

Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Lecture 2: Useful Tools and Cluster Warm-up(An Interactive Tutorial)

Nicolas Savva

28 Jan 2014

Page 2: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Disclaimer

I Quick overviewI nothing new for some...I overwhelming for others

I Similar information available on class wikiI Be able to do HW0 with ease after todayI Please ask questions

Page 3: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Logistics

I Everybody in the class should be on CMS by nowhttp://cms.csuglab.cornell.edu/web/guest

I The enrollment cap has been increased to the room limit(several seats are available)

I If you cannot see the course under CMS or log in to thecluster please email us with your netID

I HW0 is out (due Tuesday Feb 4th)

Page 4: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Today

I Connecting to the clusterI Basic usage of the shellI Version controlI Running and monitoring cluster jobsI HW0 walkthroughI More demos (if time permits)

Page 5: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

C4 cluster

I Rocks linux cluster (V6.1)http://www.rocksclusters.org/wordpress/�Heterogeneous nodes

I HTCondor scheduler (v7.8.5)http://research.cs.wisc.edu/htcondor/use to submit and monitor jobs on cluster

I Ganglia activity monitorhttp://c4.coecis.cornell.edu/ganglia/

Page 6: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

C4 cluster machines

Page 7: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

ssh access to cluster

I Use a Terminal under OS X or LinuxI PuTTY or Cygwin for windowsI Authenticate with Cornell NetID and password

ssh [email protected]

Page 8: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Terminal prompt

I Type the following for a one-off initialization:

/share/cs-instructional/cs5220/script/setup.sh

This appends commands to .bashrc and .bash_profile toautomatically set a class-related environment every timeyou log in.

Page 9: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Customize the prompt

Google customize $PS1add your version to the .bashrc file

export $PS1 = ...

\u username\h hostnamepwd working directory path\n new line

Page 10: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Some bash commands

ls w chmod sshcd ps export scp

pwd jobs set tarmkdir fg alias virmdir bg exit nanomv kill history whichcp Ctrl + C | man

grep Ctrl + Z find echo

. .. > » < « &

If you are not particularly familiar with the above pleasecheck out the following tutorial :http://software-carpentry.org/v4/shell/

Page 11: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

For more details

I The UNIX programming environmentby Kernighan & Pikehttp://cornell.worldcat.org/title/unix-programming-environment/

I Learning the bash shellby Newham & Rosenblatthttp://cornell.worldcat.org/title/learning-the-bash-shell/

Both are available through the Cornell library

Page 12: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Terminal multiplexer (tmux)

http://tmux.sourceforge.net/

I Concurrently view/manage multiple programs in oneterminal

I Read documentation (key-binding / configuration)I Edit .tmux.conf

Page 13: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Version Control Systems (VCS)

I Why version control?

I Keep revision history

I Easy way to share files between machines

I More effective collaboration

I (Remote) backup

Page 14: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

VCS - many flavors

I Distributed

I GitI Mercurial (Hg)I Bazaar

...

I Client-serverI Subversion (SVN)I CVS

...

Page 15: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Repositories - Host projects online

I Bitbucket (Mercurial or Git)I Github (Git)I Launchpad (Bazaar)I Google Code (SVN, Mercurial or Git)I Microsoft CodePlex (SVN, Mercurial or Git)I Sourceforge (CVS, SVN, Bazaar, Git or Mercurial)I Cornell Forge (SVN) - http://forge.cornell.edu

Page 16: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Bitbucket

I Class repository and wiki are hosted on Bitbucket:https://bitbucket.org/dbindel/cs5220-s14/Sign up for a free account

I Git tutorialhttps://www.atlassian.com/git/tutorial

I Pro Git bookhttp://git-scm.com/documentation

I Git (Interactive) Cheat Sheethttp://ndpsoftware.com/git-cheatsheet.html

I Git commands overviewhttps://www.atlassian.com/dms/wac/images/landing/git/atlassian_git_cheatsheet.pdf

Page 17: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Making a local copy

I Clone the class repository

git clone https://bitbucket.org/dbindel/cs5220-s14.git

The folder cs5220-s14 now contains local copy

Page 18: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Git basics demo

I git cloneI git addI git diffI git commitI git logI git remoteI git pullI git push

Please look at the cheat sheet and tutorials for morefunctionality

Page 19: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Graphical Interfaces available

I EGit (Git with Eclipse IDE)http://www.eclipse.org/egit/

I Subclipse (SVN with Eclipse)http://subclipse.tigris.org/

I SourceTree (Git and Mercurial GUI under Windows or Mac)http://www.sourcetreeapp.com/

I TortoiseSVN, TortoiseHg, TortoiseGit... series (mostlyWindows)

Page 20: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Eclipse PTP (Parallel Tools Platform)

I IDE for developing parallel applicationsI Support MPI, OpenMP, UPCI Parallel debuggerI Various profiling toolsI Some issues running on c4 clusterI Experiment with it on your own machineI Please don’t use PTP remotely on c4 right now

http://www.eclipse.org/ptp/

Page 21: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Using HTCondor

I condor_status [-claimed -avail -master -verbose]I condor_q [ -analyze -run -hold]I condor_submitI condor_holdI condo_releaseI condor_rmI condor_history [ -backwards -forwards -match]

[ -constraint -format ]

Page 22: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

HTCondor CS5220 wrapper scripts

I csub (serial submissions)

I mpisub (Message Passing Interface)

I upcsub (Unified Parallel C)

I ompsub (OpenMP: Open Multi-Processing)

https://bitbucket.org/dbindel/c4-pkg

Page 23: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Environment modulesMake it easy to install:

I different versions of software packagesI software packages that might conflict

I module list

I module avail

I module loadmodule add

I module unloadmodule rm

https://bitbucket.org/dbindel/cs5220-s14/wiki/modules

Page 24: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Homework 0 walkthrough

Steps:

I Clone class repo

I membench

I membench with ClassAd requirements

I HTCondor job management

I pinfo

I Retrieve the results (using sftp or scp)

http://bitbucket.org/dbindel/cs5220-s14/wiki/HW0

Page 25: Lecture 2: Useful Tools and Cluster Warm-up (An ...bindel/class/cs5220-s14/lectures/lec02.pdf · Version Control Systems (VCS) I Why version control? I Keep revision history I Easy

Additional Demos...