root/opal/mca/hwloc/hwloc201/hwloc/hwloc/topology-hardwired.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. hwloc_look_hardwired_fujitsu_k
  2. hwloc_look_hardwired_fujitsu_fx10
  3. hwloc_look_hardwired_fujitsu_fx100

   1 /*
   2  * Copyright © 2015-2017 Inria.  All rights reserved.
   3  * See COPYING in top-level directory.
   4  */
   5 
   6 #include <private/autogen/config.h>
   7 
   8 #include <hwloc.h>
   9 #include <private/private.h>
  10 
  11 int hwloc_look_hardwired_fujitsu_k(struct hwloc_topology *topology)
  12 {
  13   /* If a broken core gets disabled, its bit disappears and other core bits are NOT shifted towards 0.
  14    * Node is not given to user job, not need to handle that case properly.
  15    */
  16   unsigned i;
  17   hwloc_obj_t obj;
  18   hwloc_bitmap_t set;
  19 
  20   for(i=0; i<8; i++) {
  21     set = hwloc_bitmap_alloc();
  22     hwloc_bitmap_set(set, i);
  23 
  24     if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L1ICACHE)) {
  25       obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_L1ICACHE, HWLOC_UNKNOWN_INDEX);
  26       obj->cpuset = hwloc_bitmap_dup(set);
  27       obj->attr->cache.type = HWLOC_OBJ_CACHE_INSTRUCTION;
  28       obj->attr->cache.depth = 1;
  29       obj->attr->cache.size = 32*1024;
  30       obj->attr->cache.linesize = 128;
  31       obj->attr->cache.associativity = 2;
  32       hwloc_insert_object_by_cpuset(topology, obj);
  33     }
  34     if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L1CACHE)) {
  35       obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_L1CACHE, HWLOC_UNKNOWN_INDEX);
  36       obj->cpuset = hwloc_bitmap_dup(set);
  37       obj->attr->cache.type = HWLOC_OBJ_CACHE_DATA;
  38       obj->attr->cache.depth = 1;
  39       obj->attr->cache.size = 32*1024;
  40       obj->attr->cache.linesize = 128;
  41       obj->attr->cache.associativity = 2;
  42       hwloc_insert_object_by_cpuset(topology, obj);
  43     }
  44     if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_CORE)) {
  45       obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_CORE, i);
  46       obj->cpuset = set;
  47       hwloc_insert_object_by_cpuset(topology, obj);
  48     } else
  49       hwloc_bitmap_free(set);
  50   }
  51 
  52   set = hwloc_bitmap_alloc();
  53   hwloc_bitmap_set_range(set, 0, 7);
  54 
  55   if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L2CACHE)) {
  56     obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_L2CACHE, HWLOC_UNKNOWN_INDEX);
  57     obj->cpuset = hwloc_bitmap_dup(set);
  58     obj->attr->cache.type = HWLOC_OBJ_CACHE_UNIFIED;
  59     obj->attr->cache.depth = 2;
  60     obj->attr->cache.size = 6*1024*1024;
  61     obj->attr->cache.linesize = 128;
  62     obj->attr->cache.associativity = 12;
  63     hwloc_insert_object_by_cpuset(topology, obj);
  64   }
  65   if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_PACKAGE)) {
  66     obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_PACKAGE, 0);
  67     obj->cpuset = set;
  68     hwloc_obj_add_info(obj, "CPUVendor", "Fujitsu");
  69     hwloc_obj_add_info(obj, "CPUModel", "SPARC64 VIIIfx");
  70     hwloc_insert_object_by_cpuset(topology, obj);
  71   } else
  72     hwloc_bitmap_free(set);
  73 
  74   topology->support.discovery->pu = 1;
  75   hwloc_setup_pu_level(topology, 8);
  76 
  77   return 0;
  78 }
  79 
  80 int hwloc_look_hardwired_fujitsu_fx10(struct hwloc_topology *topology)
  81 {
  82   /* If a broken core gets disabled, its bit disappears and other core bits are NOT shifted towards 0.
  83    * Node is not given to user job, not need to handle that case properly.
  84    */
  85   unsigned i;
  86   hwloc_obj_t obj;
  87   hwloc_bitmap_t set;
  88 
  89   for(i=0; i<16; i++) {
  90     set = hwloc_bitmap_alloc();
  91     hwloc_bitmap_set(set, i);
  92 
  93     if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L1ICACHE)) {
  94       obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_L1ICACHE, HWLOC_UNKNOWN_INDEX);
  95       obj->cpuset = hwloc_bitmap_dup(set);
  96       obj->attr->cache.type = HWLOC_OBJ_CACHE_INSTRUCTION;
  97       obj->attr->cache.depth = 1;
  98       obj->attr->cache.size = 32*1024;
  99       obj->attr->cache.linesize = 128;
 100       obj->attr->cache.associativity = 2;
 101       hwloc_insert_object_by_cpuset(topology, obj);
 102     }
 103     if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L1CACHE)) {
 104       obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_L1CACHE, HWLOC_UNKNOWN_INDEX);
 105       obj->cpuset = hwloc_bitmap_dup(set);
 106       obj->attr->cache.type = HWLOC_OBJ_CACHE_DATA;
 107       obj->attr->cache.depth = 1;
 108       obj->attr->cache.size = 32*1024;
 109       obj->attr->cache.linesize = 128;
 110       obj->attr->cache.associativity = 2;
 111       hwloc_insert_object_by_cpuset(topology, obj);
 112     }
 113     if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_CORE)) {
 114       obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_CORE, i);
 115       obj->cpuset = set;
 116       hwloc_insert_object_by_cpuset(topology, obj);
 117     } else
 118       hwloc_bitmap_free(set);
 119   }
 120 
 121   set = hwloc_bitmap_alloc();
 122   hwloc_bitmap_set_range(set, 0, 15);
 123 
 124   if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L2CACHE)) {
 125     obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_L2CACHE, HWLOC_UNKNOWN_INDEX);
 126     obj->cpuset = hwloc_bitmap_dup(set);
 127     obj->attr->cache.type = HWLOC_OBJ_CACHE_UNIFIED;
 128     obj->attr->cache.depth = 2;
 129     obj->attr->cache.size = 12*1024*1024;
 130     obj->attr->cache.linesize = 128;
 131     obj->attr->cache.associativity = 24;
 132     hwloc_insert_object_by_cpuset(topology, obj);
 133   }
 134   if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_PACKAGE)) {
 135     obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_PACKAGE, 0);
 136     obj->cpuset = set;
 137     hwloc_obj_add_info(obj, "CPUVendor", "Fujitsu");
 138     hwloc_obj_add_info(obj, "CPUModel", "SPARC64 IXfx");
 139     hwloc_insert_object_by_cpuset(topology, obj);
 140   } else
 141     hwloc_bitmap_free(set);
 142 
 143   topology->support.discovery->pu = 1;
 144   hwloc_setup_pu_level(topology, 16);
 145 
 146   return 0;
 147 }
 148 
 149 int hwloc_look_hardwired_fujitsu_fx100(struct hwloc_topology *topology)
 150 {
 151   /* If a broken core gets disabled, its bit disappears and other core bits are NOT shifted towards 0.
 152    * Node is not given to user job, not need to handle that case properly.
 153    */
 154   unsigned i;
 155   hwloc_obj_t obj;
 156   hwloc_bitmap_t set;
 157 
 158   for(i=0; i<34; i++) {
 159     set = hwloc_bitmap_alloc();
 160     hwloc_bitmap_set(set, i);
 161 
 162     if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L1ICACHE)) {
 163       obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_L1ICACHE, HWLOC_UNKNOWN_INDEX);
 164       obj->cpuset = hwloc_bitmap_dup(set);
 165       obj->attr->cache.type = HWLOC_OBJ_CACHE_INSTRUCTION;
 166       obj->attr->cache.depth = 1;
 167       obj->attr->cache.size = 64*1024;
 168       obj->attr->cache.linesize = 256;
 169       obj->attr->cache.associativity = 4;
 170       hwloc_insert_object_by_cpuset(topology, obj);
 171     }
 172     if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L1CACHE)) {
 173       obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_L1CACHE, HWLOC_UNKNOWN_INDEX);
 174       obj->cpuset = hwloc_bitmap_dup(set);
 175       obj->attr->cache.type = HWLOC_OBJ_CACHE_DATA;
 176       obj->attr->cache.depth = 1;
 177       obj->attr->cache.size = 64*1024;
 178       obj->attr->cache.linesize = 256;
 179       obj->attr->cache.associativity = 4;
 180       hwloc_insert_object_by_cpuset(topology, obj);
 181     }
 182     if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_CORE)) {
 183       obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_CORE, i);
 184       obj->cpuset = set;
 185       hwloc_insert_object_by_cpuset(topology, obj);
 186     } else
 187       hwloc_bitmap_free(set);
 188   }
 189 
 190   if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L2CACHE)) {
 191     obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_L2CACHE, HWLOC_UNKNOWN_INDEX);
 192     obj->cpuset = hwloc_bitmap_alloc();
 193     hwloc_bitmap_set_range(obj->cpuset, 0, 15);
 194     hwloc_bitmap_set(obj->cpuset, 32);
 195     obj->attr->cache.type = HWLOC_OBJ_CACHE_UNIFIED;
 196     obj->attr->cache.depth = 2;
 197     obj->attr->cache.size = 12*1024*1024;
 198     obj->attr->cache.linesize = 256;
 199     obj->attr->cache.associativity = 24;
 200     hwloc_insert_object_by_cpuset(topology, obj);
 201 
 202     obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_L2CACHE, HWLOC_UNKNOWN_INDEX);
 203     obj->cpuset = hwloc_bitmap_alloc();
 204     hwloc_bitmap_set_range(obj->cpuset, 16, 31);
 205     hwloc_bitmap_set(obj->cpuset, 33);
 206     obj->attr->cache.type = HWLOC_OBJ_CACHE_UNIFIED;
 207     obj->attr->cache.depth = 2;
 208     obj->attr->cache.size = 12*1024*1024;
 209     obj->attr->cache.linesize = 256;
 210     obj->attr->cache.associativity = 24;
 211     hwloc_insert_object_by_cpuset(topology, obj);
 212   }
 213   if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_PACKAGE)) {
 214     obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_PACKAGE, 0);
 215     obj->cpuset = hwloc_bitmap_alloc();
 216     hwloc_bitmap_set_range(obj->cpuset, 0, 33);
 217     hwloc_obj_add_info(obj, "CPUVendor", "Fujitsu");
 218     hwloc_obj_add_info(obj, "CPUModel", "SPARC64 XIfx");
 219     hwloc_insert_object_by_cpuset(topology, obj);
 220   }
 221 
 222   topology->support.discovery->pu = 1;
 223   hwloc_setup_pu_level(topology, 34);
 224 
 225   return 0;
 226 }

/* [<][>][^][v][top][bottom][index][help] */