{"id":903,"date":"2022-07-11T13:54:59","date_gmt":"2022-07-11T05:54:59","guid":{"rendered":"http:\/\/www.rchen.top\/?p=903"},"modified":"2022-07-11T13:55:02","modified_gmt":"2022-07-11T05:55:02","slug":"lsf-bsub%e4%bd%9c%e4%b8%9a%e6%8f%90%e4%ba%a4%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/www.rchen.top\/?p=903","title":{"rendered":"LSF bsub\u4f5c\u4e1a\u63d0\u4ea4\u7684\u51e0\u79cd\u65b9\u5f0f"},"content":{"rendered":"<p><b>bsub <\/b><b>\u4f5c\u4e1a\u63d0\u4ea4<\/b><\/p>\n<p>busb \u547d\u4ee4\u7528\u4e8e\u5411 LSF \u4f5c\u4e1a\u7ba1\u7406\u7cfb\u7edf\u63d0\u4ea4\u4f5c\u4e1a\u8bf7\u6c42\u3002 bsub \u53ef\u63a5\u6536\u7684\u53c2\u6570\u5f88\u591a\uff0c\u901a\u8fc7\u6307\u5b9a\u4e0d\u540c\u7684\u8fd0\u884c\u53c2\u6570\uff0c\u53ef\u4ee5\u7cbe\u7ec6\u5730\u8bbe\u5b9a\u4f5c\u4e1a\u8fd0\u884c\u9700\u6c42\u3002<\/p>\n<p>$ bsub -h \u547d\u4ee4\u53c2\u6570<\/p>\n<p>-q \u9009\u62e9\u961f\u5217<\/p>\n<p>-i \u6307\u5b9a\u8f93\u5165\u6587\u4ef6<\/p>\n<p>-o \u6307\u5b9a\u8f93\u51fa\u6587\u4ef6,\u4f5c\u4e1a\u63d0\u4ea4\u540e\u6807\u51c6\u8f93\u51fa\u7684\u4fe1\u606f\u4f1a\u4fdd\u5b58\u5230\u8fd9\u4e2a\u6587\u4ef6\u4e2d<\/p>\n<p>-e \u6307\u5b9a\u8f93\u51fa\u6587\u4ef6,\u4f5c\u4e1a\u63d0\u4ea4\u540e\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u7684\u4fe1\u606f\u4fdd\u5b58\u5230\u8fd9\u4e2a\u6587\u4ef6\u5939\u4e2d.<\/p>\n<p>-n \u6307\u5b9a\u4f5c\u4e1a\u9700\u8981\u7684CPU \u6838<\/p>\n<p>-J \u4f5c\u4e1a\u7684\u540d\u5b57<\/p>\n<p>-m \u4e22job\u5230\u6307\u5b9a\u7684\u673a\u5668\u4e0a<\/p>\n<p>-I \u4ea4\u4e92\u5f0f\u6a21\u5f0f,\u6b64\u65f6\u7ec8\u7aef\u4e0d\u80fd\u8f93\u5165<\/p>\n<p>-Ip \u63d0\u4ea4job\u7684\u65f6\u5019\u63d0\u4f9b\u865a\u62dfterminal\u652f\u6301,\u5982vim\u8fd9\u79cd\u5e94\u7528\u662f\u9700\u8981terminal\u652f\u6301\u7684.<\/p>\n<p>-R \u6307\u5b9a\u4e3a\u5f53\u524d\u4efb\u52a1\u7684\u8d44\u6e90\u9700\u6c42\u3002<\/p>\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n<p><b>1<\/b><b>\u3001<\/b><b>\u76f4\u63a5\u8f93\u5165\u5b8c\u6574\u53c2\u6570<\/b><b>\u63d0\u4ea4<\/b><\/p>\n<p>\u76f4\u63a5\u8f93\u5165 bsub \u5b8c\u6574\u53c2\u6570\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u63d0\u4ea4\u5355\u7ebf\u7a0b\u4f5c\u4e1a\u3002 \u4e0b\u9762\u8fd9\u6761\u547d\u4ee4\u63d0\u4ea4\u4e86\u4e00\u4e2a\u9700\u8981\u4e00\u4e2a CPU \u6838\u8fd0\u884c\u7684\u5355\u7ebf\u7a0b\u4f5c\u4e1a\uff1a<\/p>\n<p>$ bsub -n 1 -q cpu -o job.out .\/myprog &#8220;-input data.txt&#8221;<\/p>\n<p>\u4e3b\u8981\u53c2\u6570\u8bf4\u660e\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>-n \u6307\u5b9a\u6240\u9700\u7684\u8ba1\u7b97\u6838\u5fc3\u6570\u3002<\/li>\n<li>-q \u6307\u5b9a\u4f5c\u4e1a\u8fd0\u884c\u7684\u961f\u5217\uff0c\u5728\u96c6\u7fa4\u4e0a\u53ef\u7528\u7684\u8ba1\u7b97\u961f\u5217\u6709 cpu\u3001fat\u3001gpu\u548c mic\u7b49\u3002<\/li>\n<li>-o \u6307\u5b9a\u4f5c\u4e1a\u8fd0\u884c\u4fe1\u606f\u7684\u8f93\u51fa\u6587\u4ef6\u3002<\/li>\n<li>.\/myprog \u662f\u8981\u63d0\u4ea4\u8fd0\u884c\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c<\/li>\n<li>&#8220;-input data.txt&#8221;\u662f\u4f20\u9012\u7ed9 myprog \u7684\u547d\u4ee4\u884c\u53c2\u6570\u3002<\/li>\n<\/ul>\n<p>\u5f53\u7136\uff0c\u8fd9\u79cd\u7528\u6cd5\u4ec5\u9002\u7528\u4e8e\u7b80\u5355\u7684\u4f5c\u4e1a\uff0c\u66f4\u590d\u6742\u7684\u4f5c\u4e1a\u63a7\u5236\u9700\u8981\u7f16\u5199\u4f5c\u4e1a\u811a\u672c\uff0c\u8bf7\u53c2\u8003\u4e0b\u9762\u201c\u4f7f\u7528\u4f5c\u4e1a\u811a\u672c\u63d0\u4ea4\u201d\u3002<\/p>\n<p><b>2<\/b><b>\u3001\u4f5c\u4e1a\u811a\u672c\u63d0\u4ea4<\/b><\/p>\n<p>\u4f5c\u4e1a\u811a\u672c\u662f\u5e26\u6709\u201cbsub \u683c\u5f0f\u201d\u7684\u7eaf\u6587\u672c\u6587\u4ef6\u3002 \u4f5c\u4e1a\u811a\u672c\u6613\u4e8e\u7f16\u8f91\u548c\u590d\u7528\uff0c\u662f\u63d0\u4ea4\u590d\u6742\u4f5c\u4e1a\u7684\u6700\u4f73\u5f62\u5f0f\u3002 \u4e0b\u9762\u662f\u540d\u4e3a job.script \u7684\u4f5c\u4e1a\u811a\u672c\u7684\u5185\u5bb9\uff1a<\/p>\n<p>#BSUB -n 4<\/p>\n<p>#BSUB -q cpu<\/p>\n<p>#BSUB -o job.out<\/p>\n<p># input file is data.txt<\/p>\n<p>.\/mytest &#8220;-input data.txt&#8221;<\/p>\n<p>\u5176\u4e2d\u4ee5#BSUB \u5f00\u5934\u7684\u884c\u8868\u793a bsub \u4f5c\u4e1a\u53c2\u6570\uff0c\u5176\u4ed6#\u5f00\u5934\u7684\u884c\u4e3a\u6ce8\u91ca\u884c\uff0c\u5176\u4ed6\u884c\u4e3a\u811a\u672c\u8fd0\u884c\u5185\u5bb9\u3002\u4f5c\u4e1a\u811a\u672c\u7684\u4f7f\u7528\u65b9\u6cd5\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u8981\u628a\u811a\u672c\u5185\u5bb9\u901a\u8fc7\u6807\u51c6\u8f93\u5165\u91cd\u5b9a\u5411\u7ed9 busb\uff1a<\/p>\n<p>$ bsub &lt; job.script<\/p>\n<p>\u4ee5\u4e0a\u811a\u672c\u7b49\u4ef7\u4e8e\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>$ bsub -n 1 -q cpu -o job.out .\/mytest &#8220;-input data.txt&#8221;<\/p>\n<p>bsub \u9ed8\u8ba4\u4f1a\u8c03\u7528\/bin\/sh \u6267\u884c\u811a\u672c\u5185\u5bb9\uff0c\u56e0\u6b64\u53ef\u4ee5\u4f7f\u7528 Shell \u7f16\u7a0b\u811a\u672c\u5bf9\u4f5c\u4e1a\u53c2<\/p>\n<p>\u6570\u8fdb\u884c\u5904\u7406\u548c\u63a7\u5236\u3002 \u4e0b\u9762\u8fd9\u4e2a\u4f5c\u4e1a\u811a\u672c\u63d0\u4ea4\u4e86\u4e00\u4e2a\u9700\u8981 64\u6838\u5fc3\u7684 MPI\u8ba1\u7b97\u4efb\u52a1\u3002\u5728\u4e0b\u9762\u540d\u4e3a 64core.script \u7684\u4f5c\u4e1a\u811a\u672c\u4f1a\u7531 LSF \u4f7f\u7528 bash \u89e3\u91ca\u8fd0\u884c\uff0c\u9700\u8981\u4f7f\u752864 \u4e2a\u6838\u5fc3\uff0c\u4e14\u8981\u6c42\u6bcf\u4e2a\u8282\u70b9\u63d0\u4f9b 16 \u4e2a\u8ba1\u7b97\u6838\u5fc3\u3002<\/p>\n<p># 64core.script<\/p>\n<p>#BSUB -L \/bin\/bash<\/p>\n<p>#BSUB -J HELLO_MPI<\/p>\n<p>#BSUB -n 64<\/p>\n<p>#BSUB -e %J.err<\/p>\n<p>#BSUB -o %J.out<\/p>\n<p>#BSUB -R &#8220;span[ptile=16]&#8221;<\/p>\n<p>#BSUB -q cpu<\/p>\n<p>MODULEPATH=\/lustre\/utility\/modulefiles:$MODULEPATH<\/p>\n<p>module purge<\/p>\n<p>module load openmpi\/gcc\/1.6.5<\/p>\n<p>mpirun .\/mpihello<\/p>\n<p>\u7528\u6237\u5728\u547d\u4ee4\u884c\u4e0b\u7528 bsub \u63d0\u4ea4\u4f5c\u4e1a\uff1a<\/p>\n<p>$ bsub &lt; 64core.script<\/p>\n<p>\u5173\u4e8e MPI \u7a0b\u5e8f\u548c\u4f5c\u4e1a\u811a\u672c\u7684\u8be6\u7ec6\u4f8b\u5b50\uff0c\u8bf7\u53c2\u8003\u300a\u5e76\u884c\u7a0b\u5e8f\u793a\u4f8b\u300b\u4e2d\u7684\u5185\u5bb9\u3002<\/p>\n<p><b>3<\/b><b>\u3001\u4ea4\u4e92\u63d0\u4ea4<\/b><\/p>\n<p>\u952e\u5165 bsub \u56de\u8f66\u540e\uff0c\u53ef\u8fdb\u5165 bsub \u4ea4\u4e92\u73af\u5883\u8f93\u5165\u4f5c\u4e1a\u53c2\u6570\u548c\u4f5c\u4e1a\u7a0b\u5e8f\u3002 bsub \u4ea4\u4e92\u73af\u5883\u7684\u4e3b\u8981\u6709\u70b9\u662f\u53ef\u4ee5\u4e00\u6b21\u63d0\u4ea4\u591a\u4e2a\u53c2\u6570\u76f8\u540c\u7684\u4f5c\u4e1a\u3002\u4f8b\u5982\uff1a<\/p>\n<p>$ bsub<\/p>\n<p>bsub&gt; -n 1<\/p>\n<p>bsub&gt; -q cpu<\/p>\n<p>bsub&gt; -o job.out<\/p>\n<p>bsub&gt; PROG1<\/p>\n<p>bsub&gt; PROG2<\/p>\n<p>bsub&gt; PROG3<\/p>\n<p>bsub&gt; CTRL+d<\/p>\n<p>\u7b49\u4ef7\u4e8e\u63d0\u4ea4\u4e86 PROG1\u3001PROG2 \u548c PROG3 \u4e09\u4e2a\u4f5c\u4e1a\u7a0b\u5e8f\uff1a<\/p>\n<p>$ bsub -n 1 -q cpu -o job.out PROG1<\/p>\n<p>$ bsub -n 1 -q cpu -o job.out PROG2<\/p>\n<p>$ bsub -n 1 -q cpu -o job.out PROG3 \u6307\u5b9a\u4f5c\u4e1a\u8fd0\u884c\u7684\u8282\u70b9<\/p>\n<p>\u5728\u4f5c\u4e1a\u811a\u672c\u4e2d\u53ef\u4ee5\u4f7f\u7528#BSUB -R &#8220;select[hname=HOSTNAME]&#8221;\u6307\u5b9a\u4f5c\u4e1a\u8fd0\u884c\u7684\u8282\u70b9\u3002\u8b6c\u5982\uff1a<\/p>\n<p># 16core.script<\/p>\n<p>#BSUB -L \/bin\/bash<\/p>\n<p>#BSUB -J HELLO_MPI<\/p>\n<p>#BSUB -n 16<\/p>\n<p>#BSUB -e %J.err<\/p>\n<p>#BSUB -o %J.out<\/p>\n<p>#BSUB -R &#8220;span[ptile=16]&#8221;<\/p>\n<p>#BSUB -R &#8220;select[hname=mic02]&#8221;<\/p>\n<p>#BSUB -q cpu<\/p>\n<p>MODULEPATH=\/lustre\/utility\/modulefiles:$MODULEPATH<\/p>\n<p>module purge<\/p>\n<p>module load openmpi\/gcc\/1.6.5<\/p>\n<p>mpirun .\/mpihello<\/p>\n","protected":false},"excerpt":{"rendered":"<p>bsub \u4f5c\u4e1a\u63d0\u4ea4 busb \u547d\u4ee4\u7528\u4e8e\u5411 LSF \u4f5c\u4e1a\u7ba1\u7406\u7cfb\u7edf\u63d0\u4ea4\u4f5c\u4e1a\u8bf7\u6c42\u3002 bsub \u53ef\u63a5\u6536\u7684\u53c2\u6570\u5f88\u591a\uff0c\u901a\u8fc7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":473,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[106],"class_list":["post-903","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hpc","tag-lsf"],"_links":{"self":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/903","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=903"}],"version-history":[{"count":1,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/903\/revisions"}],"predecessor-version":[{"id":904,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/903\/revisions\/904"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/media\/473"}],"wp:attachment":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}