Skip to content

Commit 9922a2a

Browse files
committed
utils: add some comments in some test outputs
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 <[email protected]>
1 parent 459b6ec commit 9922a2a

File tree

6 files changed

+273
-2
lines changed

6 files changed

+273
-2
lines changed

utils/hwloc/test-hwloc-calc.output

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,174 @@
1+
# root
12
0xffffffff,0xffffffff
3+
4+
# all --taskset
25
0xffffffffffffffff
36

7+
# hex
48
0x0000000f
9+
10+
# hex combination
511
0x00000f0c
12+
13+
# object combination
614
0x0000800a
715

16+
# --no-smt NUMA Node range
817
0x11111111,0x0
18+
19+
# --no-smt hex
920
0x00000112
21+
22+
# --no-smt=1 hex
1023
0x00000024
24+
25+
# --no-smt=2 hex
1126
0x00000048
27+
28+
# --no-smt=3 hex
1229
0x00000080
30+
31+
# --no-smt=4 hex
1332
0x0
33+
34+
# --no-smt=-1 hex
1435
0x000001fe
1536

37+
# even PUs
1638
0x55555555,0x55555555
39+
40+
# NUMA Nodes 2+
1741
0xffffffff,0x0
42+
43+
# cores 12+
1844
0xffff0000,0x0
45+
46+
# PU wrapping range
1947
0xc0000000,0x000000ff
48+
49+
# some PUs in all Cores
2050
0x66666666,0x66666666
51+
52+
# one PU in odd Cores
2153
0x10101010,0x10101010
54+
55+
# combination of different ranges, hierarchical or not
2256
0x8000c000,0x000ee0c0
2357

58+
# Number of NUMA Nodes
2459
4
60+
61+
# Number of Cores in a NUMA Node
2562
4
63+
64+
# Number of objects at depth 3 in a NUMA Node
2665
16
2766

67+
# List of Machine objects
2868
0
69+
70+
# List of NUMA Nodes in a range of Cores
2971
1
72+
73+
# List of NUMA Nodes in a range of Cores (again)
3074
2,3
3175

76+
# Hierarchical spec for a range of PUs
3277
Group0:0.PU:2 Group0:0.PU:3
78+
79+
# Hierarchical spec for a range of PUs, with different separator
3380
Group0:0.Core:0fooGroup0:0.Core:1
81+
82+
# Hierarchical spec for a range of PUs (again)
3483
Core:0.PU:3 Core:1.PU:0 Core:1.PU:1 Core:1.PU:2
84+
85+
# List of PUs from another invocation with hierarchical output
3586
3,4,5,6
87+
88+
# Hierarchical spec for a range of PUs (3 levels)
3689
Group0:0.Core:2.PU:3 Group0:0.Core:3.PU:0 Group0:0.Core:3.PU:1 Group0:0.Core:3.PU:2
90+
91+
# List of PUs from another invocation with hierarchical output (again)
3792
11,12,13,14
3893

94+
# --largest
3995
Core:3 Group0:1 Core:8 PU:36 PU:37
96+
97+
# --largest, with different separator
4098
PU:22_PU:23_Core:6_Core:7_Group0:2
4199

100+
# Singlified output
42101
0x00400000
102+
103+
# Singlified PU list
43104
22
44105

106+
# PU list with physical output
45107
33,34,35,36,37
108+
109+
# NUMA Node list of physical output and different separator
46110
1foo2
47111

112+
# Manipulating NUMA Nodes with nodesets
48113
0x00000006
114+
115+
# Nodeset output of PUs
49116
0x00000008
117+
118+
# Converting NUMA Nodes from logical to physical
50119
0,2
51120

121+
# Physical output of NUMA Nodes when out-of-order in the topology
52122
2,1
123+
124+
# Converting physical to logical PU indexes when complexly ordered in the topology
53125
4,20,32,48
54126

127+
# Caches with attributes
55128
0x0000000b
129+
130+
# Groups with attributes
56131
0x0000ff0f
132+
133+
# Caches without attributes
57134
0x0000e03f
58135

136+
# OS devices by name
59137
0xffffffff,0xffff0000,0x0
138+
139+
# OS devices by name (again)
60140
0xffffff00,,0x0
141+
142+
# OS devices by range
61143
0x000000ff,0xffff0000,0x0
144+
145+
# PCI devices by range
62146
0xffffffff,0xffff0000,0x0
147+
148+
# PCI devices by vendors/device IDs and range wrapping around
63149
0xffffff00,,0x00ffffff
150+
151+
# PCI devices by vendors/device IDs and index
64152
0x00ffffff
153+
154+
# PCI devices by vendors/device IDs and range
65155
0x000000ff,0xffffffff,0xff000000
156+
157+
# PCI devices added
66158
0x000000ff,0xffff0000,0x00ffffff
159+
160+
# PCI devices intersection
67161
0x0
162+
163+
# PCI devices intersection (again)
68164
0x00ffffff
69165

166+
# Reading from stdin
70167
0x00000001
71168
0xf0000000,0x0000000f
72169
0xffff0000,0x0000ffff
73170
0x0000000f
74171
0x00000001
75172
0x00000001,,0x0
76173
0xffffffff,0xffffffff
174+

utils/hwloc/test-hwloc-calc.sh.in

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,75 +36,186 @@ file="$tmp/test-hwloc-calc.output"
3636

3737
set -e
3838
(
39+
echo "# root"
3940
$calc --if synthetic --input "node:4 core:4 pu:4" root
41+
echo
42+
echo "# all --taskset"
4043
$calc --if synthetic --input "node:4 core:4 pu:4" all --taskset
4144
echo
45+
46+
echo "# hex"
4247
$calc --if synthetic --input "node:4 core:4 pu:4" 0xf
48+
echo
49+
echo "# hex combination"
4350
$calc --if synthetic --input "node:4 core:4 pu:4" 0xf ~0x3 0xff0 '^0xf0'
51+
echo
52+
echo "# object combination"
4453
$calc --if synthetic --input "node:4 core:4 pu:4" core:0 pu:15 ~pu:0 '^pu:2'
4554
echo
55+
56+
echo "# --no-smt NUMA Node range"
4657
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt node:2-3
58+
echo
59+
echo "# --no-smt hex"
4760
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt 0x1fe
61+
echo
62+
echo "# --no-smt=1 hex"
4863
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=1 0x1fe
64+
echo
65+
echo "# --no-smt=2 hex"
4966
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=2 0x1fe
67+
echo
68+
echo "# --no-smt=3 hex"
5069
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=3 0x1fe
70+
echo
71+
echo "# --no-smt=4 hex"
5172
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=4 0x1fe
73+
echo
74+
echo "# --no-smt=-1 hex"
5275
$calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=-1 0x1fe
5376
echo
77+
78+
echo "# even PUs"
5479
$calc --if synthetic --input "node:4 core:4 pu:4" pu:even
80+
echo
81+
echo "# NUMA Nodes 2+"
5582
$calc --if synthetic --input "node:4 core:4 pu:4" node:2-
83+
echo
84+
echo "# cores 12+"
5685
$calc --if synthetic --input "node:4 core:4 pu:4" core:12-
86+
echo
87+
echo "# PU wrapping range"
5788
$calc --if synthetic --input "node:4 core:4 pu:4" pu:62:10
89+
echo
90+
echo "# some PUs in all Cores"
5891
$calc --if synthetic --input "node:4 core:4 pu:4" core:all.pu:1:2
92+
echo
93+
echo "# one PU in odd Cores"
5994
$calc --if synthetic --input "node:4 core:4 pu:4" core:odd.pu:0
95+
echo
96+
echo "# combination of different ranges, hierarchical or not"
6097
$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
6198
echo
99+
100+
echo "# Number of NUMA Nodes"
62101
$calc --if synthetic --input "node:4 core:4 pu:4" root --number-of node
102+
echo
103+
echo "# Number of Cores in a NUMA Node"
63104
$calc --if synthetic --input "node:4 core:4 pu:4" node:2 -N core
105+
echo
106+
echo "# Number of objects at depth 3 in a NUMA Node"
64107
$calc --if synthetic --input "node:4 core:4 pu:4" node:2 -N 3
65108
echo
109+
110+
echo "# List of Machine objects"
66111
$calc --if synthetic --input "node:4 core:4 pu:4" root --intersect Machine
112+
echo
113+
echo "# List of NUMA Nodes in a range of Cores"
67114
$calc --if synthetic --input "node:4 core:4 pu:4" core:4-7 -I NUMANode
115+
echo
116+
echo "# List of NUMA Nodes in a range of Cores (again)"
68117
$calc --if synthetic --input "node:4 core:4 pu:4" core:10-15 -I NUMANode
69118
echo
119+
120+
echo "# Hierarchical spec for a range of PUs"
70121
$calc --if synthetic --input "node:4 core:4 pu:4" pu:2-3 --hierarchical group.pu
122+
echo
123+
echo "# Hierarchical spec for a range of PUs, with different separator"
71124
$calc --if synthetic --input "node:4 core:4 pu:4" pu:3-6 -H group.core --sep foo
125+
echo
126+
echo "# Hierarchical spec for a range of PUs (again)"
72127
$calc --if synthetic --input "node:4 core:4 pu:4" pu:3-6 -H core.pu
128+
echo
129+
echo "# List of PUs from another invocation with hierarchical output"
73130
$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`
131+
echo
132+
echo "# Hierarchical spec for a range of PUs (3 levels)"
74133
$calc --if synthetic --input "node:4 core:4 pu:4" pu:11:4 -H group.core.pu
134+
echo
135+
echo "# List of PUs from another invocation with hierarchical output (again)"
75136
$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`
76137
echo
138+
139+
echo "# --largest"
77140
$calc --if synthetic --input "node:4 core:4 pu:4" pu:12-37 --largest
141+
echo
142+
echo "# --largest, with different separator"
78143
$calc --if synthetic --input "node:4 core:4 pu:4" pu:22-47 --largest --sep "_"
79144
echo
145+
146+
echo "# Singlified output"
80147
$calc --if synthetic --input "node:4 core:4 pu:4" pu:22-47 --single
148+
echo
149+
echo "# Singlified PU list"
81150
$calc --if synthetic --input "node:4 core:4 pu:4" pu:22-47 --single --pulist
82151
echo
152+
153+
echo "# PU list with physical output"
83154
$calc --if synthetic --input "node:4 core:4 pu:4" pu:33-37 --pulist --po
155+
echo
156+
echo "# NUMA Node list of physical output and different separator"
84157
$calc --if synthetic --input "node:4 core:4 pu:4" pu:30-37 --nodelist --po --sep foo
85158
echo
159+
160+
echo "# Manipulating NUMA Nodes with nodesets"
86161
$calc --if synthetic --input "node:4 core:4 pu:4" -n node:1-2
162+
echo
163+
echo "# Nodeset output of PUs"
87164
$calc --if synthetic --input "node:4 core:4 pu:4" --no pu:63
165+
echo
166+
echo "# Converting NUMA Nodes from logical to physical"
88167
$calc --if synthetic --input "node:4 core:4 pu:4" --ni 0x5 --nodelist --po
89168
echo
169+
170+
echo "# Physical output of NUMA Nodes when out-of-order in the topology"
90171
$calc --if synthetic --input "node:4(indexes=3,2,1,0) pu:2" node:1-2 --po -I node
172+
echo
173+
echo "# Converting physical to logical PU indexes when complexly ordered in the topology"
91174
$calc --if synthetic --input "node:4 core:4 pu:4(indexes=node:core)" --pi pu:2-5 -I pu
92175
echo
176+
177+
echo "# Caches with attributes"
93178
$calc --if synthetic --input "numa:2 l3:2 pu:1" numa:0 l3u:3
179+
echo
180+
echo "# Groups with attributes"
94181
$calc --if synthetic --input "group:2 numa:2 l2:2 l1d:2 pu:1" Group0:1 NUMA:0
182+
echo
183+
echo "# Caches without attributes"
95184
$calc --if synthetic --input "group:2 numa:2 l2:2 l1d:2 pu:1" l2:0-2 L1cache:13:3
96185
echo
186+
187+
echo "# OS devices by name"
97188
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml os=eth6 os=eth4
189+
echo
190+
echo "# OS devices by name (again)"
98191
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml os=sdc os=sr0 ~os=sda
192+
echo
193+
echo "# OS devices by range"
99194
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml os:7-8
195+
echo
196+
echo "# PCI devices by range"
100197
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci:10-11
198+
echo
199+
echo "# PCI devices by vendors/device IDs and range wrapping around"
101200
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci'[1000:0062]':3:2
201+
echo
202+
echo "# PCI devices by vendors/device IDs and index"
102203
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci'[14e4:1639]':1
204+
echo
205+
echo "# PCI devices by vendors/device IDs and range"
103206
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci'[14e4:1639]':2-5
207+
echo
208+
echo "# PCI devices added"
104209
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci=0000:62:00.1 pci=0000:02:00.1
210+
echo
211+
echo "# PCI devices intersection"
105212
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci=0000:62:00.1 xpci=0000:02:00.0
213+
echo
214+
echo "# PCI devices intersection (again)"
106215
$calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci=0000:02:00.0 xpci=0000:02:00.1
107216
echo
217+
218+
echo "# Reading from stdin"
108219
cat << EOF | $calc --if synthetic --input "node:4 core:4 pu:4"
109220
pu:0
110221
core:0 core:15
@@ -114,6 +225,7 @@ node:0 node:3
114225
0x1,0x0,0x0
115226
root
116227
EOF
228+
echo
117229
) > "$file"
118230
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-hwloc-calc.output "$file"
119231
rm -rf "$tmp"

0 commit comments

Comments
 (0)