From 05766c05c8f205d70ad9fded909be47645693cf2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Gaidamour?= <jeremie.gaidamour@inria.fr>
Date: Tue, 30 Aug 2016 10:15:46 +0200
Subject: [PATCH] [dev] Replaced smp_size and smt_size by nb_procs, nb_cores
 and nb_threads

---
 generators/input-validators/schema-node.yaml        |  4 +---
 generators/oar-properties/lib/lib-oar-properties.rb | 10 +++++-----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/generators/input-validators/schema-node.yaml b/generators/input-validators/schema-node.yaml
index 9ac2077b442..cccadafa3cd 100644
--- a/generators/input-validators/schema-node.yaml
+++ b/generators/input-validators/schema-node.yaml
@@ -1,8 +1,6 @@
 ---
 architecture:
   platform_type: string
-  smp_size: integer
-  smt_size: integer
   nb_cores: integer
   nb_procs: integer
   nb_threads: integer
@@ -104,4 +102,4 @@ supported_job_types:
   max_walltime: integer
   queues: array
   virtual: optional # optional_boolean # string
-addressing_plan: optional
\ No newline at end of file
+addressing_plan: optional
diff --git a/generators/oar-properties/lib/lib-oar-properties.rb b/generators/oar-properties/lib/lib-oar-properties.rb
index 640a7fe3e85..b5c1457cc55 100755
--- a/generators/oar-properties/lib/lib-oar-properties.rb
+++ b/generators/oar-properties/lib/lib-oar-properties.rb
@@ -40,7 +40,7 @@ def get_node_properties(cluster_uid, cluster, node_uid, node)
   h['ip_virtual']      = node['supported_job_types']['virtual'] == 'ivt'
   h['virtual']         = node['supported_job_types']['virtual']
   h['cpuarch']         = node['architecture']['platform_type']
-  h['cpucore']         = node['architecture']['smt_size']/node['architecture']['smp_size']
+  h['cpucore']         = node['architecture']['nb_cores']/node['architecture']['nb_procs']
   h['cputype']         = [node['processor']['model'], node['processor']['version']].join(' ')
   h['cpufreq']         = node['processor']['clock_speed']/1_000_000_000.0
   h['disktype']        = (node['storage_devices'].first[1] || {})['interface']
@@ -77,8 +77,8 @@ def get_node_properties(cluster_uid, cluster, node_uid, node)
   puts "#{node_uid}: Warning - no rate info for the myri interface" if h['myri_count'] > 0 && h['myri_rate'] == 0
 
   #
-  h['memcore']         = node['main_memory']['ram_size']/node['architecture']['smt_size']/MiB
-  h['memcpu']          = node['main_memory']['ram_size']/node['architecture']['smp_size']/MiB
+  h['memcore']         = node['main_memory']['ram_size']/node['architecture']['nb_cores']/MiB
+  h['memcpu']          = node['main_memory']['ram_size']/node['architecture']['nb_procs']/MiB
   h['memnode']         = node['main_memory']['ram_size']/MiB
 
   node['gpu']  ||= {}
@@ -270,7 +270,7 @@ EOF
 end
 
 def oarcmd_create_node(host, properties, node_hash) # host = grifffon-1.nancy.grid5000.fr; properties, node_hash: input of the reference API for the node
-  #return "# Cannot create #{host} : not enough information about it (node_hash['architecture']['smp_size'], properties['cpucore'])" if node_hash['architecture'].nil? || properties['cpucore'].nil?
+  #return "# Cannot create #{host} : not enough information about it (node_hash['architecture']['nb_procs'], properties['cpucore'])" if node_hash['architecture'].nil? || properties['cpucore'].nil?
 
   node_uid, site_uid, grid_uid = host.split(".")
   cluster_uid, node_number     = node_uid.split("-")
@@ -279,7 +279,7 @@ def oarcmd_create_node(host, properties, node_hash) # host = grifffon-1.nancy.gr
   command += 'list_contains "$nodelist" "' + host + '" && '
   command += "echo '=> host already exist'\n"
   command += 'list_contains "$nodelist" "' + host + '" || '
-  command += "oar_resources_add -a --hosts 1 --host0 #{node_number} --host-prefix #{cluster_uid}- --host-suffix .#{site_uid}.#{grid_uid}.fr --cpus #{node_hash['architecture']['smp_size']} --cores #{properties['cpucore']}"
+  command += "oar_resources_add -a --hosts 1 --host0 #{node_number} --host-prefix #{cluster_uid}- --host-suffix .#{site_uid}.#{grid_uid}.fr --cpus #{node_hash['architecture']['nb_procs']} --cores #{properties['cpucore']}"
   command += ' | bash'
   
   return command + "\n"
-- 
GitLab