On one of my Linux machines I'm getting a crash if I do a
hwloc_topology_load() while ignoring HWLOC_OBJ_NODE.

#0  hwloc_cpuset_orset (set=0x605410, modifier_set=0x0) at cpuset.c:410
#1  0x00007fc87f943146 in hwloc__setup_misc_level_from_distances (
    topology=0x604010, nbobjs=4, objs=0x7fff8228c750,
    _distances=0x7fff8228c700, depth=0) at topology.c:256
#2  0x00007fc87f945fe8 in look_sysfsnode (topology=0x604010,
    path=0x7fc87f9487c6 "/sys/devices/system/node",
    admin_disabled_cpus_set=0x605080, admin_disabled_mems_set=0x605110)
    at topology-linux.c:600
#3  0x00007fc87f946e0f in hwloc_look_linux (topology=0x604010)
    at topology-linux.c:1052
#4  0x00007fc87f941fc9 in hwloc_topology_load (topology=0x604010)
    at topology.c:904
#5  0x000000000040155d in main (argc=2, argv=0x7fff8228ccd8) at hwwalk.c:386

  The following patch fixes it.

--- hwloc-0.9.2/src/topology-linux.c    2009-11-03 16:40:31.000000000 -0600
+++ hwloc-new//src/topology-linux.c     2009-11-19 14:20:43.630035434 -0600
@@ -536,6 +536,10 @@
   struct dirent *dirent;
   hwloc_obj_t node;

+  if (topology->ignored_types[HWLOC_OBJ_NODE] ==
HWLOC_IGNORE_TYPE_ALWAYS) {
+         return;
+  }
+
   dir = hwloc_opendir(path, topology->backend_params.sysfs.root_fd);
   if (dir)
     {

  Also I'm concerned about the value of CPUSET_MASK_LEN in
hwloc_admin_disable_set_from_cpuset().  It's only 64 characters but our
Linux boxes can have to 2048 processors.  I don't think there's any harm
in bumping that up a little.

-- 
Michael A. Raymond
Message Passing Toolkit Team
Silicon Graphics Inc
(651) 683-3434

Reply via email to