Defined Type: slurm::gres

Defined in:
manifests/gres.pp

Summary

Manage SLURM GRES configuration

Overview

Examples:

Add static GPU GRES

slurm::gres { 'gpu':
  type  => 'v100',
  file  => '/dev/nvidia0',
  cores => '0,1',
}

Add nvml AutoDetect gres

slurm::gres { 'nvml':
  auto_detect => 'nvml',
}

Parameters:

  • gres_name (Any) (defaults to: $name)
  • type (Any) (defaults to: undef)
  • node_name (Any) (defaults to: undef)
  • auto_detect (Optional[Enum['nvml','rsmi']]) (defaults to: undef)
  • count (Any) (defaults to: undef)
  • cores (Any) (defaults to: undef)
  • file (Any) (defaults to: undef)
  • flags (Optional[Enum['CountOnly']]) (defaults to: undef)
  • links (Any) (defaults to: undef)
  • switch_name (Any) (defaults to: $name)
  • switches (Any) (defaults to: undef)
  • link_speed (Any) (defaults to: undef)
  • order (Any) (defaults to: '50')


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'manifests/gres.pp', line 30

define slurm::gres (
  $gres_name = $name,
  $type = undef,
  $node_name = undef,
  Optional[Enum['nvml','rsmi']] $auto_detect = undef,
  $count = undef,
  $cores = undef,
  $file = undef,
  Optional[Enum['CountOnly']] $flags = undef,
  $links = undef,
  $switch_name = $name,
  $switches = undef,
  $link_speed = undef,
  $order = '50',
) {

  include ::slurm

  if $auto_detect {
    $conf_values = {
      'NodeName'   => $node_name,
      'AutoDetect' => $auto_detect,
    }
  } else {
    $conf_values = {
      'NodeName' => $node_name,
      'Name' => $gres_name,
      'Type' => $type,
      'AutoDetect' => $auto_detect,
      'Count' => $count,
      'Cores' => $cores,
      'File' => $file,
      'Flags' => $flags,
      'Links' => $links,
    }
  }

  concat::fragment { "slurm-gres.conf-${name}":
    target  => 'slurm-gres.conf',
    content => template($::slurm::gres_template),
    order   => $order,
  }

}