evan bollig and michael milligan october 1, 2015 november
TRANSCRIPT
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
Evan Bollig and Michael Milligan!October 1, 2015
November 12, 2015!
1
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Batch vs. Interactive Computing!• Getting Started with MSI Interactive Resources!
o Connecting to MSI!
o Calming your Fears!
o Prototyping Workflows!
o Conscientious Computing !
• Hands-on!o IPython Notebooks!
o MATLAB Parallel Jobs!
2
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Software GUIs!• Prototyping workflows!
o Design your workflow for a single node (multi-core) or small set of nodes!
o Discover and test new tools/concepts!
o Profile, optimize and debug!
• Data Visualization!
3
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
4
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• When should you use Batch Jobs?!o Whenever possible! This is the traditional way to work in HPC!
• What are the benefits of Batch Jobs?!o Headless execution of automated processes!
o Long runtimes!
o Large core counts!
o A scheduler packs jobs in hardware to maximize utilization, reduce latency, etc. !
5
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• The Job Script (hello.pbs): A BASH shell script containing #PBS directives and commands
• Submit this to a queue on Mesabi, Itasca, or the Lab Queue*:
!qsub hello.pbs!
6
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• ssh to login.msi.umn.edu, then lab (or mesabi, or itasca)!• qsub -I -lwalltime=$W, nodes=$N:ppn=$P!
7
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• http://xen.msi.umn.edu !• (Four load-balanced pools)*(Eight cores and 61 GB
RAM) = NOT a Supercomputer!!
8
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• http://nice.msi.umn.edu!• VMs run on the Lab Queue (Also NOT a Supercomputer)!
9
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• http://galaxy.msi.umn.edu!• Workflow manager, principally for ʻOmics and Informatics
research!
10
Tutorial: Quality Control of Illumina Data with Galaxy
Tues., October 13, 2015 14:00
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
Batch (qsub) Interactive SSH (qsub -I)
Interactive Desktop (Linux)
Interactive Desktop
(Windows) Wall clock limit 696 hours 696 hours1,2 24 hours 48 hours Requires SUs ✔ ✔3! ✕4! ✕!
Memory limit 1 TB 1 TB 16 GB 61 GB Core Limit 8640 8640 4 8 Software Modules
400+ 400+ 400+ 50+
GPUs ✔ ✔ ✔ ✔ GUIs ✕ ✔ ✔ ✔
11
1. Don’t be a jerk 2. Larger requests receive lower priority 3. Resource dependent 4. Subject to change
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Effective July 13, 2015: !o Default runtime on “lab” queue reduced to 24 hours!o Fairshare priority given to Interactive jobs!
• Long-Term Goal:!o Long running jobs and batch jobs run on Mesabi!
• Shorter queues!• Better hardware!• Same software!• “qsub -I” also supported !
o “Interactive” jobs will be truly interactive!
12
= More research; Faster.
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• YES: the name “Lab Queue” will retire!o NO: loss of software modules!o NO: loss of Interactive Computing capabilities!o NO: we will not prevent you from running jobs!
• SUs are FREE and distributed in three tiers: !o 70K for every group (by default; no request; no justification; no catch!)!
o 280K (by request; no justification)!o > 280K (by request; with justification)!
• All current Lab Queue jobs fit into the Tier I category!• A Tier I-to-II or Tier II-to-III increase can be requested anytime
throughout the year!
• The bottom line: change where you work, not how. !
13
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
14
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
https://it.umn.edu/virtual-private-network-vpn !
15
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
http://www.putty.org/ !
16
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
Following https://www.msi.umn.edu/support/faq/how-do-i-connect-citrix-
windows-virtual-machine !
17
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Login to http://xen.msi.umn.edu !• Follow the on-screen guide to install the Citrix Receiver
(if not yet installed)!o Plugin available for Windows, Linux (RedHat/CentOS, Debian/
Ubuntu), and MacOSX operating systems!
18
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Default -- A standard Windows session with 2D graphics. !o This is more than adequate for most user needs. !
• Node-locked Software -- Contains designated titles like GenomeStudio, that have restricted licenses.!
• GPU -- Backed by a shared GPU for multiple users on the same server. !o Use this pool for applications with low to moderate graphics
requirements.!
• GPU Exclusive -- Backed by a single GPU for each user, access to this option is granted by request ONLY ([email protected]). !
19
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Panasas Group Directories are mounted (G:)!o Drag-and-drop data to VM!
o Stage to Local Scratch (L:) for best I/O speeds!
• Other File Transfers !o Use WinSCP, Firefox/Chrome within the VM!
o Or allow Citrix to mount your local drives Read-Only or Read/Write and Drag-and-drop within Windows FileExplorer!
20
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• What is lost when the connection drops?!o Instance: if not expired, reconnect to the same Instance Type!
o Data: Scratch data (L:) is kept until the instance expires or it is terminated!
• What if you Logout?!o Instance: Terminated; Reconnect and start fresh!
o Data: Scratch data (L:) is deleted; User data (U:) is kept!
• How do you reconnect?!o Login again to http://xen.msi.umn.edu !
21
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
22
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• SSH to any cluster headnode:!o ssh login.msi.umn.edu ssh mesabi!
• Queue an Interactive (-I) job on any cluster:!o qsub -I [options]!
• -l walltime=W!
• -l nodes=X:ppn=Y!
• -l pmem=M -OR- -l mem=M!
• -q “QueueName”!
o Enable graphics via X-tunneling (-X)!
23
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• See all modules available!o module avail!
• Load a module (adds commands to your shell)!o module load matlab!
• Run the software from the module!o matlab !
24
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Use a terminal to complete your work!o Automate the process!
o All commands go into a single BASH script (e.g., workflow.bash)!
• Remember:!o Errors will interrupt the script and fail your job (work around
them)!
o Use relative File Paths in case script is moved (e.g., /home/bollige/bollige/test.m -> ~/test.m -or- $HOME/test.m)!
o Use BASH variables whenever possible to generalize!
25
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Use screen to run multiple terminals on the remote application!
• Find the node name!o cat $PBS_NODEFILE!
o qstat -f $PBS_JOBID!
• Connect using SSH!o ssh login.msi.umn.edu ssh mesabi ssh [node]!
26
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Generate a new key!o ssh-keygen -t rsa -f ~/.ssh/<keyName>!
• Authorize the public key for SSH!o Append ~/.ssh/<keyName>.pub to login.msi.umn.edu:~/.ssh/authorized_keys!
• Add the key to your Agent keychain!o ssh-add ~/.ssh/<keyName>!
• Login using the Agent for authentication!o ssh -AX login.msi.umn.edu!
27
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Delete the session (choose one)!o Exit out of all connections!
o qdel !
• What happens on disconnect/delete?!o All computation stops!
• How to resume?!o Start from zero; or load intermediate files (if you created them)!
28
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
29
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Login to http://nice.msi.umn.edu !• Click on the “Download DCV Client” Link!• Choose your OS (Windows, OSX, Linux)!• Install the application!
30
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Non-GPU - Regular, non-graphics accelerated sessions. These are sufficient for most applications. !
• GPU – Graphics accelerated sessions for Interactive Visualization. Do not use these unless you require a GPU. !
31
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• The Linux VM runs out of Panasas (i.e., Group Home directories)!o DCV Client has a built-in file transfer (Look for )!
o Use SCP, SFTP, etc. to transfer data to/from Panasas:scp –r localDir login.msi.umn.edu:~/remoteDir/.!
o Move data in/out from Windows using Windows FileExplorer!
• Leverage /scratch.global and /scratch.local when possible!o NO BACKUP!!!
o Cleanup after yourself!
32
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• What is lost when the connection drops?!o Instance: if not expired, reconnect to the same Instance!
o Data: no loss!
• What if you Logout?!o Instance: Terminated; Reconnect and start fresh!
o Data: Scratch data is deleted periodically* (clean up after yourself to be sure); No loss for data in group home!
• How do you reconnect?!o Login again to http://nice.msi.umn.edu !
33
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
34
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
35
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• This demo benefits from setting up an SSH Key!• Open a Terminal (Menu -> System -> Terminal)!
o module load python-epd ipython notebook!
• An IPython dashboard should open in your web browser!
36
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Fetch some example notebooks!git clone
https://github.com/mbmilligan/msi-ipython-nb-ex.git
• Browse to folder and open any *.ipynb!
37
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Use Mesabi for larger resources!• Start interactive job on Mesabi (1 hour, 1 node, 8 CPUs):!
o ssh login ssh mesabi on mesabi> qsub -I !–lwalltime=1:00:00 -lnodes=1:ppn=8 –lpmem=2gb
38
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Extra step due to firewalls – use INternal (infiniband) network!• Start IPython Notebook on INternal network address:!
o cnXXX> module load python-epd cnXXX> ipython notebook --no-browser ! ! !--ip=in-$(hostname).mesabi!
• ipython command will output lines like!o [I 10:02:58.191 NotebookApp] 0 active kernels
[I 10:02:58.191 NotebookApp] The IPython Notebook is running at: http://in-cn0658.mesabi:8888/ [I 10:02:58.191 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).!
• Paste the URL into your web browser
39
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• !
40
Start here
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Overview of IPython's architecture for parallel and distributed computing.!
• Detailed discussion of IPython cluster controller and engines.!
• Discussion of IPython magic commands!• Official IPython documentation!
41
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
42
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• This demo requires a passphrase-less SSH key*!• Open a Terminal (Menu -> System -> Terminal)!
o module load matlab matlab &!
43
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Create the file (run in Matlab):!o edit myfunc.m!
• Add Contents: !o parfor i = 1:2048
!t = getCurrentTask(); !A(i) = t.ID; end
spmd !t = getCurrentTask(); !R = rand(4); !c = labindex; !fprintf('LabIndex: %d, t.ID: %d', labindex, t.ID); end!
44
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Create a local pool of 4 workers (Run in Matlab):!o cl=parcluster(‘local’)!
o cl.parpool(4)!
• Do your parallel work!o myfunc!
o plot(A)!
• Clean up the local pool!o delete(gcp)!
45
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Setup the Cluster Configuration (Run in Matlab):!o configCluster!
o Specify the work directory as your: /home/$GROUP/$USER!
• Configure your ClusterInfo settings (i.e., Job Settings)!o ClusterInfo.state ClusterInfo.setWallTime(‘1:00:00’) ClusterInfo.setProcsPerNode(8) ClusterInfo.setClusterHost(‘itasca.msi.umn.edu’) ClusterInfo.setQueueName(‘batch’)!
• Build a parcluster and submit your script!o cl=parcluster() cl.batch(‘myfunc’,’Pool’,23)!
46
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• The job is submitted (Batch)!o You can close MATLAB and return for your results later!
• Wait for results!o cl.Jobs(1).wait() j1 = cl.Jobs(1).load() plot(j1.A)!
• Delete jobs and data!o cl.Jobs(1).delete()!
47
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Additional documentation for MATLAB Parallel Computing Toolbox (PCT) and Distributed Compute Server (MDCS): http://www.mathworks.com/help/pdf_doc/distcomp/distcomp.pdf!
48
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
These slides and the hands-on guide will be posted to http://msi.umn.edu (see the “MSI Tutorials” section)
49
MN Supercomputing Institute for Advanced Computational Research
© 2009 Regents of the University of Minnesota. All rights reserved.
• Add this text to ~/.ssh/config:
Host lab* ProxyCommand ssh -Aq login.msi.umn.edu nc %h 22 !
• SSH directly to lab (via login.msi.umn.edu)!• Use in combination with ssh-add (SSH Agent) and ssh -A
to authenticate once and sign on everywhere!
50