HPC slurm - 如何同时制作一个 HPC 节点 运行 多个作业的 bash 脚本
HPC slurm - how to make an HPC node run multiple jobs' bash scripts at the same time
假设我有一个只有一个节点 (node_1
) 的 HPC 集群,我想同时发送和 运行 [=14 中的 3 个作业的 bash 脚本=].
到目前为止,当我向 node_1
发送作业时,节点一直处于忙碌状态,直到作业结束。
我该怎么做?
我可以在作业的 bash 脚本中提供任何特定参数吗?
谢谢
更新
下面是我用来向 HPC 发送作业的 bash 脚本示例:
#!/bin/bash
#SBATCH --job-name=my_job
#SBATCH --partition=test
#SBATCH --nodelist=node_1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --time=01:00:00
#SBATCH --mem-per-cpu=8000
#SBATCH --output=1.out
#SBATCH --error=1.err
python /my/HPC/folder/script.py
更新
(base) [id@login_node ~]$ scontrol show node=node_1
NodeName=node_1 Arch=x86_64 CoresPerSocket=32
CPUAlloc=0 CPUTot=64 CPULoad=2.94
AvailableFeatures=(null)
ActiveFeatures=(null)
Gres=(null)
NodeAddr=node_1 NodeHostName=node_1 Version=18.08
OS=Linux 4.20.0-1.el7.elrepo.x86_64 #1 SMP Sun Dec 23 20:11:51 EST 2018
RealMemory=128757 AllocMem=0 FreeMem=111815 Sockets=1 Boards=1
State=IDLE ThreadsPerCore=2 TmpDisk=945178 Weight=1 Owner=N/A MCS_label=N/A
Partitions=test
BootTime=2019-12-09T14:09:25 SlurmdStartTime=2020-02-18T03:45:14
CfgTRES=cpu=64,mem=128757M,billing=64
AllocTRES=
CapWatts=n/a
CurrentWatts=0 LowestJoules=0 ConsumedJoules=0
ExtSensorsJoules=n/s ExtSensorsWatts=0 ExtSensorsTemp=n/s
您需要在 slurm 中将消耗性资源类型从 nodes 更改为 cores。
将此添加到您的 slurm.conf
文件
SelectType=select/cons_res
SelectTypeParameters=CR_Core
SelectType:控制CPU资源是以整个节点为单位分配给作业和作业步骤还是作为消耗性资源(套接字、核心或线程)分配。
SelectTypeParameters:定义可消耗的资源类型并控制select 插件的CPU 资源分配的其他方面。
Reference
此外,节点描述也应该允许:
NodeName=<somename> NodeAddr=<someaddress> CPUs=16 Sockets=2 CoresPerSocket=4 ThreadsPerCore=2 RealMemory=12005 State=UNKNOWN
另见 serverfault
假设我有一个只有一个节点 (node_1
) 的 HPC 集群,我想同时发送和 运行 [=14 中的 3 个作业的 bash 脚本=].
到目前为止,当我向 node_1
发送作业时,节点一直处于忙碌状态,直到作业结束。
我该怎么做? 我可以在作业的 bash 脚本中提供任何特定参数吗?
谢谢
更新
下面是我用来向 HPC 发送作业的 bash 脚本示例:
#!/bin/bash
#SBATCH --job-name=my_job
#SBATCH --partition=test
#SBATCH --nodelist=node_1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --time=01:00:00
#SBATCH --mem-per-cpu=8000
#SBATCH --output=1.out
#SBATCH --error=1.err
python /my/HPC/folder/script.py
更新
(base) [id@login_node ~]$ scontrol show node=node_1
NodeName=node_1 Arch=x86_64 CoresPerSocket=32
CPUAlloc=0 CPUTot=64 CPULoad=2.94
AvailableFeatures=(null)
ActiveFeatures=(null)
Gres=(null)
NodeAddr=node_1 NodeHostName=node_1 Version=18.08
OS=Linux 4.20.0-1.el7.elrepo.x86_64 #1 SMP Sun Dec 23 20:11:51 EST 2018
RealMemory=128757 AllocMem=0 FreeMem=111815 Sockets=1 Boards=1
State=IDLE ThreadsPerCore=2 TmpDisk=945178 Weight=1 Owner=N/A MCS_label=N/A
Partitions=test
BootTime=2019-12-09T14:09:25 SlurmdStartTime=2020-02-18T03:45:14
CfgTRES=cpu=64,mem=128757M,billing=64
AllocTRES=
CapWatts=n/a
CurrentWatts=0 LowestJoules=0 ConsumedJoules=0
ExtSensorsJoules=n/s ExtSensorsWatts=0 ExtSensorsTemp=n/s
您需要在 slurm 中将消耗性资源类型从 nodes 更改为 cores。
将此添加到您的 slurm.conf
文件
SelectType=select/cons_res
SelectTypeParameters=CR_Core
SelectType:控制CPU资源是以整个节点为单位分配给作业和作业步骤还是作为消耗性资源(套接字、核心或线程)分配。
SelectTypeParameters:定义可消耗的资源类型并控制select 插件的CPU 资源分配的其他方面。 Reference
此外,节点描述也应该允许:
NodeName=<somename> NodeAddr=<someaddress> CPUs=16 Sockets=2 CoresPerSocket=4 ThreadsPerCore=2 RealMemory=12005 State=UNKNOWN
另见 serverfault