# Slurm cgroup support configuration file.
#
# See slurm.conf(5) and cgroup.conf(5) man pages for further information on
# cgroup configuration parameters
#
# For general Slurm cgroups information, see the Cgroups Guide at
# <https://slurm.schedmd.com/cgroups.html>.

# CgroupAutomount ##############################################################
#
# Slurm cgroup plugins require valid and functional cgroup subsystem to be
# mounted under /sys/fs/cgroup/<subsystem_name>. When launched, plugins check
# their subsystem availability.  If not available, the plugin launch fails
# unless CgroupAutomount is set to yes. In that case, the plugin will first try
# to mount the required subsystems.

CgroupAutomount=yes

# CgroupMountpoint #############################################################
#
# Specify the PATH under which cgroups should be mounted. This should be a
# writable directory which will contain cgroups mounted one per subsystem. The
# default PATH is /sys/fs/cgroup.

CgroupMountpoint=/sys/fs/cgroup

# ConstrainCores ###############################################################
#
# If configured to "yes" then constrain allowed cores to the subset of
# allocated resources. This functionality makes use of the cpuset subsystem.
# Due to a bug fixed in version 1.11.5 of HWLOC, the task/affinity plugin may
# be required in addition to task/cgroup for this to function properly. The
# default value is "no".

ConstrainCores=yes

# ConstrainDevices #############################################################
#
# If configured to "yes" then constrain the job's allowed devices based on GRES
# allocated resources. It uses the devices subsystem for that. The default
# value is "no".

ConstrainDevices=yes

# ConstrainKmemSpace ###########################################################
#
# If configured to "yes" then constrain the job's Kmem RAM usage in addition to
# RAM usage. Only takes effect if ConstrainRAMSpace is set to "yes". If
# enabled, the job's Kmem limit will be assigned the value of AllowedKmemSpace
# or the value coming from MaxKmemPercent. The default value is "no" which
# will leave Kmem setting untouched by Slurm. Also see AllowedKmemSpace,
# MaxKmemPercent.

ConstrainKmemSpace=no        #avoid known Kernel issues

# ConstrainRAMSpace ############################################################
#
# If configured to "yes" then constrain the job's RAM usage by setting the
#
# memory soft limit to the allocated memory and the hard limit to the allocated
# memory * AllowedRAMSpace. The default value is "no", in which case the job's
# RAM limit will be set to its swap space limit if ConstrainSwapSpace is set to
# "yes". Also see AllowedSwapSpace, AllowedRAMSpace and ConstrainSwapSpace.
# NOTE: When using ConstrainRAMSpace, if the combined memory used by all
# processes in a step is greater than the limit, then the kernel will trigger
# an OOM event, killing one or more of the processes in the step. The step
# state will be marked as OOM, but the step itself will keep running and other
# processes in the step may continue to run as well. This differs from the
# behavior of OverMemoryKill, where the whole step will be killed/cancelled.

ConstrainRAMSpace=yes

# ConstrainSwapSpace ###########################################################
#
# If configured to "yes" then constrain the job's swap space usage. The default
# value is "no". Note that when set to "yes" and ConstrainRAMSpace is set to
# "no", AllowedRAMSpace is automatically set to 100% in order to limit the
# RAM+Swap amount to 100% of job's requirement plus the percent of allowed swap
# space. This amount is thus set to both RAM and RAM+Swap limits. This means
# that in that particular case, ConstrainRAMSpace is automatically enabled with
# the same limit as the one used to constrain swap space. Also see
# AllowedSwapSpace.
#
# To effectively use this feature you need to add swapaccount=1 to
# the kernel command line

ConstrainSwapSpace=yes

# AllowedRAMSpace ##############################################################
#
# Constrain the job/step cgroup RAM to this percentage of the allocated memory.
# The percent age supplied may be expressed as floating point number, e.g.
# 101.5. Sets the cgroup soft memory limit at the allocated memory size and
# then sets the job/step hard memory limit at the (A llowedRAMSpace/100) *
# allocated memory. If the job/step exceeds the hard limit, then it might
# trigger Out Of Memory (OOM) events (including oom-kill) which will be logged
# to kernel log ring buffer (dmesg in Linux). Setting AllowedRAMSpace above
# 100 may cause system Out of Memory (OOM) events as it allows job/step to
# allocate more memory than configured to the nodes. Reducing configured node
# available memory to avoid system OOM events is suggested. Setting
# AllowedRAMSpace below 100 will result in jobs receiving less memory than
# allocated and soft memory limit will set to the same value as the hard limit.
# Also see ConstrainRAMSpace. The default value is 100.

AllowedSwapSpace=200
