{"id":26,"date":"2018-08-28T16:36:15","date_gmt":"2018-08-28T15:36:15","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=26"},"modified":"2025-05-22T15:55:42","modified_gmt":"2025-05-22T14:55:42","slug":"serial-jobs","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/batch\/serial-jobs\/","title":{"rendered":"Serial Jobs"},"content":{"rendered":"<p><script type=\"text\/javascript\">\n    function toggle() {\n        var x = document.getElementById(\"hidetext\");\n        if (x.style.display === \"none\") {x.style.display = \"block\";}\n        else {x.style.display = \"none\";}\n    }\n<\/script><\/p>\n<div class=\"warning\">The SGE batch system has been shutdown and the CSF upgraded to use the Slurm batch system. Please read the <a href=\"\/csf3\/batch-slurm\">CSF3 Slurm documentation<\/a> instead.<\/p>\n<p>To display this old SGE page, <a href=\"javascript:toggle()\">click here<\/a>\n<\/div>\n<div id=\"hidetext\" style=\"display: none\">\n<h2>Serial batch job submission (SGE)<\/h2>\n<p>A serial job uses one CPU core.<\/p>\n<p>Unless your jobscript says otherwise, a job will by default be a serial job. To run a serial job in the batch system you should <strong>not<\/strong> specify a Parallel Environment (PE) 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. Alternatively, you may load modulefiles on the login node and let the job <abbr title=\"add '#$ -V' to your jobscript\">inherit these settings<\/abbr>.<\/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<h3>An example single core job script<\/h3>\n<p>The following will use one Intel CPU core and the job will have a maximum wallclock time of 7 days.<\/p>\n<pre>\r\n#!\/bin\/bash --login\r\n#$ -cwd              # Job will run in the current directory (where you ran qsub)\r\n                     # Nothing else specified = default 1 core\r\n                     # Job will run on Intel CPUs, 7-day default wallclock limit.\r\n\r\n# Load any required modulefiles\r\nmodule load <em>apps\/some\/example\/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>qsub <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).<\/p>\n<p>Note that you will need to load any modulefiles <em>before<\/em> submitting the job. The <code>-V<\/code> tells the batch system to take 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>module load <em>apps\/some\/example\/1.2.3<\/em>\r\nqsub -b y -V -cwd theapp.exe <em>optional-args<\/em>\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>-b y<\/code> flag indicates the filename submitted (<code>theapp.exe<\/code>) is a binary (executable) program, not a jobscript.<\/p>\n<h3>Serial Hardware<\/h3>\n<p>Serial jobs can run on various Intel 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<td colspan=\"3\" valign=\"top\"><strong>Serial (1-core) jobs<\/strong><\/p>\n<ul>\n<li>For 1 core jobs (includes serial <a href=\"\/csf3\/batch\/job-arrays\/\">job arrays<\/a>)<\/li>\n<li>7 day runtime limit.<\/li>\n<li>4GB or 5GB per core by default.<\/li>\n<li>Jobs will currently run on haswell nodes by default. (11.08.2021 &#8211; sandybridge nodes no longer available, 01.11.2022 Ivybridge no longer available)<\/li>\n<li>Note that Broadwell and Skylake CPUs <strong>cannot<\/strong> be used to run any serial jobs, only <a href=\"\/csf3\/batch\/parallel-jobs\/\">parallel jobs<\/a>.<\/li>\n<li>If you need more than 5GB of memory you can request a higher memory node see <a href=\"#optres\">optional resources<\/a> below<\/li>\n<li><strong>Note: Choosing a node type is not recommended as it can mean a much longer wait in the queue.<\/strong><\/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><code>-l <a href=\"\/csf3\/batch\/high-memory-jobs\/\">mem512<\/a><\/code><br \/>\n<code>-l <a href=\"\/csf3\/batch\/high-memory-jobs\/\">mem512<\/a> -l ivybridge<\/code><br \/>\n<code>-l <a href=\"\/csf3\/batch\/high-memory-jobs\/\">mem512<\/a> -l haswell<\/code><\/td>\n<td>32GB\/core (system chooses ivybridge or haswell)<br \/>\n32GB\/core (ivybridge nodes)<br \/>\n32GB\/core (haswell nodes)<\/td>\n<td>Jobs must genuinely need extra memory.<\/td>\n<\/tr>\n<tr>\n<td><code>-l\u00a0haswell<\/code><\/td>\n<td>4GB\/core<\/td>\n<td>Use only Haswell cores.<\/td>\n<\/tr>\n<tr>\n<td><code>-l\u00a0<a href=\"\/csf3\/batch\/short-jobs\/\">short<\/a><\/code><\/td>\n<td>4GB\/core, 1 hour runtime<\/td>\n<td>Currently just two haswell nodes of 24 cores. For test jobs and interactive use ONLY. Do not submit production work here.<\/td>\n<\/tr>\n<tr>\n<td><code>-l <a href=\"\/csf3\/batch\/new-amd-nodes-sept-2024\/\">amd<\/a> -l\u00a0<a href=\"\/csf3\/batch\/short-jobs\/\">short<\/a><\/code><\/td>\n<td>8GB\/core, 1 hour runtime<\/td>\n<td>Currently just one AMD Genoa node of 168 cores. For test jobs and interactive use ONLY. Do not submit production work here.<\/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=\"\/csf3\/batch\/job-arrays\/\">SGE 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.\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The SGE batch system has been shutdown and the CSF upgraded to use the Slurm batch system. Please read the CSF3 Slurm documentation instead. To display this old SGE page, click here Serial batch job submission (SGE) A serial job uses one CPU core. Unless your jobscript says otherwise, a job will by default be a serial job. To run a serial job in the batch system you should not specify a Parallel Environment (PE).. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/batch\/serial-jobs\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":22,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-26","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":21,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/26\/revisions"}],"predecessor-version":[{"id":10078,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/26\/revisions\/10078"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/22"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}