4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 - name: Set requested CPUs.
18 cpu_request: "{% if cpu_set.opt is defined %}{{ perf_profile[cpu_set.opt] }}{% else %}{{ cpu_set.request }}{% endif %}"
20 - name: Allocate CPU set.
22 allocated_cpu_set: "{{ cpu_topology | cpu_topology_alloc(cpu_request, cpu_set.where) }}"
24 - name: Append allocated CPU set.
26 combined_cpu_set: "{{ allocated_cpu_set | union(cpu_sets[cpu_set.name] | default([])) | sort }}"
30 cpu_sets: "{{ cpu_sets | combine({ cpu_set.name: combined_cpu_set }) }}"
31 cpu_topology: "{{ cpu_topology | cpu_topology_trim(cpu_request, cpu_set.where) }}"
33 - name: Show created CPU sets.
37 - name: Show CPU topology after sets creation.