Complete rework of the distance-based grouping ...
Complete rework of the distance-based grouping ...

Complete rework of the distance-based grouping code.

The old code did not work well on a HP Integrity Superdome sx2000
because the distance matrix is strange:
 10 17 20 20 14
 17 10 20 20 14
 20 20 10 17 14
 20 20 17 10 14
 14 14 14 14 10
There are actually 17 nodes in the machine (with four dual-core
Itanium in each). I simplified the matrix for clarity here.

The somehow special node#4 is some sort of central node with very
few memory. It may be useless for applications, but it broke the
grouping code since it has minimal distance to everybody.

hwloc 1.0.x we would group node#3 and node#4, then group the result
with node#2, then group the result with node#0 and node#1, ...
The bug in the code was that we would recognize
 10 14
 14 10
as a minimal distance clique, and we would ignore the fact that
these guys also have distance=14 to some other guys.

So this case needs a mix between the existing grouping codes based
on cliques and transitivity graphs. Fixing the minimal-distance
cliques detection would require some transitivity-like code.
So I am just merging both detection codes into a single and
cleaner one that only use transitivity graphs.

Now, we create no group at all on this machine. It would be better
if we could ignore node#4 and let the grouping work on nodes#0-3
but I don't see any easy way to do that. Maybe explicitly detect
objects that have exactly the same distance to everybody and place
them on the side during grouping.

This commit may be too big for backporting in the 1.0 branch.
Given that this bug occurs on very rare machines, setting
HWLOC_IGNORE_DISTANCES=1 in the environment may be enough
in this case for now.

Thanks to Domingo Jimenez Canovas, Juan Alejandro Palomino Benito
and Abdou Guermouche for providing useful debugging info.
I am waiting for their ack before adding the sysfs tarball of
this machine in tests/linux/

This commit was SVN r2232.

ggouaillardet/hwloc,ggouaillardet/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc,shekkbuilder/hwloc,shekkbuilder/hwloc