IT업무를 하면서 배운 가장 큰 교훈 중 하나는 "무슨 일이든 시작 하기 전에 공식 문서 찾아보기" 입니다.
이번 포스팅에서는 slurm conf 파일에 대해서 살펴보는 시간을 가져보겠습니다.
(한 번에 모든 값을 다 리뷰하기엔 어려우니 조금씩 업데이트 하겠습니다.)
공식 문서 링크
https://slurm.schedmd.com/slurm.conf.html
Slurm Workload Manager - slurm.conf
Comma-separated list of resources you wish to track on the cluster. These are the resources requested by the sbatch/srun job when it is submitted. Currently this consists of any GRES, BB (burst buffer) or license along with CPU, Memory, Node, Energy, FS/[D
slurm.schedmd.com
그래도, 간단히 빠르게 설정하고 싶으신 분은 Easy 버전 slurm.conf 생성기를 활용해보세요.
slurm.conf 생성기
- Easy 버전
https://slurm.schedmd.com/configurator.easy.html
Slurm System Configuration Tool
slurm.schedmd.com
- General 버전
https://slurm.schedmd.com/configurator.html
Slurm System Configuration Tool
slurm.schedmd.com
대부분 이 글을 클릭해서 열어보신 분들은 이렇게 생각하실 것 같아요.
"그냥" 작동만 되면 좋겠어요
일단은, slurm.conf이 "그냥" 정상 작동이 되는 구성을 먼저 세팅해봅시다.
slurm.conf.example을 가져오겠습니다.
slurm.conf.example
#
# Example slurm.conf file. Please run configurator.html
# (in doc/html) to build a configuration file customized
# for your environment.
#
#
# slurm.conf file generated by configurator.html.
# Put this file on all nodes of your cluster.
# See the slurm.conf man page for more information.
#
ClusterName=cluster
SlurmctldHost=linux0
#SlurmctldHost=
#
#DisableRootJobs=NO
#EnforcePartLimits=NO
#Epilog=
#EpilogSlurmctld=
#FirstJobId=1
#MaxJobId=67043328
#GresTypes=
#GroupUpdateForce=0
#GroupUpdateTime=600
#JobFileAppend=0
#JobRequeue=1
#JobSubmitPlugins=lua
#KillOnBadExit=0
#LaunchType=launch/slurm
#Licenses=foo*4,bar
#MailProg=/bin/mail
#MaxJobCount=10000
#MaxStepCount=40000
#MaxTasksPerNode=512
MpiDefault=none
#MpiParams=ports=#-#
#PluginDir=
#PlugStackConfig=
#PrivateData=jobs
ProctrackType=proctrack/cgroup
#Prolog=
#PrologFlags=
#PrologSlurmctld=
#PropagatePrioProcess=0
#PropagateResourceLimits=
#PropagateResourceLimitsExcept=
#RebootProgram=
ReturnToService=1
SlurmctldPidFile=/var/run/slurmctld.pid
SlurmctldPort=6817
SlurmdPidFile=/var/run/slurmd.pid
SlurmdPort=6818
SlurmdSpoolDir=/var/spool/slurmd
SlurmUser=slurm
#SlurmdUser=root
#SrunEpilog=
#SrunProlog=
StateSaveLocation=/var/spool/slurmctld
SwitchType=switch/none
#TaskEpilog=
TaskPlugin=task/affinity
#TaskProlog=
#TopologyPlugin=topology/tree
#TmpFS=/tmp
#TrackWCKey=no
#TreeWidth=
#UnkillableStepProgram=
#UsePAM=0
#
#
# TIMERS
#BatchStartTimeout=10
#CompleteWait=0
#EpilogMsgTime=2000
#GetEnvTimeout=2
#HealthCheckInterval=0
#HealthCheckProgram=
InactiveLimit=0
KillWait=30
#MessageTimeout=10
#ResvOverRun=0
MinJobAge=300
#OverTimeLimit=0
SlurmctldTimeout=120
SlurmdTimeout=300
#UnkillableStepTimeout=60
#VSizeFactor=0
Waittime=0
#
#
# SCHEDULING
#DefMemPerCPU=0
#MaxMemPerCPU=0
#SchedulerTimeSlice=30
SchedulerType=sched/backfill
SelectType=select/cons_tres
#
#
# JOB PRIORITY
#PriorityFlags=
#PriorityType=priority/multifactor
#PriorityDecayHalfLife=
#PriorityCalcPeriod=
#PriorityFavorSmall=
#PriorityMaxAge=
#PriorityUsageResetPeriod=
#PriorityWeightAge=
#PriorityWeightFairshare=
#PriorityWeightJobSize=
#PriorityWeightPartition=
#PriorityWeightQOS=
#
#
# LOGGING AND ACCOUNTING
#AccountingStorageEnforce=0
#AccountingStorageHost=
#AccountingStoragePass=
#AccountingStoragePort=
AccountingStorageType=accounting_storage/none
#AccountingStorageUser=
#AccountingStoreFlags=
#JobCompHost=
#JobCompLoc=
#JobCompPass=
#JobCompPort=
JobCompType=jobcomp/none
#JobCompUser=
#JobContainerType=
JobAcctGatherFrequency=30
JobAcctGatherType=jobacct_gather/none
SlurmctldDebug=info
SlurmctldLogFile=/var/log/slurmctld.log
SlurmdDebug=info
SlurmdLogFile=/var/log/slurmd.log
#SlurmSchedLogFile=
#SlurmSchedLogLevel=
#DebugFlags=
#
#
# POWER SAVE SUPPORT FOR IDLE NODES (optional)
#SuspendProgram=
#ResumeProgram=
#SuspendTimeout=
#ResumeTimeout=
#ResumeRate=
#SuspendExcNodes=
#SuspendExcParts=
#SuspendRate=
#SuspendTime=
#
#
# COMPUTE NODES
NodeName=linux[1-32] CPUs=1 State=UNKNOWN
PartitionName=debug Nodes=ALL Default=YES MaxTime=INFINITE State=UP
간단 용어 설명
- slurmctld = slurm control daemon
- slurm control daemon은 Master Node에서 실행되는 데몬입니다.
- slurmd = slurm daemon
- slurm daemon은 Slave Node(혹은 Worker Node)에서 실행되는 데몬입니다.
Configuration Tag 설명
ClusterName
- 클러스터의 이름을 정하는 값입니다. 정해진 값을 입력해도 되지만 multi-cluster를 사용하는 경우에는 구분을 위해 유일한 값을 설정해주는게 좋습니다.
- 영문 소문자로 40자 이내로 작성하는 게 권장됩니다.
SlurmctldHost
- slurmctl 데몬이 실행되는 호스트의 호스트네임을 말합니다.
- slurm master node (slurmctl 데몬이 실행되는 서버)에서 `hostname -s` 명령어를 통해 확인 됩니다.
- 최소 1개 이상의 값이 필요합니다.
- 고가용성을 위해 Multiple Master Node 전략을 취하는 경우 여러 노드를 선언할 수 있습니다.
MpiDefault
- MPI유형을 정의합니다.
- 기본 값은 none 입니다.
- 지원하는 값은: pmi2, pmix, none입니다.
- 추가 내용은 다음 링크를 참고하시면 됩니다.
ProctrackType
- 변경시 slurmctld를 다시 시작해야합니다.
- 작업 단계별 프로세스 추적하는 플러그인을 결정합니다.
- 기본 값은 proctrack/cgroup 입니다.
- 사용가능 값은: proctrack/cgroup, proctrack/cray_aries, proctrack/linuxproc, proctrack/pgid 입니다.
- 특별한 상황이 아니라면 기본 값인 proctrack/cgroup을 권장합니다
ReturnToService
- Node가 DOWN 상태로 확인될 때, 어떻게 작동할 지를 결정합니다.
- 기본 값은 0 입니다.
- 0, 시스템 관리자가 명시적으로 상태를 변경하기 전까지 상태를 유지합니다.
- 1, 응답이 없어 DOWN 상태일 때만, 적절한 conf를 설정하면 사용가능한 상태로 변경됩니다.
- 2, 적절한 conf로 설정하면, 노드는 DOWN에서 사용가능한 상태로 변경됩니다.
SlurmctldPidFile
- 기본 값은 /var/run/slurmctld.pid
- 절대경로로 작성되어야 합니다.
- 반드시 slurm 사용자가 해당 경로에, 파일을 생성할 수 있는 권한이 있어야 합니다.
- slurmctld pid(process id)가 저장되는 경로를 지정합니다.
SlurmctldPort
- 기본 값은 6817 입니다.
- build시에 SLURMCTLD_PORT 값으로 정의됩니다.
SlurmdPidFile
- 기본 값은 /var/run/slurmd.pid 입니다.
- 절대경로로 작성되어야 합니다.
- 반드시 slurm 사용자가 해당 경로에, 파일을 생성할 수 있는 권한이 있어야 합니다.
- slurmd pid가 저장되는 경로입니다.
SlurmdPort
- 기본 값은 6818
- build시에는 SLURMD_PORT 값으로 정의됩니다.
SlurmdSpoolDir
- 기본 값은 /var/spool/slurmd 입니다.
- 절대 경로로 작성되어야 합니다.
- slurmd의 상태 정보, 배치 작업의 정보가 기록됩니다.
SlurmUser
- slurm이 실행될 때 사용하는 권한 주체입니다.
- 기본 값은 slurm입니다.
- 미리 slurm이라는 사용자를 만들어두는 것을 권장합니다.
StateSaveLocation
- 기본 값은 /var/spool/slurmctld
- 시스템 장애 발생 후, 복구시 사용될 slurmctld의 상태를 저장하는 경로입니다.
- 절대 경로로 작성되어야 합니다.
- 2대 이상의 Master Node를 사용하는 경우 접근 권한 할당에 주의해야합니다.
SwitchType=switch/none
- Slurm Application 내부 통신 유형을 정의합니다.
- 기본 값은 switch/none
- 이 값이 변경되면 slurmctld 를 재시작해야하고, 기존 상태 값은 모두 사라집니다.
- Cray시스템에서는 "switch/cray_aries", HPE Slingshot 시스템에서는 "switch/hpe_slingshot" 사용을 권장합니다.
TaskPlugin=task/affinity
- 작업(Task) 실행 플러그인 유형을 결정합니다.
- 기본 값은 task/none입니다.
- 사용가능한 값은 task/affinity, task/cgroup, task/none 입니다
InactiveLimit
- 응답이 없는 작업이 종료되기 전 대기 시간을 결정합니다.
- 기본 값은 0(초) 입니다.
- 값의 범위는 0 ~ 65533 이내에 설정해야합니다.
KillWait
- 작업프로세스가 다음과 같은 상태일 때 ('SIGTERM', 'SIGKILL') 작업을 종료하기 전 대기 시간을 결정합니다.
- 기본 값은 30(초) 입니다.
- 값의 범위는 30 ~ 65533입니다.
MinJobAge
- 작업의 최소 수행시간을 결정합니다.
- 기본 값은 300(초) 입니다.
- 너무 짧은 작업 수행 시간을 가지면, 작업레코드가 정상적으로 삭제되지 않을 수 있습니다.
SlurmctldTimeout
- slurmctld가 응답하지 않을 때 대기 시간을 결정합니다.
- 기본 값은 120(초) 입니다.
- slurmctld가 timeout 되고, secondary master node("backup controller")가 존재할 때 master node는 backup controller로 이관됩니다.
SlurmdTimeout
- slurmd가 응답하지 않을 때, 대기 시간을 결정합니다.
- 기본 값은 300(초)입니다.
- 대기 시간이 지나면 slurmd가 존재하는 Node는 DOWN상태로 전환됩니다.
Waittime
- 이전 작업이 종료된 다음, 다음 작업이 시작되기 까지 (srun 명령의) 대기시간을 결정합니다.
- 기본 값은 0(초) 입니다.
- srun 명령어의 --wait 옵션이 있는 경우, 무시됩니다.
SchedulerType
- 스케줄러 사용 유형을 결정합니다.
- 기본 값은 sched/backfill 입니다.
- 변경시 slurmctld를 재시작해야합니다.
- 사용가능 한 값은 sched/backfill, sched/builtin 입니다.
SelectType
- 리소스(worker node) 선택 알고리즘 유형을 결정합니다.
- GPU 머신을 사용하는 경우 select/cons_tres
- GPU 머신을 사용하지 않는 경우 select/cons_res
AccountingStorageType
- accounting 저장 유형을 결정합니다.
- 기본 값은 accounting_storage/none 입니다.
- slurmdbd를 사용하는 경우, accounting_storage/slurmdbd 값을 사용할 수 있습니다.
JobCompType
- 작업 완료 로그 유형을 결정합니다.
- 기본 값은 jobcomp/none 입니다.
JobAcctGatherFrequency
- 작업의 정보를 수집하는 주기를 결정합니다.
- 기본 값은 30(초) 입니다.
- 값을 0으로 설정하면 (기능이 비활성화되어) 작업이 종료될 때만 정보를 수집합니다.
JobAcctGatherType
- 작업의 리소스 사용 정보를 수집하는 방식을 결정합니다.
- 기본 값은 jobacct_gather/none 입니다.
- 권장 값은 jobacct_gather/cgroup 입니다.
SlurmctldDebug
- slurmctld의 디버그 레벨을 결정합니다.
- 기본 값은 info 입니다.
- 세부 내용은 링크를 참조해주세요.
SlurmctldLogFile
- slurmctld의 로그 파일 경로를 결정합니다.
- 기본 값은 없습니다. (syslog에 편입됩니다.)
- 권장 값은 /var/log/slurmctld.log 입니다.
- 절대 경로로 작성되어야 합니다.
SlurmdDebug=info
- slurmd 디버그 레벨을 결정합니다.
- 기본 값은 info 입니다.
- 세부 내용은 링크를 참조해주세요.
SlurmdLogFile
- slurmd 로그 파일 경로를 결정합니다.
- 기본 값은 없습니다. (syslog에 편입됩니다.)
- 권장 값은 /var/log/slurmd.log 입니다.
- 절대 경로로 작성되어야 합니다.
가장 까다롭고 헷갈리기 쉬운 노드 구성입니다. 설정하기 전 반.드.시 공식 문서를 정독하시기 바랍니다.
https://slurm.schedmd.com/slurm.conf.html#SECTION_NODE-CONFIGURATION
Slurm Workload Manager - slurm.conf
Comma-separated list of resources you wish to track on the cluster. These are the resources requested by the sbatch/srun job when it is submitted. Currently this consists of any GRES, BB (burst buffer) or license along with CPU, Memory, Node, Energy, FS/[D
slurm.schedmd.com
NodeName=linux[1-32] CPUs=1 State=UNKNOWN
- 1개 이상의 Worker node 구성을 정의합니다.
- NodeName은 hostname을 의미합니다.
- 노드 네임이 linux1 linux2 linux3 과 같은 경우 linux[1-3]으로 약식 표기가 가능합니다.
- Worker node의 정보를 정확히 기입해야합니다.
PartitionName=debug Nodes=ALL Default=YES MaxTime=INFINITE State=UP
- 파티션을 정의합니다.
- 파티션은 특정 노드 집합(Nodes)의 집합셋 입니다.
- 여러 파티션을 지정하는 경우, 기본 파티션을 최소 1개 이상 지정해야합니다. (Default=Yes)
파일들의 권한이나 소유자를 확인하기 위해서는 다음 링크를 참고하세요.
https://slurm.schedmd.com/slurm.conf.html#SECTION_FILE-AND-DIRECTORY-PERMISSIONS
Slurm Workload Manager - slurm.conf
Comma-separated list of resources you wish to track on the cluster. These are the resources requested by the sbatch/srun job when it is submitted. Currently this consists of any GRES, BB (burst buffer) or license along with CPU, Memory, Node, Energy, FS/[D
slurm.schedmd.com
'HPC > Scheduler' 카테고리의 다른 글
SLURM Build (0) | 2023.09.01 |
---|