]> xenbits.xensource.com Git - people/andrewcoop/hwloc.git/commitdiff
Add a Backend=Custom info attribute to custom-i...
authorBrice Goglin <brice.goglin@inria.fr>
Wed, 29 May 2013 09:52:24 +0000 (09:52 +0000)
committerBrice Goglin <brice.goglin@inria.fr>
Wed, 29 May 2013 09:52:24 +0000 (09:52 +0000)
Add a Backend=Custom info attribute to custom-inserted objects

Will be used soon

This commit was SVN r5651.

src/topology-custom.c
utils/test-hwloc-assembler.output

index 2ae27b184532cc344805799461a37966e7b55e60..23077bfde7034701914545a05f2644436f25ef5d 100644 (file)
@@ -20,6 +20,7 @@ hwloc_custom_insert_group_object_by_parent(struct hwloc_topology *topology, hwlo
 
   obj = hwloc_alloc_setup_object(HWLOC_OBJ_GROUP, -1);
   obj->attr->group.depth = groupdepth;
+  hwloc_obj_add_info(obj, "Backend", "Custom");
   hwloc_insert_object_by_parent(topology, parent, obj);
   /* insert_object_by_parent() doesn't merge during insert, so obj is still valid */
 
@@ -51,15 +52,17 @@ static int
 hwloc_look_custom(struct hwloc_backend *backend)
 {
   struct hwloc_topology *topology = backend->topology;
+  hwloc_obj_t root = topology->levels[0][0];
 
-  assert(!topology->levels[0][0]->cpuset);
+  assert(!root->cpuset);
 
-  if (!topology->levels[0][0]->first_child) {
+  if (!root->first_child) {
     errno = EINVAL;
     return -1;
   }
 
-  topology->levels[0][0]->type = HWLOC_OBJ_SYSTEM;
+  root->type = HWLOC_OBJ_SYSTEM;
+  hwloc_obj_add_info(root, "Backend", "Custom");
   return 1;
 }
 
index b3015135ecc5c0ebcfc8ff8e9f9c269e147eeccc..9739ee31e93496c245aff814dbd7e7e95fde28bb 100644 (file)
@@ -2,6 +2,7 @@
 <!DOCTYPE topology SYSTEM "hwloc.dtd">
 <topology>
   <object type="System" os_index="0">
+    <info name="Backend" value="Custom"/>
     <object type="Machine" os_index="0" cpuset="0x0000000f" complete_cpuset="0x0000000f" online_cpuset="0x0000000f" allowed_cpuset="0x0000000f" name="machine1" local_memory="4014239744">
       <page_type size="4096" count="980039"/>
       <page_type size="2097152" count="0"/>