Skip to content

Commit 45ac2a2

Browse files
committed
lstopo/draw: cleanup horiz/vert layout management
Add a ratio for the memory:above box but it's not used yet. When rectangular layout will be allowed there, it'll be very wide. Signed-off-by: Brice Goglin <[email protected]>
1 parent 4310576 commit 45ac2a2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

utils/lstopo/lstopo-draw.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,6 @@ static float pci_link_speed(hwloc_obj_t obj)
371371
* Placing children in rectangle
372372
*/
373373

374-
/* preferred width/height compromise */
375-
#define RATIO (4.f/3.f)
376-
377374
/* returns a score <= 1. close to 1 is better */
378375
static __hwloc_inline
379376
float rectangle_score(unsigned width, unsigned height, float ratio)
@@ -553,10 +550,13 @@ place_children_rect(struct lstopo_output *loutput, hwloc_obj_t parent,
553550
float ratio;
554551
int i;
555552

556-
if (parent->type == HWLOC_OBJ_CORE)
557-
ratio = 1/RATIO;
553+
/* preferred width/height compromise */
554+
if (kind == LSTOPO_CHILD_KIND_MEMORY)
555+
ratio = 8.f; /* very large for memory above objects since the parent is usually very large */
556+
else if (parent->type == HWLOC_OBJ_CORE)
557+
ratio = 3.f/4.f; /* rather high Core objects since they often contain 2 PUs that we don't want horizontal */
558558
else
559-
ratio = RATIO;
559+
ratio = 4.f/3.f; /* rather largeother objects */
560560
find_children_rectangle(loutput, parent, kind, separator, &rows, &columns, ratio);
561561

562562
rowwidth = 0;

0 commit comments

Comments
 (0)