Skip to content

Commit

Permalink
Allow for TRESBillingWeights
Browse files Browse the repository at this point in the history
- See Issue #16

Signed-off-by: Sebastien Varrette <Sebastien.Varrette@uni.lu>
  • Loading branch information
Sebastien Varrette authored and Sebastien Varrette committed Feb 2, 2019
1 parent 8b8594a commit 881d40e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
9 changes: 3 additions & 6 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# Time-stamp: <Tue 2019-01-29 21:36 svarrette>
# Time-stamp: <Fri 2019-02-01 23:54 svarrette>
#
# File:: <tt>init.pp</tt>
# Author:: UL HPC Team (hpc-sysadmins@uni.lu)
Expand Down Expand Up @@ -82,9 +82,9 @@
# @param clustername [String] Default: 'cluster'
# The name by which this Slurm managed cluster is known in the accounting database
#
# @param accountingstorageTRES [String] Default: ''
# @param acct_gatherenergytype [String] Default: 'none'
# @param accountingstoragehost [String] Default: $:hostname
# @param accountingstorageTRES [String] Default: ''
# @param acct_gatherenergytype [String] Default: 'none'
# Identifies the plugin to be used for energy consumption accounting
# Elligible values in [ 'none', 'ipmi', 'rapl' ]
# @paraù acct_storageenforce [Array] Default: ['qos', 'limits', 'associations']
Expand Down Expand Up @@ -238,8 +238,6 @@
# @param taskpluginparams [Array ] Default: ['cpusets']
# @param taskprolog [String ] Default: ''
# @param tmpfs [String ] Default: '/tmp'
# @param tresbillingweights [String] Default: ''
# Normally associated to your partition definitions (typically under the 'DEFAULT' partition settings)
# @param waittime [Integer] Default: 0
#
############################ ####################################
Expand Down Expand Up @@ -561,7 +559,6 @@
# Trackable RESources (TRES)
String $accountingstorageTRES = $slurm::params::accountingstorageTRES,
String $priorityweightTRES = $slurm::params::priorityweightTRES,
String $tresbillingweights = $slurm::params::tresbillingweights,

#
# Which topology plugin to be used for determining the network topology and
Expand Down
18 changes: 7 additions & 11 deletions templates/slurm.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -317,24 +317,19 @@ PriorityWeightQOS=<%= scope['slurm::priorityweightqos'] %>
### Trackable RESources (TRES) policies ###
###########################################
# See https://slurm.schedmd.com/tres.html
# Define which TRES are to be tracked on the system
<% if scope['slurm::accountingstorageTRES'].empty? -%>
# AccountingStorageTRES = cpu,mem,energy,node,billing
<% else -%>
# Define which TRES are to be tracked on the system in addition to the default
# billing, cpu, energy, memory and node
<% unless scope['slurm::accountingstorageTRES'].empty? -%>
AccountingStorageTRES=<%= scope['slurm::accountingstorageTRES'] %>
<% end -%>
<% if scope['slurm::priorityweightTRES'].empty? -%>
# PriorityWeightTRES =
<% else -%>
PriorityWeightTRES=<%= scope['slurm::priorityweightTRES'] %>
<% end -%>
# For each partition this option is used to define the billing weights of each
# TRES type that will be used in calculating the usage of a job.
<% if scope['slurm::tresbillingweights'].empty? -%>
# TRESBillingWeights =
<% else -%>
TRESBillingWeights=<%= scope['slurm::tresbillingweights'] %>
<% end -%>
# For each partition (or in the 'DEFAULT' setting), use the TRESBillingWeights
# option to define the billing weights of each TRES type that will be used in
# calculating the usage of a job.


###########################
Expand Down Expand Up @@ -492,6 +487,7 @@ NodeName=<%= name.ljust(12) %> <%= content %>
<% content << " AllowGroups=#{v['allowgroups'].is_a?(Array) ? v['allowgroups'].join(',') : v['allowgroups']}" if v['allowgroups'] -%>
<% content << " AllowQos=#{v['allowqos'].is_a?(Array) ? v['allowqos'].join(',') : v['allowqos']}" if v['allowqos'] -%>
<% content << ' DisableRootJobs=YES' if (!v['disablerootjobs'].nil? and v['disablerootjobs'] and content !~ /DisableRootJobs=/) -%>
<% content << " TRESBillingWeights=#{v['TRESbillingweights'].is_a?(Array) ? v['TRESbillingweights'].join(',') : v['TRESbillingweights']}" if v['TRESbillingweights'] -%>
<% end -%>
<% unless (content.nil? or content.empty?) -%>
PartitionName=<%= name.ljust(12) %> <%= content %>
Expand Down

0 comments on commit 881d40e

Please sign in to comment.