Editing CommunityData:Hyak Ikt (Deprecreated)
From CommunityData
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
To use Hyak, you must first have a UW NetID, access to Hyak, and a two factor authentication token. Details on getting set up with all three are available at [[CommunityData:Hyak setup]]. | To use Hyak, you must first have a UW NetID, access to Hyak, and a two factor authentication token. Details on getting set up with all three are available at [[CommunityData:Hyak setup]]. | ||
== Setting up SSH == | == Setting up SSH == | ||
When you connect to SSH, it will ask you for a key from your token. Typing this in every time you start a connection be a pain. One approach is to create an .ssh config file that will create a "tunnel" the first time you connect and send all subsequent connections to Hyak over that tunnel. Some details [ | When you connect to SSH, it will ask you for a key from your token. Typing this in every time you start a connection be a pain. One approach is to create an .ssh config file that will create a "tunnel" the first time you connect and send all subsequent connections to Hyak over that tunnel. Some details [https://sig.washington.edu/itsigs/Logging_In#SSH_Config_File in the Hyak documentation]. | ||
I've added the following config to the file <code>~/.ssh/config</code> on my laptop (you will want to change the username): | I've added the following config to the file <code>~/.ssh/config</code> on my laptop (you will want to change the username): | ||
Host | Host hyak hyak.washington.edu | ||
User makohill | User makohill | ||
HostName | HostName login3.hyak.washington.edu | ||
ControlPath ~/.ssh/master-%r@%h:%p | ControlPath ~/.ssh/master-%r@%h:%p | ||
ControlMaster auto | ControlMaster auto | ||
Line 40: | Line 31: | ||
It will prompt you for your UWNetID's password and your PRN which is the little number that comes from your token. | It will prompt you for your UWNetID's password and your PRN which is the little number that comes from your token. | ||
== Setting | == Setting Up Hyak == | ||
When setting up Hyak, you must first add | When setting up Hyak, you must first add this to your BASHRC file. Generally, you can simply edit the following file on Hyak: <code>~/.bashrc</code> | ||
## hyak | ## hyak specific options | ||
alias rgrep='grep -r' | |||
alias big_machine='qsub -W group_list=hyak-mako -l walltime=500:00:00,mem=200gb -I' | |||
alias any_machine='qsub -W group_list=hyak-mako -l walltime=500:00:00,mem=100gb -I' | |||
PYTHON_PATH="/com/local/lib/python3.5:$PYTHON_PATH" | |||
LD_LIBRARY_PATH="/com/local/lib:/com/local/lib64/R/lib:${LD_LIBRARY_PATH}" | |||
PKG_CONFIG_PATH=/com/local/lib/pkgconfig:/usr/share/pkgconfig | |||
MC_CORES=16 | |||
PATH="/com/local/bin:$PATH" | |||
module load parallel_sql | module load parallel_sql | ||
module load contrib/gcc_5.1.0-openmpi_1.10.1 | |||
umask 007 | umask 007 | ||
The final line is particularly important. If you do not do this, the files you create on Hyak will be able to be read or written by others in the group! | The final line is particularly important. If you do not do this, the files you create on Hyak will be able to be read or written by others in the group! | ||
Line 78: | Line 59: | ||
These lines will mean that if I have "checked out" an interactive machine, I can ssh from my computer to Hyak and then directly through an addition hop to the machine (like ssh n0652). Those ForwardX11 lines means if I graph things on this window, they will open on my local display. | These lines will mean that if I have "checked out" an interactive machine, I can ssh from my computer to Hyak and then directly through an addition hop to the machine (like ssh n0652). Those ForwardX11 lines means if I graph things on this window, they will open on my local display. | ||
== | == Jupyter Notebook on Hyak == | ||
1. Choose a number you are going to use as a port. We should each use a different port and the number should be between 1000 and 65000. It doesn't matter what it is but it needs to be unique. Pick something unique. In the following instructions, replace '''$PORT''' with your number below. | |||
2. Connect to Hyak and forward the the port from you local machine to the new one: | |||
ssh -N -f -L localhost:$PORT:localhost:$PORT username@hyak.washington.edu | |||
You can also add the following line to the Hyak section on your local .ssh/config file on your laptop: | |||
LocalForward '''$PORT''' localhost:'''$PORT''' | |||
3. | |||
We have a working jupyter notebook setup on hyak. It works with python3 or R. | |||
Connect to a hyak login node. To keep your jupyter notebook running after you disconnect run screen (or tmux). | |||
We are going to forward the connection from the compute node to the login node to your local machine. | |||
<code>screen</code> | |||
<b>Get a machine. </b> | |||
<code>any_machine</code> | |||
run jupyter on the compute node. </b> | |||
<code>jupyter-notebook --no-browser --port=$PORT</code> | |||
<b>Now forward the jupyter server to the login node. Open a new screen. </b> | |||
<code>Ctrl-a c</code> | |||
<b>And run this ssh command.</b> | |||
nabcd is the name of the compute node. Replace abcd with the node number. | |||
< | <code>ssh -N -f -L localhost:$PORT:localhost:$PORT nabcd</code> | ||
<b>Now on you local machine (your laptop), forward the port from hyak to localhost.</b> | |||
<b>open localhost:PORT in your browser</b> | |||
</ | |||
When you first log in to Hyak, you will be on a "login node". These are nodes that have access to the Internet, and can be used to update code, move files around, etc. They should not be used for computationally intensive tasks. To actually run jobs, there are a few different options, described in detail [https://sig.washington.edu/itsigs/Hyak_Job_Scheduler in the itSigs documentation]. Following are basic instructions for | It should work! | ||
== Running Jobs on Hyak == | |||
When you first log in to Hyak, you will be on a "login node". These are nodes that have access to the Internet, and can be used to update code, move files around, etc. They should not be used for computationally intensive tasks. To actually run jobs, there are a few different options, described in detail [https://sig.washington.edu/itsigs/Hyak_Job_Scheduler in the itSigs documentation]. Following are basic instructions for the two most common use cases. | |||
=== Interactive nodes === | === Interactive nodes === | ||
Line 120: | Line 118: | ||
=== Parallel SQL === | === Parallel SQL === | ||
For big jobs you will want to use multiple nodes. Hyak has a very cool tool that makes this very easy, called Parallel SQL. Detailed instructions are in [https://sig.washington.edu/itsigs/Hyak_parallel-sql the itsigs parallel-sql documentation]. There is also a | For big jobs you will want to use multiple nodes. Hyak has a very cool tool that makes this very easy, called Parallel SQL. Detailed instructions are in [https://sig.washington.edu/itsigs/Hyak_parallel-sql the itsigs parallel-sql documentation]. There is also a full walkthrough example with instructions in the <code>wikiresearch/hyak_example</code> directory. | ||
The basic workflow is: | The basic workflow is: | ||
1. Prepare the code, and test it with a single file (either on your computer, or on an interactive node). | 1. Prepare the code, and test it with a single file (either on your computer, or on an interactive node). | ||
2. Write a job_script file. This tells the node what job to run. There is an example on the Parallel SQL wiki page (linked above), and an example in the wikiresearch/hyak_example directory. | 2. Write a job_script file. This tells the node what job to run. There is an example on the Parallel SQL wiki page (linked above), and an example in the wikiresearch/hyak_example directory. | ||
3. Create a task_list file. This is a list of commands that should be run, with one line per file that the command should operate on. An example file might look something like: | 3. Create a task_list file. This is a list of commands that should be run, with one line per file that the command should operate on. An example file might look something like: | ||
Line 152: | Line 141: | ||
$ for job in $(seq 1 N); do qsub job_script; done | $ for job in $(seq 1 N); do qsub job_script; done | ||
# N is the number of nodes | # N is the number of nodes | ||
=== Killing jobs on compute nodes === | === Killing jobs on compute nodes === |