|
17 | 17 | hwloc_topology_t aml_topology;
|
18 | 18 | hwloc_const_bitmap_t allowed_nodeset;
|
19 | 19 |
|
20 |
| -#define OBJ_DIST(dist, i, j, row_stride, col_stride) \ |
21 |
| - (dist)->values[((i)->logical_index + row_stride) * (dist)->nbobjs + \ |
22 |
| - col_stride + (j)->logical_index] |
| 20 | +#define OBJ_DIST(dist, i, j, row_offset, col_offset) \ |
| 21 | + (dist)->values[((i)->logical_index + row_offset) * (dist)->nbobjs + \ |
| 22 | + col_offset + (j)->logical_index] |
23 | 23 |
|
24 | 24 | #define IND_DIST(dist, i, j) (dist)->values[(i) * (dist)->nbobjs + (j)]
|
25 | 25 |
|
@@ -99,7 +99,12 @@ int aml_hwloc_distance_lt(const void *a_ptr, const void *b_ptr)
|
99 | 99 | {
|
100 | 100 | struct aml_hwloc_distance *a = (struct aml_hwloc_distance *)a_ptr;
|
101 | 101 | struct aml_hwloc_distance *b = (struct aml_hwloc_distance *)b_ptr;
|
102 |
| - return a->distance < b->distance; |
| 102 | + if (a->distance < b->distance) |
| 103 | + return -1; |
| 104 | + else if (a->distance > b->distance) |
| 105 | + return 1; |
| 106 | + else |
| 107 | + return 0; |
103 | 108 | }
|
104 | 109 |
|
105 | 110 | /**
|
@@ -346,7 +351,7 @@ static int aml_hwloc_distances_reshape(struct hwloc_distances_s *dist,
|
346 | 351 | goto err_with_out;
|
347 | 352 | OBJ_DIST(*out, obj0, obj1, 0, nt0) = d0;
|
348 | 353 | OBJ_DIST(*out, obj1, obj0, nt0, 0) = d1;
|
349 |
| - obj1 = hwloc_get_next_obj_by_depth(aml_topology, depth0, |
| 354 | + obj1 = hwloc_get_next_obj_by_depth(aml_topology, depth1, |
350 | 355 | obj1);
|
351 | 356 | }
|
352 | 357 | obj0 = hwloc_get_next_obj_by_depth(aml_topology, depth0, obj0);
|
|
0 commit comments