Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c3c4516e authored by LOUP David's avatar LOUP David
Browse files

Check new core numbering scheme (pyxis) in valid:oar-properties

parent e5b0d590
No related branches found
No related tags found
No related merge requests found
Pipeline #138476 passed
# coding: utf-8
require 'refrepo/data_loader'
require 'net/ssh'
require 'hashdiff'
......@@ -13,6 +14,7 @@ G5K_PROPERTIES=%w{api_timestamp available_upto besteffort chassis chunks cluster
module RefRepo::Valid::OarProperties
def self.check(options)
ret = true
refapi = load_data_hierarchy
options[:sites].each do |site|
puts "Checking site #{site}..."
resources = RefRepo::Utils::get_api("sites/#{site}/internal/oarapi/resources/details.json?limit=1000000")['items']
......@@ -77,6 +79,7 @@ module RefRepo::Valid::OarProperties
raise "Invalid: varying nbcores inside cluster!"
end
nbcores = nbcores.first
refapi_host = refapi['sites'][site]['clusters'][cluster]['nodes'][host.split('.')[0]]
if host_resources.length != nbcores
puts "ERROR: invalid number of resources for #{host}. should be nbcores."
......@@ -100,10 +103,22 @@ module RefRepo::Valid::OarProperties
ret = false
end
# the last cpuset should be nbcores-1
if host_cpusets_max - host_cpusets_min + 1 != nbcores
if host_cpusets_max - host_cpusets_min + 1 != nbcores and refapi_host['architecture']['cpu_core_numbering'] != 'contiguous-including-threads'
puts "ERROR: cpuset values for #{host} are not sequential"
ret = false
end
# Core numbering is different with contiguous-including-threads
if refapi_host['architecture']['cpu_core_numbering'] == 'contiguous-including-threads'
cpu_num_max = refapi_host['architecture']['nb_procs'] - 1
thread_per_cpu = refapi_host['architecture']['nb_threads'] / refapi_host['architecture']['nb_procs']
core_per_cpu = nbcores / refapi_host['architecture']['nb_procs']
if host_cpusets_max != cpu_num_max * thread_per_cpu + core_per_cpu - 1
puts "ERROR: cpuset values for #{host} do not match contiguous-including-threads core numbering"
ret = false
end
end
if options[:verbose] and (host_cpusets_max - host_cpusets_min + 1 != nbcores or host_cores_max - host_cores_min + 1 != nbcores)
puts "id cpu core cpuset"
pp(host_resources.map { |e| [e['id'], e['cpu'], e['core'], e['cpuset'] ] })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment