Skip to content

Commit

Permalink
utils: add some comments in some test outputs
Browse files Browse the repository at this point in the history
So that it's easier to find out where to update outputs.

Don't use "set -x" because it would expose some paths that
differ between build. And also because some quotes or
backquotes would be interpreted before being displayed.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Apr 14, 2020
1 parent 459b6ec commit 9922a2a
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 2 deletions.
98 changes: 98 additions & 0 deletions utils/hwloc/test-hwloc-calc.output
@@ -1,76 +1,174 @@
# root
0xffffffff,0xffffffff

# all --taskset
0xffffffffffffffff

# hex
0x0000000f

# hex combination
0x00000f0c

# object combination
0x0000800a

# --no-smt NUMA Node range
0x11111111,0x0

# --no-smt hex
0x00000112

# --no-smt=1 hex
0x00000024

# --no-smt=2 hex
0x00000048

# --no-smt=3 hex
0x00000080

# --no-smt=4 hex
0x0

# --no-smt=-1 hex
0x000001fe

# even PUs
0x55555555,0x55555555

# NUMA Nodes 2+
0xffffffff,0x0

# cores 12+
0xffff0000,0x0

# PU wrapping range
0xc0000000,0x000000ff

# some PUs in all Cores
0x66666666,0x66666666

# one PU in odd Cores
0x10101010,0x10101010

# combination of different ranges, hierarchical or not
0x8000c000,0x000ee0c0

# Number of NUMA Nodes
4

# Number of Cores in a NUMA Node
4

# Number of objects at depth 3 in a NUMA Node
16

# List of Machine objects
0

# List of NUMA Nodes in a range of Cores
1

# List of NUMA Nodes in a range of Cores (again)
2,3

# Hierarchical spec for a range of PUs
Group0:0.PU:2 Group0:0.PU:3

# Hierarchical spec for a range of PUs, with different separator
Group0:0.Core:0fooGroup0:0.Core:1

# Hierarchical spec for a range of PUs (again)
Core:0.PU:3 Core:1.PU:0 Core:1.PU:1 Core:1.PU:2

# List of PUs from another invocation with hierarchical output
3,4,5,6

# Hierarchical spec for a range of PUs (3 levels)
Group0:0.Core:2.PU:3 Group0:0.Core:3.PU:0 Group0:0.Core:3.PU:1 Group0:0.Core:3.PU:2

# List of PUs from another invocation with hierarchical output (again)
11,12,13,14

# --largest
Core:3 Group0:1 Core:8 PU:36 PU:37

# --largest, with different separator
PU:22_PU:23_Core:6_Core:7_Group0:2

# Singlified output
0x00400000

# Singlified PU list
22

# PU list with physical output
33,34,35,36,37

# NUMA Node list of physical output and different separator
1foo2

# Manipulating NUMA Nodes with nodesets
0x00000006

# Nodeset output of PUs
0x00000008

# Converting NUMA Nodes from logical to physical
0,2

# Physical output of NUMA Nodes when out-of-order in the topology
2,1

# Converting physical to logical PU indexes when complexly ordered in the topology
4,20,32,48

# Caches with attributes
0x0000000b

# Groups with attributes
0x0000ff0f

# Caches without attributes
0x0000e03f

# OS devices by name
0xffffffff,0xffff0000,0x0

# OS devices by name (again)
0xffffff00,,0x0

# OS devices by range
0x000000ff,0xffff0000,0x0

# PCI devices by range
0xffffffff,0xffff0000,0x0

# PCI devices by vendors/device IDs and range wrapping around
0xffffff00,,0x00ffffff

# PCI devices by vendors/device IDs and index
0x00ffffff

# PCI devices by vendors/device IDs and range
0x000000ff,0xffffffff,0xff000000

# PCI devices added
0x000000ff,0xffff0000,0x00ffffff

# PCI devices intersection
0x0

# PCI devices intersection (again)
0x00ffffff

# Reading from stdin
0x00000001
0xf0000000,0x0000000f
0xffff0000,0x0000ffff
0x0000000f
0x00000001
0x00000001,,0x0
0xffffffff,0xffffffff

112 changes: 112 additions & 0 deletions utils/hwloc/test-hwloc-calc.sh.in
Expand Up @@ -36,75 +36,186 @@ file="$tmp/test-hwloc-calc.output"

set -e
(
echo "# root"
$calc --if synthetic --input "node:4 core:4 pu:4" root
echo
echo "# all --taskset"
$calc --if synthetic --input "node:4 core:4 pu:4" all --taskset
echo

echo "# hex"
$calc --if synthetic --input "node:4 core:4 pu:4" 0xf
echo
echo "# hex combination"
$calc --if synthetic --input "node:4 core:4 pu:4" 0xf ~0x3 0xff0 '^0xf0'
echo
echo "# object combination"
$calc --if synthetic --input "node:4 core:4 pu:4" core:0 pu:15 ~pu:0 '^pu:2'
echo

echo "# --no-smt NUMA Node range"
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt node:2-3
echo
echo "# --no-smt hex"
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt 0x1fe
echo
echo "# --no-smt=1 hex"
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=1 0x1fe
echo
echo "# --no-smt=2 hex"
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=2 0x1fe
echo
echo "# --no-smt=3 hex"
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=3 0x1fe
echo
echo "# --no-smt=4 hex"
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=4 0x1fe
echo
echo "# --no-smt=-1 hex"
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=-1 0x1fe
echo

echo "# even PUs"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:even
echo
echo "# NUMA Nodes 2+"
$calc --if synthetic --input "node:4 core:4 pu:4" node:2-
echo
echo "# cores 12+"
$calc --if synthetic --input "node:4 core:4 pu:4" core:12-
echo
echo "# PU wrapping range"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:62:10
echo
echo "# some PUs in all Cores"
$calc --if synthetic --input "node:4 core:4 pu:4" core:all.pu:1:2
echo
echo "# one PU in odd Cores"
$calc --if synthetic --input "node:4 core:4 pu:4" core:odd.pu:0
echo
echo "# combination of different ranges, hierarchical or not"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:6:2 core:3-4.pu:1-3 node:2.pu:14:2 node:3.core:3.pu:3
echo

echo "# Number of NUMA Nodes"
$calc --if synthetic --input "node:4 core:4 pu:4" root --number-of node
echo
echo "# Number of Cores in a NUMA Node"
$calc --if synthetic --input "node:4 core:4 pu:4" node:2 -N core
echo
echo "# Number of objects at depth 3 in a NUMA Node"
$calc --if synthetic --input "node:4 core:4 pu:4" node:2 -N 3
echo

echo "# List of Machine objects"
$calc --if synthetic --input "node:4 core:4 pu:4" root --intersect Machine
echo
echo "# List of NUMA Nodes in a range of Cores"
$calc --if synthetic --input "node:4 core:4 pu:4" core:4-7 -I NUMANode
echo
echo "# List of NUMA Nodes in a range of Cores (again)"
$calc --if synthetic --input "node:4 core:4 pu:4" core:10-15 -I NUMANode
echo

echo "# Hierarchical spec for a range of PUs"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:2-3 --hierarchical group.pu
echo
echo "# Hierarchical spec for a range of PUs, with different separator"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:3-6 -H group.core --sep foo
echo
echo "# Hierarchical spec for a range of PUs (again)"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:3-6 -H core.pu
echo
echo "# List of PUs from another invocation with hierarchical output"
$calc --if synthetic --input "node:4 core:4 pu:4" -I pu `$calc --if synthetic --input "node:4 core:4 pu:4" pu:3-6 -H core.pu`
echo
echo "# Hierarchical spec for a range of PUs (3 levels)"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:11:4 -H group.core.pu
echo
echo "# List of PUs from another invocation with hierarchical output (again)"
$calc --if synthetic --input "node:4 core:4 pu:4" -I pu `$calc --if synthetic --input "node:4 core:4 pu:4" pu:11:4 -H group.core.pu`
echo

echo "# --largest"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:12-37 --largest
echo
echo "# --largest, with different separator"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:22-47 --largest --sep "_"
echo

echo "# Singlified output"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:22-47 --single
echo
echo "# Singlified PU list"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:22-47 --single --pulist
echo

echo "# PU list with physical output"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:33-37 --pulist --po
echo
echo "# NUMA Node list of physical output and different separator"
$calc --if synthetic --input "node:4 core:4 pu:4" pu:30-37 --nodelist --po --sep foo
echo

echo "# Manipulating NUMA Nodes with nodesets"
$calc --if synthetic --input "node:4 core:4 pu:4" -n node:1-2
echo
echo "# Nodeset output of PUs"
$calc --if synthetic --input "node:4 core:4 pu:4" --no pu:63
echo
echo "# Converting NUMA Nodes from logical to physical"
$calc --if synthetic --input "node:4 core:4 pu:4" --ni 0x5 --nodelist --po
echo

echo "# Physical output of NUMA Nodes when out-of-order in the topology"
$calc --if synthetic --input "node:4(indexes=3,2,1,0) pu:2" node:1-2 --po -I node
echo
echo "# Converting physical to logical PU indexes when complexly ordered in the topology"
$calc --if synthetic --input "node:4 core:4 pu:4(indexes=node:core)" --pi pu:2-5 -I pu
echo

echo "# Caches with attributes"
$calc --if synthetic --input "numa:2 l3:2 pu:1" numa:0 l3u:3
echo
echo "# Groups with attributes"
$calc --if synthetic --input "group:2 numa:2 l2:2 l1d:2 pu:1" Group0:1 NUMA:0
echo
echo "# Caches without attributes"
$calc --if synthetic --input "group:2 numa:2 l2:2 l1d:2 pu:1" l2:0-2 L1cache:13:3
echo

echo "# OS devices by name"
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml os=eth6 os=eth4
echo
echo "# OS devices by name (again)"
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml os=sdc os=sr0 ~os=sda
echo
echo "# OS devices by range"
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml os:7-8
echo
echo "# PCI devices by range"
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci:10-11
echo
echo "# PCI devices by vendors/device IDs and range wrapping around"
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci'[1000:0062]':3:2
echo
echo "# PCI devices by vendors/device IDs and index"
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci'[14e4:1639]':1
echo
echo "# PCI devices by vendors/device IDs and range"
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci'[14e4:1639]':2-5
echo
echo "# PCI devices added"
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci=0000:62:00.1 pci=0000:02:00.1
echo
echo "# PCI devices intersection"
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci=0000:62:00.1 xpci=0000:02:00.0
echo
echo "# PCI devices intersection (again)"
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci=0000:02:00.0 xpci=0000:02:00.1
echo

echo "# Reading from stdin"
cat << EOF | $calc --if synthetic --input "node:4 core:4 pu:4"
pu:0
core:0 core:15
Expand All @@ -114,6 +225,7 @@ node:0 node:3
0x1,0x0,0x0
root
EOF
echo
) > "$file"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-hwloc-calc.output "$file"
rm -rf "$tmp"

0 comments on commit 9922a2a

Please sign in to comment.