Skip to content

Commit

Permalink
fix how settings are filtered through
Browse files Browse the repository at this point in the history
  • Loading branch information
JBlaschke committed Dec 31, 2023
1 parent 8fc464f commit 694e629
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/highlevel_api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ end
"""
print_topology(
io::IO = stdout, obj::Object = gettopology();
indent = "", newline = false, prefix = "", minimal=true
indent = "", newline = true, prefix = "", minimal=true
)
Prints the topology of the given `obj` as a tree to `io`.
Expand All @@ -61,7 +61,7 @@ unless `minimal=false`.
"""
function print_topology(
io::IO = stdout, obj::Object = gettopology();
indent = "", newline = false, prefix = "", minimal=true
indent = "", newline = true, prefix = "", minimal=true
)
t = hwloc_typeof(obj)

Expand Down Expand Up @@ -131,14 +131,23 @@ function print_topology(
for child in obj.children
no_newline = length(obj.children)==1 && t in (:L3Cache, :L2Cache, :L1Cache)
if no_newline
print_topology(io, child; indent = indent, newline=false, prefix = " + ", )
print_topology(
io, child;
indent = indent, newline=newline, prefix = " + ", minimal=minimal
)
else
print_topology(io, child; indent = indent*repeat(" ", 4), newline=true)
print_topology(
io, child;
indent = indent*repeat(" ", 4), newline=newline, minimal=minimal
)
end
end

for child in obj.io_children
print_topology(io, child; indent=indent*repeat(" ", 4), newline=true)
print_topology(
io, child;
indent=indent*repeat(" ", 4), newline=newline, minimal=minimal
)
end

return nothing
Expand Down

0 comments on commit 694e629

Please sign in to comment.