File: test-hwloc-distrib.sh.in

package info (click to toggle)
hwloc-contrib 2.4.1%2Bdfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye
  • size: 21,976 kB
  • sloc: ansic: 58,129; xml: 12,064; sh: 6,822; makefile: 2,200; javascript: 1,623; perl: 380; cpp: 93; php: 8; sed: 4
file content (91 lines) | stat: -rw-r--r-- 2,457 bytes parent folder | download | duplicates (12)
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
#!/bin/sh
#-*-sh-*-

#
# Copyright © 2009 CNRS
# Copyright © 2009-2020 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
(
  echo "# 2 sets out of 2 2 2"
  $distrib --if synthetic --input "2 2 2" 2
  echo
  echo "# 4 sets out of 2 2 2"
  $distrib --if synthetic --input "2 2 2" 4
  echo
  echo "# 8 sets out of 2 2 2"
  $distrib --if synthetic --input "2 2 2" 8
  echo
  echo "# 13 sets out of 2 2 2"
  $distrib --if synthetic --input "2 2 2" 13
  echo
  echo "# 16 sets out of 2 2 2"
  $distrib --if synthetic --input "2 2 2" 16
  echo

  echo "# 4 sets out of 3 3 3"
  $distrib --if synthetic --input "3 3 3" 4
  echo
  echo "# 4 singlified sets out of 3 3 3"
  $distrib --if synthetic --input "3 3 3" 4 --single
  echo
  echo "# 4 sets out of 3 3 3, reversed"
  $distrib --if synthetic --input "3 3 3" 4 --reverse
  echo
  echo "# 4 singlified sets out of 3 3 3, reversed"
  $distrib --if synthetic --input "3 3 3" 4 --reverse --single
  echo

  echo "# 2 sets out of 4 4"
  $distrib --if synthetic --input "4 4" 2
  echo
  echo "# 2 singlified sets out of 4 4"
  $distrib --if synthetic --input "4 4" 2 --single
  echo
  echo "# 2 singlified sets out of 4 4, reversed"
  $distrib --if synthetic --input "4 4" 2 --reverse --single
  echo
  echo "# 19 sets out of 4 4"
  $distrib --if synthetic --input "4 4 4 4" 19
  echo

  echo "# 9 sets out of 2 2 2 2"
  $distrib --if synthetic --input "2 2 2 2" 9
  echo
  echo "# 9 sets out of 2 2 2 2, starting at PU level"
  $distrib --if synthetic --input "2 2 2 2" --from pu 9
  echo
  echo "# 9 sets out of 2 2 2 2, stopping at Core level"
  $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"