Skip to content

Commit

Permalink
lstopo/draw: cleanup horiz/vert layout management
Browse files Browse the repository at this point in the history
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 <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed May 15, 2023
1 parent 4310576 commit 45ac2a2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions utils/lstopo/lstopo-draw.c
Expand Up @@ -371,9 +371,6 @@ static float pci_link_speed(hwloc_obj_t obj)
* Placing children in rectangle
*/

/* preferred width/height compromise */
#define RATIO (4.f/3.f)

/* returns a score <= 1. close to 1 is better */
static __hwloc_inline
float rectangle_score(unsigned width, unsigned height, float ratio)
Expand Down Expand Up @@ -553,10 +550,13 @@ place_children_rect(struct lstopo_output *loutput, hwloc_obj_t parent,
float ratio;
int i;

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

rowwidth = 0;
Expand Down

0 comments on commit 45ac2a2

Please sign in to comment.