{"id":107,"date":"2020-08-30T19:07:00","date_gmt":"2020-08-30T11:07:00","guid":{"rendered":"http:\/\/47.107.115.238\/?p=107"},"modified":"2024-08-30T19:08:32","modified_gmt":"2024-08-30T11:08:32","slug":"hpc%e9%ab%98%e6%80%a7%e8%83%bd%e8%ae%a1%e7%ae%97","status":"publish","type":"post","link":"https:\/\/lxylp.com\/?p=107","title":{"rendered":"hpc\u9ad8\u6027\u80fd\u8ba1\u7b97"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_69_1 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/lxylp.com\/?p=107\/#slurm%E4%B8%8Epbs%E5%AF%B9%E6%AF%94\" title=\"slurm\u4e0epbs\u5bf9\u6bd4\">slurm\u4e0epbs\u5bf9\u6bd4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/lxylp.com\/?p=107\/#slurm%E5%B9%B6%E8%A1%8C%E8%B6%85%E7%AE%97\" title=\"slurm\u5e76\u884c\u8d85\u7b97\">slurm\u5e76\u884c\u8d85\u7b97<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/lxylp.com\/?p=107\/#slurm%E4%BD%9C%E4%B8%9A%E6%93%8D%E4%BD%9C\" title=\"slurm\u4f5c\u4e1a\u64cd\u4f5c\">slurm\u4f5c\u4e1a\u64cd\u4f5c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/lxylp.com\/?p=107\/#slurm%E4%BD%9C%E4%B8%9A%E8%8A%82%E7%82%B9%E6%9F%A5%E8%AF%A2\" title=\"slurm\u4f5c\u4e1a\/\u8282\u70b9\u67e5\u8be2\">slurm\u4f5c\u4e1a\/\u8282\u70b9\u67e5\u8be2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/lxylp.com\/?p=107\/#pbs%E7%B3%BB%E7%BB%9F%E5%91%BD%E4%BB%A4\" title=\"pbs\u7cfb\u7edf\u547d\u4ee4\">pbs\u7cfb\u7edf\u547d\u4ee4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/lxylp.com\/?p=107\/#pbs%E8%84%9A%E6%9C%AC%E9%85%8D%E7%BD%AE\" title=\"pbs\u811a\u672c\u914d\u7f6e\">pbs\u811a\u672c\u914d\u7f6e<\/a><\/li><\/ul><\/nav><\/div>\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"slurm%E4%B8%8Epbs%E5%AF%B9%E6%AF%94\"><\/span>slurm\u4e0epbs\u5bf9\u6bd4<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;liupei@cg 2zk]$ cat sub.slurm \n#!\/bin\/bash\n#SBATCH -J gf1cnn                #\u4f5c\u4e1a\u540d\u662f gf1cnn\n#SBATCH -p v3_ib                #\u63d0\u4ea4\u5230 v3_ib \u5206\u533a\n#SBATCH -N 1                      #\u4f7f\u7528\u4e00\u4e2a\u8282\u70b9\n#SBATCH -n 1                    #cpu\u6570\n#SBATCH --cpus-per-task 24        #\u6bcf\u4e2a\u8fdb\u7a0b\u5360\u752824\u4e2acpu\u6838\u5fc3\n#SBATCH --gres=gpu:1            #\u7533\u8bf71\u5757gpu\n#SBATCH -o gf1cnn.out         #\u5c06\u5c4f\u5e55\u8f93\u51fa\u7ed3\u679c\u4fdd\u5b58\u5230\u5f53\u524d\u6587\u4ef6\u5939\u7684 gf1cnn.out \n\nsource activate cnn            #\u5207\u6362python\u73af\u5883\n.\/run_bass.sh 13            #\u6267\u884c\u6211\u7684 .\/run_bass.sh \u7a0b\u5e8f <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"slurm%E5%B9%B6%E8%A1%8C%E8%B6%85%E7%AE%97\"><\/span>slurm\u5e76\u884c\u8d85\u7b97<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u67e5\u770b\u6a21\u5757<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u8f7d\u5165\u8fdc\u7a0b\u590d\u5236 module\nmodule load papp_cloud\/2.6.18\/2.6.18-cjj\n# \u8f7d\u5165\u9884\u88c5\u7684 python module\nmodule load anaconda\/3-Python3.6.5-fgl\n# \u67e5\u770b\u53ef\u7528 module\nmodule avail \u6216 module avail anaconda \n# \u67e5\u770b\u5206\u533a \nsinfo <\/code><\/pre>\n\n\n\n<p>\u5e76\u884c\u7684slurm\u811a\u672c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n#SBATCH -p v3_ib\n#SBATCH -N 1\n#SBATCH -n 1\n#SBATCH -c 24\n\n#srun matlab &lt;testCascade.m\nmatlab -nodisplay &lt; matlab_parfor.m<\/code><\/pre>\n\n\n\n<p>\u53c2\u8003\u6587\u732e\uff1a<a href=\"https:\/\/rcc.uchicago.edu\/docs\/software\/environments\/matlab\/\">CHICAGO<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"slurm%E4%BD%9C%E4%B8%9A%E6%93%8D%E4%BD%9C\"><\/span>slurm\u4f5c\u4e1a\u64cd\u4f5c<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8bf4\u660e<\/th><th>SLURM<\/th><th>PBS<\/th><\/tr><\/thead><tbody><tr><td>\u63d0\u4ea4\u4f5c\u4e1a\u811a\u672c<\/td><td><code>sbatch run.slurm<\/code><\/td><td>qsub run.pbs<\/td><\/tr><tr><td>\u67e5\u770b\u4f5c\u4e1a\u72b6\u6001<\/td><td><code>squeue<\/code><\/td><td>qstat<\/td><\/tr><tr><td>\u8ffd\u8e2a\u4f5c\u4e1a<\/td><td><code>scontrol show job 1234<\/code><\/td><td><\/td><\/tr><tr><td>\u53d6\u6d88\u4f5c\u4e1a<\/td><td><code>scancel 1234<\/code><\/td><td>qdel 1234<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"slurm%E4%BD%9C%E4%B8%9A%E8%8A%82%E7%82%B9%E6%9F%A5%E8%AF%A2\"><\/span>slurm\u4f5c\u4e1a\/\u8282\u70b9\u67e5\u8be2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u67e5\u770b\u5206\u533a\u4fe1\u606f<br><code>scontrol show partition<\/code><br><code>scontrol show partition debug<\/code><\/li>\n\n\n\n<li>\u67e5\u770b\u8282\u70b9\u4fe1\u606f<br><code>scontrol show node<\/code><br><code>scontrol show node comput1<\/code><\/li>\n\n\n\n<li>\u67e5\u770b\u4f5c\u4e1a\u4fe1\u606f<br><code>scontrol show job \u4f5c\u4e1aID<\/code><br><code>scontrol show job 15<\/code><\/li>\n\n\n\n<li>\u5220\u9664\u4f5c\u4e1a<br><code>scancel \u4f5c\u4e1aID<\/code><br><code>scancel 15<\/code><\/li>\n<\/ol>\n\n\n\n<p><a href=\"http:\/\/bicmr.pku.edu.cn\/~wenzw\/pages\/slurm.html#pbs\">\u53c2\u8003\u6587\u732e<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"pbs%E7%B3%BB%E7%BB%9F%E5%91%BD%E4%BB%A4\"><\/span>pbs\u7cfb\u7edf\u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5317\u4eac\u5927\u5b66\u7684 HPC \u6559\u7a0b\uff0c<a href=\"http:\/\/bicmr.pku.edu.cn\/~wenzw\/pages\/pbs.html\">REF<\/a><\/p>\n\n\n\n<p>pbs\u5e38\u7528\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>qsub a.pbs    # \u63d0\u4ea4\u4f5c\u4e1aa\nqstat -an     # \u5217\u51fa\u961f\u5217\u4e2d\u6240\u6709\u4f5c\u4e1a\u53ca\u5176\u5206\u914d\u7684\u8282\u70b9\nqstat -q      # \u67e5\u770b\u6240\u6709\u961f\u5217\nqstat -Q      # \u5217\u51fa\u961f\u5217\u7684\u4e00\u4e9b\u9650\u5236\u4fe1\u606f\nqstat -Qf bdog # \u5217\u7c97\u6307\u5b9a\u961f\u5217\u7684\u6240\u6709\u4fe1\u606f\npestat        # \u67e5\u770b\u5f53\u524d\u6240\u6709\u8282\u70b9\u7684\u5360\u7528\u72b6\u6001\n            # excl \u6240\u6709cpu\u5df2\u88ab\u5360\u7528\n        # busy cpu\u5df2\u63a5\u8fd1\u6ee1\u8d1f\u8377\u8fd0\u884c\n        # free \u90e8\u5206\u6216\u5168\u90e8cpu\u7a7a\u95f2\n        # offl \u7ba1\u7406\u5458\u624b\u52a8\u6307\u5b9a\u79bb\u7ebf\u72b6\u6001<\/code><\/pre>\n\n\n\n<p>\u67e5\u770b\u5f53\u524d\u6240\u6709\u4efb\u52a1\u7684\u8fd0\u884c\u72b6\u6001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>qstat         # \u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u6240\u6709\u4efb\u52a1\u7684\u8fd0\u884c\u72b6\u6001\nch_cumtlp3@mgr:~&gt; qstat \nJob ID        Name       User     Time Use  S  Queue\n----------  --------  --------- -------------------\n375817.mgr  600470   ch_cumtlp3  155:47:3  R    l     <\/code><\/pre>\n\n\n\n<p>\u4f5c\u4e1a 375817 \u5728\u8282\u70b9 mgr \u4e0a\u8fd0\u884c\uff0c\u4f5c\u4e1a\u540d\u79f0 600470<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"pbs%E8%84%9A%E6%9C%AC%E9%85%8D%E7%BD%AE\"><\/span>pbs\u811a\u672c\u914d\u7f6e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>-N name:\u4f5c\u4e1a\u540d\uff0c\u965015 \u4e2a\u5b57\u7b26\uff0c\u9996\u5b57\u7b26\u4e3a\u5b57\u6bcd\uff0c\u65e0\u7a7a\u683c\n-o path:\u91cd\u5b9a\u5411\u6807\u51c6\u8f93\u51fa\u5230path\n-l resource_list:\u5b9a\u4e49\u8d44\u6e90\u5217\u8868\u3002\n   nodes=N:ppn=M\uff1a\u8bf7\u6c42N\u4e2a\u7ed3\u70b9\uff0c\u6bcf\u4e2a\u7ed3\u70b9M\u4e2a\u5904\u7406\u5668\u3002 \n   mem  =N&#91;K|M|G]&#91;B|W]\uff1a\u8bf7\u6c42N\u5927\u5c0f\u7684\u5185\u5b58\u3002\n   cput =N:\u8bf7\u6c42N\u79d2CPU\u65f6\u95f4;N\u4e5f\u53ef\u4ee5\u662fhh:mm:ss\u5f62\u5f0f\u3002\n-m mail_options:\u7ed9\u7528\u6237\u53d1\u4fe1\uff1ba(\u4f5c\u4e1aabort), b(\u4f5c\u4e1a\u5f00\u59cb\u8fd0\u884c\u53d1\u4fe1)\uff1be(\u4f5c\u4e1a\u7ed3\u675f\u65f6\u53d1\u4fe1)\u3002\u82e5\u65e0\u6b64\u9009\u9879\uff0c\u9ed8\u8ba4\u4e3aa\u3002\n-M user_list:\u5b9a\u4e49\u53d1\u7ed9\u54ea\u4e9b\u7528\u6237,\u6709\u5173\u6b64\u4f5c\u4e1a\u7684mail<\/code><\/pre>\n\n\n\n<p>pbs\u4f5c\u4e1a\u4f8b\u5b50<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/sh\n#PBS -N rfrk  \n#PBS -j oe   # out put file\n#PBS -l nodes=1:ppn=32\n#PBS -q l\n#PBS -m be\n#PBS -M cumtlp@qq.com \ncd $PBS_O_WORKDIR   \n\n\/public3\/home\/ch_cumtlp3\/installed\/app\/matlab\/r2019b\/bin\/matlab -nodesktop -nosplash -nojvm \\\n-r \"addpath('pcode');main('roi_pixel','rfrk',{'r',{&#91;50,10,500]}}); exit;\"\n\n\/public3\/apps\/matlab-2016b\/bin\/matlab -nosplash -nodesktop -nojvm \\\n-r \"addpath('..\/..\/code\/'); pbs_mlc(1:4,0.7); exit;\"<\/code><\/pre>\n\n\n\n<p><strong>pbs\u8fd0\u884c\u811a\u672c<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>qsub test.pbs:\u63d0\u4ea4\u4f5c\u4e1a\npbsnodes -l free:\u4ee5\u884c\u7684\u884c\u5f0f\u5217\u51fa\u7a7a\u95f2\u7684\u8282\u70b9\nqstat -q:\u67e5\u770b\u6240\u6709\u961f\u5217\u72b6\u6001\nqstat:\u67e5\u770b\u4f5c\u4e1a\u8fd0\u884c\u72b6\u6001\n\u72b6\u6001\u8bf4\u660e: E:\u9000\u51fa; Q:\u6392\u961f;H:\u6302\u8d77; R:\u8fd0\u884c; C:\u7ed3\u675f\nqstat -an:\u5217\u51fa\u961f\u5217\u4e2d\u6240\u6709\u4f5c\u4e1a\u53ca\u5176\u5206\u914d\u7684\u8282\u70b9   \nqstat -an 93:\u663e\u793a\u4f5c\u4e1a\u8fd0\u884c\u5728\u54ea\u4e9b\u8282\u70b9\u4e0a\nqdel 93:\u5220\u9664\u81ea\u5df1\u7684\u4f5c\u4e1a    <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>slurm\u4e0epbs\u5bf9\u6bd4 slur&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=107"}],"version-history":[{"count":1,"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions\/108"}],"wp:attachment":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}