Fix hwloc_get_common_ancestor_obj in case of irregular topologies
Fix hwloc_get_common_ancestor_obj in case of irregular topologies

The while loop cannot assume that
  while (obj1 > obj2) obj1=parent;
  while (obj1 < obj2) obj2=parent;
will successfully find 2 objects with same depth and whose
ancestors always have the same depth as well.

Complexify the loop so as to always check whether current
object have same depth and start over the above loops if
needed.

We now support strange stuff such as
    root(depth=0)
   a(1)
               f(2)
   b(3)
   c(4)        g(4)
   d(5)
               h(6)
   e(7)        i(7)
that may for instance appear if using Linux cpusets
and ignoring some levels.

Thanks to Bernd Kallies for the bug report.



git-svn-id: 14be032f8f42541b1a281b51ae8ea69814daf20e@2312 4b44e086-7f34-40ce-a3bd-00e031736276

BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc