Skip to content

Commit

Permalink
Add PCI devices to topology_info
Browse files Browse the repository at this point in the history
  • Loading branch information
JBlaschke committed Jan 6, 2024
1 parent 9b529e9 commit 7e4bd47
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ Machine: 1 (31.05 GB)
L1Cache: 4 (48.0 kB)
Core: 4
PU: 8
Bridge: 6
PCI_Device: 22
OS_Device: 13
```

If you prefer a more verbose graphical visualization you may consider using `topology_graphical()`:
Expand Down Expand Up @@ -112,15 +115,18 @@ One may also use `getinfo()` to programmatically access some of the output of `t

```julia
julia> getinfo()
Dict{Symbol, Int64} with 8 entries:
:L2Cache => 4
:NUMANode => 1
:Core => 4
:Package => 1
:L1Cache => 4
:Machine => 1
:PU => 8
:L3Cache => 1
Dict{Symbol, Int64} with 11 entries:
:Package => 1
:PU => 8
:OS_Device => 13
:Core => 4
:L3Cache => 1
:Machine => 1
:PCI_Device => 22
:L2Cache => 4
:NUMANode => 1
:Bridge => 6
:L1Cache => 4
```


Expand Down
6 changes: 4 additions & 2 deletions src/highlevel_api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,13 @@ Prints the system topology as a tree.
topology(topo=gettopology()) = print_topology(topo)

"""
topology_info(topo=gettopology())
Prints a summary of the system topology (loosely similar to `hwloc-info`).
"""
function topology_info()
function topology_info(topo=gettopology())
nodes = Tuple{Symbol, Int64, String}[]
for subobj in gettopology()
for subobj in topo
idx = findfirst(t->t[1] == subobj.type_, nodes)
if isnothing(idx)
attrstr = ""
Expand Down

0 comments on commit 7e4bd47

Please sign in to comment.