{"id":6167,"date":"2022-06-16T16:01:54","date_gmt":"2022-06-16T13:01:54","guid":{"rendered":"https:\/\/hpc-education.unn.ru\/?page_id=6167"},"modified":"2022-06-16T16:01:54","modified_gmt":"2022-06-16T13:01:54","slug":"%d0%b1%d0%b0%d0%b7%d0%be%d0%b2%d1%8b%d0%b5-%d0%ba%d0%be%d0%bc%d0%b0%d0%bd%d0%b4%d1%8b-slurm","status":"publish","type":"page","link":"https:\/\/hpc-education.unn.ru\/en\/%d1%80%d0%b5%d1%81%d1%83%d1%80%d1%81%d1%8b\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%ba%d1%86%d0%b8%d1%8f\/%d0%b1%d0%b0%d0%b7%d0%be%d0%b2%d1%8b%d0%b5-%d0%ba%d0%be%d0%bc%d0%b0%d0%bd%d0%b4%d1%8b-slurm","title":{"rendered":"\u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 Slurm"},"content":{"rendered":"<h2>sinfo<\/h2>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0443\u0437\u043b\u043e\u0432 \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 \u0441\u0443\u043f\u0435\u0440\u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430.<\/p>\n<pre>user@master ~$ sinfo\r\nPARTITION AVAIL  TIMELIMIT NODES STATE NODELIST\r\ngpu          up 3-00:00:00     3 fail* node[9,55,83]\r\ngpu          up 3-00:00:00    25 down* node[14,51-54,56,81,113-120]\r\ngpu          up 3-00:00:00     1 drain node84\r\ngpu          up 3-00:00:00    10 resv  node[61-70]\r\ngpu          up 3-00:00:00    48 alloc node[1-8,10-13,15-16,28-50,57-60,71-80,82,85-90]\r\ngpu          up 3-00:00:00    11 idle  node[17-27]\r\n...<\/pre>\n<h2>squeue<\/h2>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u0439. \u0421 \u043a\u043b\u044e\u0447\u043e\u043c &#8220;-u username&#8221;&nbsp; &#8211; \u0432\u044b\u0432\u043e\u0434 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0437\u0430\u0434\u0430\u0447, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c username.<\/p>\n<pre>user@master ~$ squeue\r\n  JOBID PARTITION     NAME    USER ST       TIME NODES NODELIST(REASON)\r\n2420539       cpu batch_he   user1 PD       0:00     1 (Nodes required for job are DOWN, DRAINED or reserved for jobs in higher priority partitions)\r\n2420589       gpu run.sbat   user2  R    3:38:33     8 node[1-5,10-12]\r\n2420058       gpu lmp_mpi    user3  R 2-21:24:16     1 node6\r\n2420621       gpu gmx_mpi    user3  R    1:23:03     1 node15\r\n2420620       gpu gmx_mpi    user3  R    1:24:30     1 node87\r\n...<\/pre>\n<h2>srun<\/h2>\n<p>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435. \u0420\u0430\u0431\u043e\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430\u0434\u0430\u043d\u0438\u044f. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0432\u044b\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.<\/p>\n<pre>user@master ~$ srun -N 4 -p gpu hostname\r\nnode16\r\nnode17\r\nnode19\r\nnode18<\/pre>\n<h2>sbatch<\/h2>\n<p>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u043c (\u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c) \u0440\u0435\u0436\u0438\u043c\u0435. \u0424\u0430\u0439\u043b \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a &#8220;#SBATCH parameter&#8221;.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u044b slurm-JOBID.out \u0438 slurm-JOBID.err (\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438).<\/p>\n<pre>user@master ~$ echo '#!\/bin\/sh\r\n#SBATCH -N 4\r\n#SBATCH --time=10\r\n#SBATCH --partition=gpu\r\nhostname' &gt;batch_hostname.sh\r\nuser@master ~$ sbatch batch_hostname.sh\r\nSubmitted batch job 2420645<\/pre>\n<p>salloc<\/p>\n<p>\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0443\u0437\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 \u043d\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (\u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435). \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 (shell), \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f&nbsp; \u044f\u0432\u043d\u043e \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u0438\u0445, \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 exit.<\/p>\n<p>\u041f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e salloc.<\/p>\n<pre>user@master ~$ salloc -N 4 -p gpu\r\nsalloc: Granted job allocation 2420651\r\nuser@master ~$ echo $SLURM_NODELIST\r\nnode[16-19]\r\nuser@master ~$ srun -N 4 hostname\r\nnode18\r\nnode19\r\nnode17\r\nnode16\r\nuser@master ~$ exit\r\nexit\r\nsalloc: Relinquishing job allocation 2420651<\/pre>\n<h2>scontrol<\/h2>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0437\u0430\u0434\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<pre>user@master ~$ scontrol show job 2420645\r\nJobId=2420645 JobName=batch_hostname.sh\r\nUserId=user(userid) GroupId=Users(10000) MCS_label=N\/A\r\nPriority=1057677109 Nice=0 Account=user QOS=normal\r\nJobState=COMPLETED Reason=None Dependency=(null)\r\n...<\/pre>\n<h2>scancel<\/h2>\n<p>\u041e\u0442\u043c\u0435\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<pre>user@master ~$ scancel 2420645<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>sinfo \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0443\u0437\u043b\u043e\u0432 \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 \u0441\u0443\u043f\u0435\u0440\u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430. user@master ~$ sinfo PARTITION AVAIL TIMELIMIT NODES STATE NODELIST gpu up 3-00:00:00 3 fail* node[9,55,83] gpu up 3-00:00:00 25 down* node[14,51-54,56,81,113-120] gpu up 3-00:00:00 1 drain node84 gpu up 3-00:00:00 10 resv node[61-70] &hellip; <a href=\"https:\/\/hpc-education.unn.ru\/en\/%d1%80%d0%b5%d1%81%d1%83%d1%80%d1%81%d1%8b\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%ba%d1%86%d0%b8%d1%8f\/%d0%b1%d0%b0%d0%b7%d0%be%d0%b2%d1%8b%d0%b5-%d0%ba%d0%be%d0%bc%d0%b0%d0%bd%d0%b4%d1%8b-slurm\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":40,"featured_media":0,"parent":6126,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ngg_post_thumbnail":0},"_links":{"self":[{"href":"https:\/\/hpc-education.unn.ru\/en\/wp-json\/wp\/v2\/pages\/6167"}],"collection":[{"href":"https:\/\/hpc-education.unn.ru\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/hpc-education.unn.ru\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/hpc-education.unn.ru\/en\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/hpc-education.unn.ru\/en\/wp-json\/wp\/v2\/comments?post=6167"}],"version-history":[{"count":1,"href":"https:\/\/hpc-education.unn.ru\/en\/wp-json\/wp\/v2\/pages\/6167\/revisions"}],"predecessor-version":[{"id":6168,"href":"https:\/\/hpc-education.unn.ru\/en\/wp-json\/wp\/v2\/pages\/6167\/revisions\/6168"}],"up":[{"embeddable":true,"href":"https:\/\/hpc-education.unn.ru\/en\/wp-json\/wp\/v2\/pages\/6126"}],"wp:attachment":[{"href":"https:\/\/hpc-education.unn.ru\/en\/wp-json\/wp\/v2\/media?parent=6167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}