/
test-hwloc-distrib.sh.in
73 lines (66 loc) · 1.79 KB
/
test-hwloc-distrib.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
#!/bin/sh
#-*-sh-*-
#
# Copyright © 2009 CNRS
# Copyright © 2009-2018 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"
distrib="$builddir/hwloc-distrib"
HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc/.libs
export HWLOC_PLUGINS_PATH
HWLOC_DEBUG_CHECK=1
export HWLOC_DEBUG_CHECK
: ${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-distrib.output"
set -e
(
$distrib --if synthetic --input "2 2 2" 2
echo
$distrib --if synthetic --input "2 2 2" 4
echo
$distrib --if synthetic --input "2 2 2" 8
echo
$distrib --if synthetic --input "2 2 2" 13
echo
$distrib --if synthetic --input "2 2 2" 16
echo
$distrib --if synthetic --input "3 3 3" 4
echo
$distrib --if synthetic --input "3 3 3" 4 --single
echo
$distrib --if synthetic --input "3 3 3" 4 --reverse
echo
$distrib --if synthetic --input "3 3 3" 4 --reverse --single
echo
$distrib --if synthetic --input "4 4" 2
echo
$distrib --if synthetic --input "4 4" 2 --single
echo
$distrib --if synthetic --input "4 4" 2 --reverse --single
echo
$distrib --if synthetic --input "4 4 4 4" 19
echo
$distrib --if synthetic --input "2 2 2 2" 9
echo
$distrib --if synthetic --input "2 2 2 2" --from pu 9
echo
$distrib --if synthetic --input "2 2 2 2" --to core 9
echo
) > "$file"
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-hwloc-distrib.output "$file"
rm -rf "$tmp"