{"id":160,"date":"2020-08-07T13:44:46","date_gmt":"2020-08-07T12:44:46","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf4\/?page_id=160"},"modified":"2021-11-18T15:10:38","modified_gmt":"2021-11-18T15:10:38","slug":"serial-jobs","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/batch\/serial-jobs\/","title":{"rendered":"Serial Jobs"},"content":{"rendered":"<h2>Serial batch job submission<\/h2>\n<p>A serial job uses one CPU core. To run a serial job in the batch system you should <strong>not<\/strong> specify a partition or a <em>queue<\/em> (which you may have done on other systems).<\/p>\n<p>We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run and it also minimises the potential for conflict between different pieces of software and libraries. See the example jobscript below for how to do this. <\/p>\n<p>You should run jobs from within your <em>scratch<\/em> area:<\/p>\n<pre>cd ~\/scratch\/my_code\/run01       # for example<\/pre>\n<p>An example single core job script:<\/p>\n<pre>\r\n#!\/bin\/bash --login\r\n#SBATCH -n 1        # (or --ntasks=1) Use just 1 core\r\n\r\n# OPTIONAL LINE: the default partition is serial\r\n#SBATCH -p serial   # (or --partition=serial)\r\n\r\n# The default output file will be named slurm-<em>JOBID<\/em>.out\r\n# To use SGE-style file names, use the following\r\n#     #SBATCH -o %x.o%j       # %x is job name (default name is the jobscript filename)\r\n#     #SBATCH -e %x.e%j       # If no -e flag used, everything goes in the -o file\r\n\r\n# Load any required modulefiles\r\nmodule load <em>someapp\/1.2.3<\/em>\r\n\r\n# Now the commands to be run by the job\r\ntheapp.exe\r\n<\/pre>\n<p>To submit the job to the batch system:<\/p>\n<pre>\r\nsbatch <em>jobscript<\/em>\r\n<\/pre>\n<p>Where <em>jobscript<\/em> is replaced with the name of your submission script.<\/p>\n<h3>Command-line one-liner&#8230;<\/h3>\n<p>The above serial job can also be achieved all on the command-line on the login node (a quick way of running a serial job in batch). Note that you will need to load any modulefiles <em>before<\/em> submitting the job. The batch system takes a copy of any settings made by the modulefile so that they are <em>visible<\/em> to the job when it eventually runs. You could logout of the CSF before the job runs and it will still have a copy of the modulefile settings allowing the job to run correctly. <\/p>\n<pre>\r\nmodule load <em>someapp\/1.2.3<\/em>\r\nsbatch -J <em>jobname<\/em> --wrap=\"theapp.exe <em>optional-args<\/em>\"\r\n         #\r\n         # Optional. If not given the job will be named 'wrap' in the squeue listing.\r\n<\/pre>\n<p>where <code><em>optional-args<\/em><\/code> are any command line flags that you want to pass to the <code>theapp.exe<\/code> program (or your own program). The <code>--wrap=\"...\"<\/code> wraps your commands up as though they were in a jobscript.<\/p>\n<h2>Serial Hardware<\/h2>\n<p>Serial jobs can run on Intel <em>Cascade Lake<\/em> compute-nodes. The type of Intel hardware used (amount of memory available to the job, CPU architecture, runtime) can be controlled with extra jobscript flags as shown below. But in general you don&#8217;t need to specify any of these flags in your jobscript unless you know your job needs more memory or a specific type of CPU for example.<\/p>\n<table width=\"100%\">\n<tbody>\n<tr>\n<a name=\"serial\"><\/a><\/p>\n<td colspan=\"3\" valign=\"top\"><strong>Serial (1-core) jobs<\/strong><\/p>\n<ul>\n<li>For 1 core jobs (includes serial <a href=\"\/csf4\/batch\/job-arrays\/\">job arrays<\/a>)<\/li>\n<li>7 day runtime limit.<\/li>\n<li>4GB core by default (as of Nov 2021)<\/li>\n<li>Jobs will currently run on Cascade-Lake nodes by default. Which nodes serial jobs can use will change as more hardware is added.<\/li>\n<li>If you need more than 4GB of memory you can request more cores  &#8211; see <a href=\"\/csf4\/batch\/parallel-jobs\/\">parallel jobs<\/a><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<th width=\"25%\"><a name=\"optres\"><\/a>Optional Resources<\/th>\n<th  width=\"40%\">Node type<\/th>\n<th>Additional usage guidance<\/th>\n<\/tr>\n<tr>\n<td colspan=\"3\">None<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Running lots of similar serial jobs<\/h2>\n<p>If you wish to run a large number of largely identical jobs: for example, the same program many times with different arguments or parameters; or perhaps process a thousand different input files then please use <a href=\/csf4\/batch\/job-arrays\/>Job Arrays<\/a>. These cut down on the amount of job setup you need to do and are much more efficient for the batch system than lots of individual jobs. <\/p>\n<h2>Serial Java and Matlab Jobs<\/h2>\n<p>Some applications need to be told <em>explicitly<\/em> to use only a single core otherwise they will try to grab all of the cores available in a compute node.<\/p>\n<p>When you submit a serial jobscript to the queue the batch system will reserve a single core for you (and only run your jobscript when a core becomes available). But you must also ensure your application only uses a single core when it runs.<\/p>\n<p>If you know your code (or application) is serial then you have nothing more to do &#8211; it will correctly use one core only. However applications such as Java and MATLAB will try to grab <em>all<\/em> of the cores in a compute node unless you <em>explicitly<\/em> tell them to use only one core. You may end up trampling on other users&#8217; jobs that are also running on the same compute node.<\/p>\n<p>Please read carefully any application-specific documentation to check your code will use only a single core if run using a serial jobscript. In particular please read our <a href=\"\/csf3\/software\/applications\/java\">Java notes<\/a> and <a href=\"\/csf3\/software\/applications\/matlab\">MATLAB notes<\/a>. Jobs found running on more cores than have been requested in the jobscript will be killed without notice.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Serial batch job submission A serial job uses one CPU core. To run a serial job in the batch system you should not specify a partition or a queue (which you may have done on other systems). We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run and it also minimises the potential for conflict between different pieces of software and libraries. See the.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/batch\/serial-jobs\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"parent":31,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-160","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":8,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/160\/revisions"}],"predecessor-version":[{"id":748,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/160\/revisions\/748"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/31"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/media?parent=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}