-
Notifications
You must be signed in to change notification settings - Fork 168
/
test-hwloc-info.sh.in
144 lines (130 loc) · 5.32 KB
/
test-hwloc-info.sh.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/sh
#-*-sh-*-
#
# Copyright © 2009 CNRS
# Copyright © 2009-2023 Inria. All rights reserved.
# Copyright © 2009 Université Bordeaux
# Copyright © 2014 Cisco Systems, Inc. All rights reserved.
# See COPYING in top-level directory.
#
HWLOC_top_srcdir="@HWLOC_top_srcdir@"
HWLOC_top_builddir="@HWLOC_top_builddir@"
srcdir="$HWLOC_top_srcdir/utils/hwloc"
builddir="$HWLOC_top_builddir/utils/hwloc"
info="$builddir/hwloc-info"
linuxdir="$HWLOC_top_srcdir/tests/hwloc/linux"
xmldir="$HWLOC_top_srcdir/tests/hwloc/xml"
HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc/.libs
export HWLOC_PLUGINS_PATH
HWLOC_DEBUG_CHECK=1
export HWLOC_DEBUG_CHECK
HWLOC_DONT_ADD_VERSION_INFO=1
export HWLOC_DONT_ADD_VERSION_INFO
: ${TMPDIR=/tmp}
{
tmp=`
(umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
` &&
test -n "$tmp" && test -d "$tmp"
} || {
tmp=$TMPDIR/foo$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || exit $?
file="$tmp/test-hwloc-info.output"
set -e
(
echo "# (default)"
$info --if synthetic --input "node:2 core:3 pu:4"
echo
echo "# --topology --verbose"
$info --if synthetic --input "node:2 core:3 pu:4" --topology --verbose | grep -v hwlocVersion | grep -v ProcessName
echo
echo "# --support"
$info --if synthetic --input "node:2 core:3 pu:4" --support
echo
echo "# --objects"
$info --if synthetic --input "node:2 core:3 pu:4" --objects
echo
echo "# Core range"
$info --if synthetic --input "node:2 core:3 pu:4" core:2-4
echo
echo "# all ancestors of PU range"
$info --if synthetic --input "node:2 core:3 pu:4" -n --ancestors pu:10-11
echo
echo "# Core ancestors of PU range"
$info --if synthetic --input "node:2 core:3 pu:4" --ancestor core pu:7-9
echo
echo "# L2 ancestor of PU"
$info --if synthetic --input "node:2 core:2 l2:2 l1d:2 pu:2" --ancestor l2 pu:12
echo
echo "# L1 ancestor of PU range"
$info --if synthetic --input "node:2 core:2 l2:2 l1d:2 pu:2" --ancestor l1 -s pu:7-10
echo
echo "# Ancestor caches above L1d"
$info --if synthetic --input "node:2 l4:2 l3:2 core:2 l2:2 l1d:2 pu:2" --ancestor kind=cache -n -s l1d:4 l1d:8
echo
echo "# Descendant CPU objects below L4"
$info --if synthetic --input "node:2 l4:2 l3:2 core:2 l2:1 pu:2" --descendants kind=cpu -n -s l4:0 l4:3
echo
echo "# Descendant Memory objects below L3"
$info --if synthetic --input "pack:4 [numa] l3:2 [numa] [numa] core:4 pu:2" --descendants kind=memory -n -s l3:1 l3:7
echo
echo "# Where a NUMA is attached"
$info --if synthetic --input "pack:4 [numa] l3:2 [numa] [numa] core:4 pu:2" --ancestor kind=normal --first -s numa:3 numa:14
echo
echo "# Children of L2 and Core of Node, silent"
$info --if synthetic --input "node:2 core:2 l2:2 l1d:2 pu:2" --children -s l2:1 node:1.core:1
echo
echo "# L1d descendants of Core range, silent"
$info --if synthetic --input "node:2 core:2 l2:2 l1d:2 pu:2" --descendants l1d -s core:1-2
echo
echo "# 2 local memory for one PU"
$info --if synthetic --input "pack:4 [numa] l3:2 [numa] core:4 pu:2" --local-memory pu:8
echo
echo "# 2 local-or-larger memories for one PU, silent"
$info --if synthetic --input "pack:4 [numa] l3:2 [numa] core:4 pu:2" --local-memory-flags larger -s pu:8
echo
echo "# no local-or-larger memory for root, silent"
$info --if synthetic --input "pack:4 [numa] l3:2 [numa] core:4 pu:2" --local-memory-flags larger -s root
echo
echo "# no local-or-smaller memory for one PU, silent"
$info --if synthetic --input "pack:4 [numa] l3:2 [numa] core:4 pu:2" --local-memory-flags smaller -s pu:8
echo
echo "# 3 local-or-smaller memories for on Package, silent"
$info --if synthetic --input "pack:4 [numa] l3:2 [numa] core:4 pu:2" --local-memory-flags smaller -s pack:1
echo
echo "# no strict-local memory for one PU, silent"
$info --if synthetic --input "pack:4 [numa] l3:2 [numa] core:4 pu:2" --local-memory-flags none -s pu:8
echo
echo "# 1 strict-local memory for one NUMANode, silent"
$info --if synthetic --input "pack:4 [numa] l3:2 [numa] core:4 pu:2" --local-memory-flags none -s node:1
echo
echo "# 12 local-all memories for one PU, silent"
$info --if synthetic --input "pack:4 [numa] l3:2 [numa] core:4 pu:2" --local-memory-flags all\$ -s pu:3
echo
echo "# only the smallest locality among 2 local-or-larger memories for one PU, silent"
$info --if synthetic --input "pack:4 [numa] l3:2 [numa] core:4 pu:2" --local-memory-flags larger --best-memattr locality -s pu:63
echo
echo "# only the highest capacity among 2 local-or-larger memories for one PU, silent"
$info --if synthetic --input "pack:4 [numa(memory=1000000)] l3:2 [numa(memory=1000)] core:4 pu:2" --local-memory-flags larger --best-memattr capacity -s pu:63
echo
echo
echo "# MCDRAM subtype NUMA filter"
$info --if xml --input $xmldir/64intel64-fakeKNL-SNC4-hybrid.xml -s 'numa[mcdram]:1-2'
echo
echo "# NVML subtype OSdev type filter"
$info --if xml --input $xmldir/power8gpudistances.xml -s 'os[nvml]:all'
echo
echo "# GPU OSdev type filter"
$info --if xml --input $xmldir/power8gpudistances.xml -s 'os[gpu]:3-5'
echo
echo
echo "# cpukinds for the entire machine"
$info --if xml --input $linuxdir/fakeheterocpunuma.xml all
echo
echo "# cpukind for a single PU"
$info --if xml --input $linuxdir/fakeheterocpunuma.xml pu:15
echo
) > "$file"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-hwloc-info.output "$file"
rm -rf "$tmp"