Skip to content

Commit

Permalink
Add slurm_conf_options var
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Oct 25, 2023
1 parent 6f88714 commit bc0f28b
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 154 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,46 @@ The variables that can be passed to this role and a brief description about them
user: user1
# Install DRMAA library
drmaa_lib_install: false
drmaa_lib_version: 1.0.7
# SLURM default configuration options
slurm_default_conf_options:
AuthType: auth/munge
CryptoType: crypto/munge
FirstJobId: 1
JobRequeue: 0
JobSubmitPlugins: all_partitions
ProctrackType: proctrack/pgid
ReturnToService: 2
SlurmctldPidFile: /var/run/slurmctld.pid
SlurmctldPort: 6817
SlurmdPidFile: /var/run/slurmctld.pid
SlurmdPort: 6818
SlurmdSpoolDir: /var/spool/slurm
SlurmUser: slurm
StateSaveLocation: /var/slurm/checkpoint
SwitchType: switch/none
TaskPlugin: task/none
InactiveLimit: 0
KillWait: 30
MessageTimeout: 30
MinJobAge: 300
SlurmctldTimeout: 30
SlurmdTimeout: 40
Waittime: 0
FastSchedule: 1
SchedulerType: sched/backfill
SelectType: select/linear
AccountingStorageType: accounting_storage/none
ClusterName: cluster
JobCompType: jobcomp/none
JobAcctGatherFrequency: 30
JobAcctGatherType: jobacct_gather/none
SlurmctldDebug: debug5
SlurmctldLogFile: /var/log/slurm/slurmctld.log
SlurmdDebug: debug5
SlurmdLogFile: /var/log/slurm/slurmd.log
# SLURM user configuration options
slurm_conf_options: {}

Example Playbook
----------------
Expand Down
39 changes: 39 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,42 @@ slurm_vnode_prefix: wn
# Install DRMAA library
drmaa_lib_install: false
drmaa_lib_version: 1.0.7
# SLURM default configuration options
slurm_default_conf_options:
AuthType: auth/munge
CryptoType: crypto/munge
FirstJobId: 1
JobRequeue: 0
JobSubmitPlugins: all_partitions
ProctrackType: proctrack/pgid
ReturnToService: 2
SlurmctldPidFile: /var/run/slurmctld.pid
SlurmctldPort: 6817
SlurmdPidFile: /var/run/slurmctld.pid
SlurmdPort: 6818
SlurmdSpoolDir: /var/spool/slurm
SlurmUser: slurm
StateSaveLocation: /var/slurm/checkpoint
SwitchType: switch/none
TaskPlugin: task/none
InactiveLimit: 0
KillWait: 30
MessageTimeout: 30
MinJobAge: 300
SlurmctldTimeout: 30
SlurmdTimeout: 40
Waittime: 0
FastSchedule: 1
SchedulerType: sched/backfill
SelectType: select/linear
AccountingStorageType: accounting_storage/none
ClusterName: cluster
JobCompType: jobcomp/none
JobAcctGatherFrequency: 30
JobAcctGatherType: jobacct_gather/none
SlurmctldDebug: debug5
SlurmctldLogFile: /var/log/slurm/slurmctld.log
SlurmdDebug: debug5
SlurmdLogFile: /var/log/slurm/slurmd.log
# SLURM user configuration options
slurm_conf_options: {}
9 changes: 9 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
- /var/slurm/checkpoint
- /etc/slurm

- name: Use BLCR as checkpointing type
set_fact:
slurm_conf_options: "{{ slurm_default_conf_options | combine({'CheckpointType': 'checkpoint/blcr'}) }}"
when : 'blcr' in templates

- name: Update default options with user options
set_fact:
slurm_conf_options: "{{ slurm_default_conf_options | combine(slurm_conf_options) }}"

- name: Include "{{slurm_type_of_node}}" SLURM recipe
include_tasks: "{{slurm_type_of_node}}.yaml"

Expand Down
157 changes: 3 additions & 154 deletions templates/slurm.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,162 +3,11 @@
# See the slurm.conf man page for more information.
#
ControlMachine={{slurm_server_name}}
#ControlAddr=
#BackupController=
#BackupAddr=
#
AuthType=auth/munge
#CacheGroups=0

{% if 'blcr' in templates %}
CheckpointType=checkpoint/blcr
{% endif %}

CryptoType=crypto/munge
#DisableRootJobs=NO
#EnforcePartLimits=NO
#Epilog=/usr/local/slurm/epilog_controller
#EpilogSlurmctld=/usr/local/slurm/epilog_controller
FirstJobId=1
#MaxJobId=999999
#GresTypes=
#GroupUpdateForce=0
#GroupUpdateTime=600
#JobCheckpointDir=/var/slurm/checkpoint
#JobCredentialPrivateKey=
#JobCredentialPublicCertificate=
#JobFileAppend=0
JobRequeue=0
JobSubmitPlugins=all_partitions
#KillOnBadExit=0
#Licenses=foo*4,bar
#MailProg=/bin/mail
#MaxJobCount=5000
#MaxStepCount=40000
#MaxTasksPerNode=128
#MpiDefault=openmpi
#MpiParams=ports=12000-12999
#PluginDir=
#PlugStackConfig=
#PrivateData=jobs
ProctrackType=proctrack/pgid
#Prolog=
#PrologSlurmctld=
#PropagatePrioProcess=0
#PropagateResourceLimits=
#PropagateResourceLimitsExcept=
ReturnToService=2
#SallocDefaultCommand=
SlurmctldPidFile=/var/run/slurmctld.pid
SlurmctldPort=6817
SlurmdPidFile=/var/run/slurmctld.pid
SlurmdPort=6818
SlurmdSpoolDir=/var/spool/slurm
SlurmUser=slurm
#SlurmdUser=root
#SrunEpilog=
#SrunProlog=
StateSaveLocation=/var/slurm/checkpoint
SwitchType=switch/none
#TaskEpilog=
TaskPlugin=task/none
#TaskPluginParam=
#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=30
#ResvOverRun=0
MinJobAge=300
#OverTimeLimit=0
SlurmctldTimeout=30
SlurmdTimeout=40
#SlurmctldTimeout=120
#SlurmdTimeout=300
#UnkillableStepTimeout=60
#VSizeFactor=0
Waittime=0
#
#
# SCHEDULING
#DefMemPerCPU=0
FastSchedule=1
#MaxMemPerCPU=0
#SchedulerRootFilter=1
#SchedulerTimeSlice=30
SchedulerType=sched/backfill
#SchedulerPort=7321
SelectType=select/linear
#SelectTypeParameters=
#
#
# JOB PRIORITY
#PriorityType=priority/basic
#PriorityDecayHalfLife=
#PriorityCalcPeriod=
#PriorityFavorSmall=
#PriorityMaxAge=
#PriorityUsageResetPeriod=
#PriorityWeightAge=
#PriorityWeightFairshare=
#PriorityWeightJobSize=
#PriorityWeightPartition=
#PriorityWeightQOS=
#
#
# LOGGING AND ACCOUNTING
#AccountingStorageEnforce=0
#AccountingStorageHost=
#AccountingStorageLoc=
#AccountingStoragePass=
#AccountingStoragePort=
AccountingStorageType=accounting_storage/none
#AccountingStorageUser=

#AccountingStoreJobComment=YES
{% for key, value in slurm_conf_options.items() %}
{{key}}={{value}}
{% endfor %}

ClusterName=cluster
#DebugFlags=
#JobCompHost=
#JobCompLoc=
#JobCompPass=
#JobCompPort=
JobCompType=jobcomp/none
#JobCompUser=
JobAcctGatherFrequency=30
JobAcctGatherType=jobacct_gather/none
SlurmctldDebug=debug5
SlurmctldLogFile=/var/log/slurm/slurmctld.log
SlurmdDebug=debug5
SlurmdLogFile=/var/log/slurm/slurmd.log
#SlurmSchedLogFile=
#SlurmSchedLogLevel=
#
#
# POWER SAVE SUPPORT FOR IDLE NODES (optional)
#SuspendProgram=
#ResumeProgram=
#SuspendTimeout=
#ResumeTimeout=
#ResumeRate=
#SuspendExcNodes=
#SuspendExcParts=
#SuspendRate=
#SuspendTime=
#
#
# COMPUTE NODES
Expand Down
1 change: 1 addition & 0 deletions tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
slurm_wn_ips: ["127.0.0.1"]
slurm_vnode_prefix: vnode-
max_number_of_nodes: 1
drmaa_lib_install: true
drmaa_lib_version: 1.1.4
slurm_version: 21.08.8

0 comments on commit bc0f28b

Please sign in to comment.