Biocomputingpage

From CsWiki
Revision as of 09:35, 8 July 2018 by Javasky (Talk | contribs) (Created page with " <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.mi...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"

xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=windows-1255"><meta name=ProgId content=Word.Document><meta name=Generator content="Microsoft Word 15"><meta name=Originator content="Microsoft Word 15"><link rel=File-List href="wiki_files/filelist.xml"><link rel=Edit-Time-Data href="wiki_files/editdata.mso"><link rel=themeData href="wiki_files/themedata.thmx"><link rel=colorSchemeMapping href="wiki_files/colorschememapping.xml"><style></style></head><body lang=EN-US link="#0563C1" vlink="#954F72" style='tab-interval:36.0pt'>

How to set up a unix

account:<o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>To obtain a unix user name and password, create an account by registering at <a href="https://registrar.cs.huji.ac.il/account">https://registrar.cs.huji.ac.il/account</a>.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Connecting to the hm server:<o:p></o:p><p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Before connecting to the hm server, an SSH connection needs to be set up. Instructions for set-up can be found at <a href="http://wiki.cs.huji.ac.il/wiki/Connecting_from_outside">http://wiki.cs.huji.ac.il/wiki/Connecting_from_outside</a>. <p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Every time you connect to the system, you will need to use a One-Time password (OTP) in addition to your unix (IDng) password. Instructions for obtaining OTPs can be found at <a href="http://wiki.cs.huji.ac.il/wiki/Password_and_OTP">http://wiki.cs.huji.ac.il/wiki/Password_and_OTP</a>.<p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>It is helpful to set up an FTP connection for easy file transfer between your desktop computer and the server. To do this with MobaXterm: <p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Create a new SFTP session by clicking on 'Session' and then 'SFTP'. Fill in the basic settings so that remote host = localhost, username = <your unix user name>, and the port = 9001. For example:<p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><![if !vml]><img border=0 width=554 height=437 src="wiki_files/image006.jpg" v:shapes="Picture_x0020_1"><![endif]><p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>You will then need to create an SSH tunnel by clicking on 'Tunneling' and then 'New SSH Tunnel', and fill in the fields (using your unix user name) as follows:<p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><![if !vml]><img border=0 width=553 height=359 src="wiki_files/image007.jpg" v:shapes="Picture_x0020_2"><![endif]><p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Before you start the transfer you will need to: <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>1 - start the tunnel by clicking on 'Tunneling' and pressthe <![if !vml]><img border=0 width=23 height=25 src="wiki_files/image005.png" v:shapes="Picture_x0020_3"><![endif]>button <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>2- provide an OTP to open the tunnel <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>3- start the FTP connection by double clicking on the SFTP session <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>4- enter your unix password <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>The connection will eventually time out (you will see that the <![if !vml]><img border=0 width=23 height=25 src="wiki_files/image005.png" v:shapes="Picture_x0020_4"><![endif]>button will no longer be pressed) after which you will need to re-do steps 1-4 to re-open it. <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Basic linux commands:<o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>For an introduction to some basic linux commands, take a look at the Intro_hm_cluster.pptx presentation.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Understanding the file system:<o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>The file system is divided into two main directories – icore and lustre. <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Your icore directory can be found in /cs/icore/<your unix user name>. Icore is backed up with snapshots so a few previous versions of all files will be saved even after they are modified/deleted (assuming that the file system is up and running), however it has limited space. Icore should be used mainly to store your scripts. You should keep a copy of your scripts on Git, which allows you to save different versions. To use Git to back up scripts, see <a href="http://wiki.cs.huji.ac.il/wiki/Github">here</a>. <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Your lustre directory can be found in /mnt/lustre/hms-01/fs01/<your unix user name>. 'Lustre should be used mainly to store the data that you are currently working on as it is meant for quick and efficient computations. IMPORTANT:lustre is not backed up! This means that files on lustre that are accidentally deleted will be lost forever, so please be sure to back up all important files (e.g. on an external hard drive). <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>There are graphical interfaces that can make navigating the file system easier. For example, the nautilus file manager (can be opened with the command 'nautilus >& /dev/null &') and gedit text editor ('gedit >& /dev/null &'). For more information, take a look at the Intro_hm_cluster.pptx presentation.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Using slurm on the hm cluster:<o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>The hm cluster currently has 44 nodes on which jobs can run. Slurm is a job scheduler that decides which node(s) a job will run on based on the job's requested resources (e.g. number of cpus, amount of memory, etc…), the availability of idle nodes, and the priority of the user which depends on how many jobs were run in the past. <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>All jobs should be submitted as sbatch scripts to slurm where they will be queued and will start running as soon as all of their requested resources become available.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi:

embed'>Some resource arguments that most users will want to tweak are:
mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>Argument <o:p></o:p><td width=75 valign=top style='width:57.55pt;border:solid windowtext 1.0pt; border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt: solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>Default value<o:p></o:p><td width=88 valign=top style='width:66.6pt;border:solid windowtext 1.0pt; border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt: solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>Maximum value<o:p></o:p><td width=94 valign=top style='width:71.2pt;border:solid windowtext 1.0pt; border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt: solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>Description<o:p></o:p><td width=133 valign=top style='width:95.85pt;border:solid windowtext 1.0pt; border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt: solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>Notes<o:p></o:p> border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt; padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>-c, --cpus-per-task<td width=75 valign=top style='width:57.55pt;border-top:none;border-left: none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>2<td width=88 valign=top style='width:66.6pt;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>32<td width=94 valign=top style='width:71.2pt;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>number of cpus for job<td width=133 valign=top style='width:95.85pt;border-top:none;border-left: none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>Maximum depends on CPU used in cluster, hm I-CORE cluster is 32. border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt; padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>--mem<td width=75 valign=top style='width:57.55pt;border-top:none;border-left: none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>50MB<td width=88 valign=top style='width:66.6pt;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>~64GB or ~128GB<td width=94 valign=top style='width:71.2pt;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>memory allocation for job<td width=133 valign=top style='width:95.85pt;border-top:none;border-left: none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>Depends on memory of nodes, we have nodes with 64GB and 128GB of memory, you can't request all the memory since some is needed for the OS, if you want it all and don't care which node you can use: MaxMemPerNode. See below for more details. border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt; padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>-t, --time<td width=75 valign=top style='width:57.55pt;border-top:none;border-left: none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>2 hours<td width=88 valign=top style='width:66.6pt;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>31 days<td width=94 valign=top style='width:71.2pt;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>time limit for job<td width=133 valign=top style='width:95.85pt;border-top:none;border-left: none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>Currently 31 days may be reverted to 21 days later. border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt; padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>-N, --nodes<td width=75 valign=top style='width:57.55pt;border-top:none;border-left: none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>1<td width=88 valign=top style='width:66.6pt;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>44<td width=94 valign=top style='width:71.2pt;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>number of nodes to run job on<td width=133 valign=top style='width:95.85pt;border-top:none;border-left: none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>Currently 44, may be increased in the future, either due to additional hardware purchases or reassigning of submit/test hosts to 'active duty' compute nodes.
<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi:

embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>For more information on all sbatch arguments, e.g., the proper format for writing time limits, etc…, read the <a href="https://slurm.schedmd.com/sbatch.html">sbatch manual</a>.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Submitting a job to the slurm queue:<o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>There are 2 general ways to submit jobs using sbatch:<p class=MsoListParagraph dir=LTR style='margin-top:0cm;margin-right:0cm; margin-bottom:8.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; text-indent:-18.0pt;mso-list:l0 level1 lfo1;direction:ltr;unicode-bidi:embed'><![if !supportLists]>1.       <![endif]>one-liner<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Resources can be requested as arguments on the command line, for example:<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>sbatch -N 2 --mem 8GB --wrap script.sh<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; background:white;direction:ltr;unicode-bidi:embed'>The above command will submit script.sh as a job to slurm with two nodes and 8GB of RAM requested. The --wrap argument is needed so that the script (or command) is wrapped in ansbatch script.<p class=MsoNormal dir=LTR style='margin-top:0cm;margin-right:0cm;margin-bottom: 0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-align:left;line-height:normal; tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; background:white;direction:ltr;unicode-bidi:embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; background:white;direction:ltr;unicode-bidi:embed'>To run a command with arguments, you need to enclose the command and its arguments in quotes, for example:<p class=MsoNormal dir=LTR style='margin-top:0cm;margin-right:0cm;margin-bottom: 0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-align:left;line-height:normal; tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;

background:white;direction:ltr;unicode-bidi:embed'><o:p> </o:p>
<span class=SpellE><span class=GramE><span 
style='color:#222222'>sbatch</span></span></span><span style='color:#222222'> –o output.txt --wrap 'head -n 20 file.txt'<o:p></o:p></span>
<span style='color:#222222'><o:p> </o:p></span>
<span style='font-size:11.0pt;font-family: 

"Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family: Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin; mso-bidi-font-family:Arial;mso-bidi-theme-font:minor-bidi'>The above code will submit the command 'head -n 20 file.txt' as a job to <span

class=SpellE>slurm</span> and will write the output of the command (the first 20 lines of ''file.txt'') to the file ''output.txt''. <o:p></o:p></span>
<p class=MsoNormal dir=LTR style='margin-left:90.0pt;text-align:left;

direction:ltr;unicode-bidi:embed'><o:p> </o:p><p class=MsoListParagraph dir=LTR style='margin-top:0cm;margin-right:0cm; margin-bottom:8.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; text-indent:-18.0pt;mso-list:l0 level1 lfo1;direction:ltr;unicode-bidi:embed'><![if !supportLists]>2.       <![endif]>sbatch script (recommended)<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Resources can be requested by adding special argument comments to bash scripts. These start with #SBATCH and then contain the sbatch argument, and will be parsed by sbatch until the script starts, so an #SBATCH argument written after the first command of the script will be ignored by sbatch.

Here is an example of a bash script called my-sbatch-script.sh with sbatch arguments:
<span class=GramE><span style='color: 
#222222'>#!/</span></span><span style='color:#222222'>bin/bash<o:p></o:p></span>
<span style='color:#222222'>#SBATCH --mem 10GB<o:p></o:p></span>
<span class=GramE><span style='color:#222222'>echo</span></span><span 
style='color:#222222'> "hello world" <o:p></o:p></span>
<span style='color:#222222'># <span 
class=GramE>The</span> following line will not be parsed by <span class=SpellE>sbatch</span><o:p></o:p></span>
<span style='color:#222222'>#SBATCH --time 10<o:p></o:p></span>
<p class=MsoNormal dir=LTR style='margin-left:90.0pt;text-align:left;

direction:ltr;unicode-bidi:embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>The above script can then be submitted to the slurm

queue from the command line as follows:
<span class=SpellE><span class=GramE><span 
style='color:#222222'>sbatch</span></span></span><span style='color:#222222'> my-sbatch-script.sh<o:p></o:p></span>
<p class=MsoNormal dir=LTR style='margin-left:18.0pt;text-align:left;

direction:ltr;unicode-bidi:embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>my-sbatch-script.sh will be submitted as a job to the slurm queue with 10GB of RAM requested. The time limit for the job will be the default two hours since the time parameter will not be parsed by sbatch as it is written after a command in the script.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Requesting resources:<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Make sure that your job does not request more resources than the maximum (please refer to table above). Jobs that request more than the maximum number of resources will not run.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Requests should be kept to as close to the needs of your job as possible for two main reasons: <p class=MsoListParagraphCxSpFirst dir=LTR style='margin-top:0cm;margin-right: 0cm;margin-bottom:8.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; text-indent:-18.0pt;mso-list:l1 level1 lfo2;direction:ltr;unicode-bidi:embed'><![if !supportLists]>1-      <![endif]>jobs are prioritized in the queue mainly based on requested resources, meaning that the more resources requested, the longer the job will take to start running since it needs to wait for all resources to become available<p class=MsoListParagraphCxSpLast dir=LTR style='margin-top:0cm;margin-right: 0cm;margin-bottom:8.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; text-indent:-18.0pt;mso-list:l1 level1 lfo2;direction:ltr;unicode-bidi:embed'><![if !supportLists]>2-      <![endif]>while a job is running, all of its allocated resources will be unavailable to other users even if the job is not using them<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Requesting multiple nodes:<o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Requesting multiple nodes for a specific job does not automatically divide the job among the nodes. There are a few ways to use multiple nodes simultaneously in order to save computation time: <p class=MsoListParagraphCxSpFirst dir=LTR style='margin-top:0cm;margin-right: 0cm;margin-bottom:8.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; text-indent:-18.0pt;mso-list:l2 level1 lfo3;direction:ltr;unicode-bidi:embed'><![if !supportLists]>1-      <![endif]>using mpirun<p class=MsoListParagraphCxSpMiddle dir=LTR style='margin-top:0cm;margin-right: 0cm;margin-bottom:8.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; text-indent:-18.0pt;mso-list:l2 level1 lfo3;direction:ltr;unicode-bidi:embed'><![if !supportLists]>2-      <![endif]>using srun<p class=MsoListParagraphCxSpLast dir=LTR style='margin-top:0cm;margin-right: 0cm;margin-bottom:8.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; text-indent:-18.0pt;mso-list:l2 level1 lfo3;direction:ltr;unicode-bidi:embed'><![if !supportLists]>3-      <![endif]>using an outer submit script – this is recommended as it is the simplest method<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>1- usingmpirun:<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>If you know that you are running a program that depends on OpenMPI, you can use mpirun to run the program on multiple nodes in parallel – see the <a href="https://www.mpi-forum.org/docs/">mpi manual</a> for more information.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>2- usingsrun:<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Srun can be used within ansbatch script to utilize a subset of the total requested resources. It can be used to run a command using multiple nodes in parallel which is most useful if you want to run a script/command on many files

at the same time, each as its own job on one node, for example:
<span class=GramE><span style='color: 
#222222'>#!/</span></span><span style='color:#222222'>bin/bash<o:p></o:p></span>
<span style='color:#222222'>#SBATCH -N 5<o:p></o:p></span>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;

text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>files=(file0 file1 file2 file3 file4)<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>fori in {0..4}<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>do<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;text-indent:36.0pt;line-height:normal;background:white; direction:ltr;unicode-bidi:embed'>srun -N 1 –o output.$i.txt head –n 20 ${files[$i]} &<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>done<o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>The above script will allocate five nodes as requested, and then will send five jobs to the slurm queue at the same time, each running on one node. The output of each job (the first twenty lines of the corresponding file) will be printed in the output.{i}.txt

file. If you submit the above script as a job without using the srun command, for example:
<span class=GramE><span style='color: 
#222222'>#!/</span></span><span style='color:#222222'>bin/bash<o:p></o:p></span>
<span style='color:#222222'>#SBATCH -N 5<o:p></o:p></span>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;

text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>files=(file0 file1 file2 file3 file4)<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>fori in {0..4}<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>do<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;text-indent:36.0pt;line-height:normal;background:white; direction:ltr;unicode-bidi:embed'>head –n 20 ${files[$i]} &<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>done<o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Once the above job starts running, it will hold five nodes unavailable to other users as requested, but it will only run on one node.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>3- using an outer submit script: <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>The simplest way to run a script/command on many files at the same time, each as its own job on one node, is by using a for

loop in a script that submits all of the jobs at once. For example:
<span class=GramE><span style='color: 
#222222'>#!/</span></span><span style='color:#222222'>bin/bash<o:p></o:p></span>
<span style='color:#222222'><o:p> </o:p></span>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;

text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>files=(file0 file1 file2 file3 file4)<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>for file in ${files[*]}<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>do<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;text-indent:36.0pt;line-height:normal;background:white; direction:ltr;unicode-bidi:embed'>sbatch head.sh $file <o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'>done<o:p></o:p><p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;background:white;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>The above script loops through all files in the list 'files' and submits the script head.sh (with 'file' as an argument) as an sbatch job. The head.sh script will contain the sbatch arguments needed to run on one

file. For example:
<span class=GramE><span style='color: 
#222222'>#!/</span></span><span style='color:#222222'>bin/bash<o:p></o:p></span>
<span style='color:#222222'>#SBATCH –o output.txt<o:p></o:p></span>
<span style='color:#222222'>#SBATCH –N 1<o:p></o:p></span>
<p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi:

embed'>file=$1 #first argument from outer script<o:p></o:p><p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>head –n 20 $file<o:p></o:p><p class=MsoNoSpacing dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>The head.sh script will be run as a job on one node (based on the sbatch arguments written in the script) on each of the 5 files in parallel. <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Requesting multiple cpus:<o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>If you are running a program that supports multithreading, you can request multiple cpus (up to the maximum) and then run the program while specifying the number of cpus

you want it to use as a parameter. For example:
<span class=GramE><span style='color: 
#222222'>#!/</span></span><span style='color:#222222'>bin/bash<o:p></o:p></span>
<span style='color:#222222'>#SBATCH –c 32 #request 32 <span 
class=SpellE>cpus</span><o:p></o:p></span>
<span style='color:#222222'>#SBATCH –o output.txt<o:p></o:p></span>
<span class=GramE><span style='color:#222222'>sample</span></span><span 
style='color:#222222'>=$1<o:p></o:p></span>
<span style='color:#222222'>bowtie2 -p 32 -x $genome -U $sample -S $<span 
class=SpellE>sam</span> >& bowtie2.log<o:p></o:p></span>
<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi:

embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>The above script can be submitted as a job that will run bowtie2 using 32 cpus on 'sample' (with the bowtie2 output saved in the file bowtie2.log).<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Requesting memory:<o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>If the amount of memory requested is not enough for the job, it will be killed with an error message that the job exceeded the memory limit and you will need to increase the memory request. There is currently no simple method to know how much memory a job will need before it runs. Once ansbatch job is running you can check its accounting information with the 'sacct' command. <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>For more information, read the <a href="http://wiki.cs.huji.ac.il/wiki/Slurm">CS slurm wiki</a>.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>FAQs <o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>1.How do I check the status of my job?<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>By running the command 'squeue –u username' with your username you will see all of your submitted jobs and their status (ST column). PD means your job is pending in the queue waiting to start, and R means it is running. For a list of all status codes, read the 'JOB STATE CODES' section of the <a href="https://slurm.schedmd.com/squeue.html">squeue manual</a>.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>2.How do I cancel a job?<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Jobs can be cancelled by running the command 'scanceljobid' where the jobid is the number that slurm assigned your job when it was submitted which you can see by running 'squeue –u username' and looking at the JOBID column.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>3.Why is my job taking so long to start running?<o:p></o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>Jobs are prioritized in the slurm queue mainly based on the amount of resources requested. The more resources your job requests, the longer it will take to start running.<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>4.How much memory/cpus did my job actually use? <p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>When a job is running, you can use the following commands to see its accounting information:<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>sacct – see the <a href="https://slurm.schedmd.com/sacct.html">sacct manual</a> for more details<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>sstat – see the <a href="https://slurm.schedmd.com/sstat.html">sstat manual</a> for more details<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>5.Can I submit a job and tell it to run at a later time?<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'>You can tell a job what time you want it to start running with the

parameter --begin:
<span style='color:#222222'>#SBATCH --begin HH:MM MM/DD/YY<o:p></o:p></span>
<span style='color:#222222'><o:p> </o:p></span>
<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi:

embed'>Alternatively, you can add dependencies to your jobs so that, for example, job #2 will not start until job

  1. 1 satisfies the provided condition, by using the job id. This can be done in a
bash script:
<span class=GramE><span style='color: 
#222222'>#!/</span></span><span style='color:#222222'>bin/bash<o:p></o:p></span>
<span style='color:#222222'>jobid1=$(<span 
class=SpellE>sbatch</span> job1.sh)<span style='mso-tab-count:1'></span><o:p></o:p></span>
<span class=SpellE><span class=GramE><span 

style='color:#222222'>sbatch</span></span></span><span style='color:#222222'> –-dependency afterok:jobid1 job2.sh<span

style='mso-tab-count:1'></span><o:p></o:p></span>
<span style='color:#222222'><o:p> </o:p></span>
<span style='font-size:11.0pt;font-family: 

"Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family: Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin; mso-bidi-font-family:Arial;mso-bidi-theme-font:minor-bidi'>The above script submits ''job1.sh'' as a job and saves <span class=SpellE>jobid</span> in the variable jobid1. It then submits ''job2.sh'' as a job only once job1 finishes running with an exit code of 0 as defined by the condition '<span class=SpellE>afterok</span>'. For more information on possible conditions, <span class=SpellE>etc</span>… please refer to the </span><a href="https://slurm.schedmd.com/sbatch.html"><span class=SpellE><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-ascii-theme-font: minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin; mso-hansi-theme-font:minor-latin;mso-bidi-font-family:Arial;mso-bidi-theme-font: minor-bidi'>sbatch</span></span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:Arial; mso-bidi-theme-font:minor-bidi'> manual</span></a><span style='font-size:11.0pt; font-family:"Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family: Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;

mso-bidi-font-family:Arial;mso-bidi-theme-font:minor-bidi'>.<o:p></o:p></span>
<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi:

embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi: embed'><o:p> </o:p><p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi:

embed'><o:p> </o:p></div></body></html>