{"id":570,"date":"2022-06-16T13:59:16","date_gmt":"2022-06-16T05:59:16","guid":{"rendered":"http:\/\/www.rchen.top\/?p=570"},"modified":"2022-06-24T09:59:43","modified_gmt":"2022-06-24T01:59:43","slug":"lsf%e9%85%8d%e7%bd%aejob%e7%9a%84%e6%9c%80%e5%a4%a7%e5%86%85%e5%ad%98%e9%99%90%e5%88%b6","status":"publish","type":"post","link":"https:\/\/www.rchen.top\/?p=570","title":{"rendered":"LSF\u914d\u7f6ejob\u7684\u6700\u5927\u5185\u5b58\u9650\u5236\uff08\u8f6c\uff09"},"content":{"rendered":"<p>Enforce job level memory limits in LSF<\/p>\n<p>LSF enforcement of job memory limits with job termination:<br \/>\nThis gives LSF control over how much memory jobs can use. LSF terminates any job that reaches the configured memory limit. LSF looks at the sum of the memory all job processes consume to determine if a job has reached the memory limit.<\/p>\n<ul class=\" list-paddingleft-2\">\n<li style=\"list-style-type: none;\">\n<ol class=\" list-paddingleft-2\">\n<li>Add memory limit parameters to lsf.conf:<\/li>\n<li>\n<div class=\"prism-show-language\">\n<div class=\"prism-show-language-label\" data-language=\"Bash\">Bash<\/div>\n<\/div>\n<pre class=\"prism-highlight prism- prism-line-numbers language-bash\" data-language=\"Bash\"><code class=\"prism-  language-bash\">LSB_MEMLIMIT_ENFORCE<span class=\"prism-token prism-operator\">=<\/span>Y\nLSB_JOB_MEMLIMIT<span class=\"prism-token prism-operator\">=<\/span>Y<\/code><\/pre>\n<\/li>\n<li>Specify a memory limit in lsb.queues or lsb.applications:<\/li>\n<li>\n<div class=\"prism-show-language\">\n<div class=\"prism-show-language-label\" data-language=\"Bash\">Bash<\/div>\n<\/div>\n<pre class=\"prism-highlight prism- prism-line-numbers language-bash\" data-language=\"Bash\"><code class=\"prism-  language-bash\">MEMLIMIT <span class=\"prism-token prism-operator\">=<\/span> 5000 <span class=\"prism-token prism-comment\" spellcheck=\"true\">#Memory limit of 5000 KB<\/span><\/code><\/pre>\n<\/li>\n<li>Reconfigure LSF:<\/li>\n<li>\n<div class=\"prism-show-language\">\n<div class=\"prism-show-language-label\" data-language=\"Bash\">Bash<\/div>\n<\/div>\n<pre class=\"prism-highlight prism- prism-line-numbers language-bash\" data-language=\"Bash\"><code class=\"prism-  language-bash\">lsadmin reconfig\nbadmin reconfig\nbadmin hrestart all<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p>You can specify memory limit at the queue level (<code>lsb.queues<\/code>), application profile level (<code>lsb.application<\/code>) or at job submission. Use the \u2013M option when submitting jobs to specify a memory limit. For example,<\/p>\n<div class=\"prism-show-language\">\n<div class=\"prism-show-language-label\" data-language=\"Bash\">Bash<\/div>\n<\/div>\n<pre class=\"prism-highlight prism- prism-line-numbers language-bash\" data-language=\"Bash\"><code class=\"prism-  language-bash\">bsub \u2013M 50000 myjob.sh<\/code><\/pre>\n<p><code><\/code><\/p>\n<p>LSF will allow this job to consume a maximum of 5000 KB of memory before terminating it.<\/p>\n<p>The difference between&nbsp;LSB_JOB_MEMLIMIT&nbsp;set to&nbsp;y&nbsp;and&nbsp;LSB_MEMLIMIT_ENFORCE&nbsp;set to&nbsp;y&nbsp;is that with LSB_JOB_MEMLIMIT, only the per-job memory limit enforced by LSF is enabled. The per-process memory limit enforced by the OS is disabled. With LSB_MEMLIMIT_ENFORCE set to y, both the per-job memory limit enforced by LSF and the per-process memory limit enforced by the OS are enabled.<\/p>\n<p>LSB_JOB_MEMLIMIT disables per-process memory limit enforced by the OS and enables per-job memory limit enforced by LSF. When the total memory allocated to all processes in the job exceeds the memory limit, LSF sends the following signals to kill the job: SIGINT first, then SIGTERM, then SIGKILL.<\/p>\n<p>On UNIX, the time interval between SIGINT, SIGKILL, SIGTERM can be configured with the parameter JOB_TERMINATE_INTERVAL&nbsp;in&nbsp;<code>lsb.params<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Enforce job level memory limits in LSF LSF enforcement  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":472,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[106,108],"class_list":["post-570","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hpc","tag-lsf","tag-108"],"_links":{"self":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=570"}],"version-history":[{"count":2,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/570\/revisions"}],"predecessor-version":[{"id":693,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/570\/revisions\/693"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/media\/472"}],"wp:attachment":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}