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

Packit Service c5cf8c
#!/bin/sh
Packit Service c5cf8c
#-*-sh-*-
Packit Service c5cf8c
Packit Service c5cf8c
#
Packit Service c5cf8c
# Copyright © 2009 CNRS
Packit Service c5cf8c
# Copyright © 2009-2017 Inria.  All rights reserved.
Packit Service c5cf8c
# Copyright © 2009, 2011 Université Bordeaux
Packit Service c5cf8c
# Copyright © 2014 Cisco Systems, Inc.  All rights reserved.
Packit Service c5cf8c
# See COPYING in top-level directory.
Packit Service c5cf8c
#
Packit Service c5cf8c
Packit Service c5cf8c
HWLOC_top_srcdir="@HWLOC_top_srcdir@"
Packit Service c5cf8c
HWLOC_top_builddir="@HWLOC_top_builddir@"
Packit Service c5cf8c
srcdir="$HWLOC_top_srcdir/utils/hwloc"
Packit Service c5cf8c
builddir="$HWLOC_top_builddir/utils/hwloc"
Packit Service c5cf8c
calc="$builddir/hwloc-calc"
Packit Service c5cf8c
xmldir="$HWLOC_top_srcdir/tests/hwloc/xml"
Packit Service c5cf8c
Packit Service c5cf8c
HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc
Packit Service c5cf8c
export HWLOC_PLUGINS_PATH
Packit Service c5cf8c
Packit Service c5cf8c
HWLOC_DEBUG_CHECK=1
Packit Service c5cf8c
export HWLOC_DEBUG_CHECK
Packit Service c5cf8c
Packit Service c5cf8c
: ${TMPDIR=/tmp}
Packit Service c5cf8c
{
Packit Service c5cf8c
  tmp=`
Packit Service c5cf8c
    (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
Packit Service c5cf8c
  ` &&
Packit Service c5cf8c
  test -n "$tmp" && test -d "$tmp"
Packit Service c5cf8c
} || {
Packit Service c5cf8c
  tmp=$TMPDIR/foo$$-$RANDOM
Packit Service c5cf8c
  (umask 077 && mkdir "$tmp")
Packit Service c5cf8c
} || exit $?
Packit Service c5cf8c
file="$tmp/test-hwloc-calc.output"
Packit Service c5cf8c
Packit Service c5cf8c
set -e
Packit Service c5cf8c
(
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" root
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" all --taskset
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" 0xf
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" 0xf ~0x3 0xff0 '^0xf0'
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" core:0 pu:15 ~pu:0 '^pu:2'
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:even
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" node:2-
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" core:12-
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:62:10
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" core:all.pu:1:2
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" core:odd.pu:0
Packit Service c5cf8c
  $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
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" root --number-of node
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" node:2 -N core
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" node:2 -N 3
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" root --intersect Machine
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" core:4-7 -I NUMANode
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" core:10-15 -I NUMANode
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:2-3 --hierarchical node.pu
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:3-6 -H node.core --sep foo
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:3-6 -H core.pu
Packit Service c5cf8c
  $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`
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:11:4 -H node.core.pu
Packit Service c5cf8c
  $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 node.core.pu`
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:12-37 --largest
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:22-47 --largest --sep "_"
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:22-47 --single
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:22-47 --single --pulist
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:33-37 --pulist --po
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4" pu:30-37 --nodelist --po --sep foo
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  $calc --if synthetic --input "node:4(indexes=3,2,1,0) pu:2" node:1-2 --po -I node
Packit Service c5cf8c
  $calc --if synthetic --input "node:4 core:4 pu:4(indexes=node:core)" --pi pu:2-5 -I pu
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  $calc --if synthetic --input "numa:2 l3:2 pu:1" numa:0 l3u:3
Packit Service c5cf8c
  $calc --if synthetic --input "group:2 numa:2 l2:2 l1d:2 pu:1" Group0:1 NUMA:0
Packit Service c5cf8c
  $calc --if synthetic --input "group:2 numa:2 l2:2 l1d:2 pu:1" l2:0-2 L1cache:13:3
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  $calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml os=eth6 os=eth4
Packit Service c5cf8c
  $calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml os=sdc os=sr0 ~os=sda
Packit Service c5cf8c
  $calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml os:7-8
Packit Service c5cf8c
  $calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci:10-11
Packit Service c5cf8c
  $calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci'[1000:0062]':3:2
Packit Service c5cf8c
  $calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci'[14e4:1639]':1
Packit Service c5cf8c
  $calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci'[14e4:1639]':2-5
Packit Service c5cf8c
  $calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci=0000:62:00.1 pci=0000:02:00.1
Packit Service c5cf8c
  $calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci=0000:62:00.1 xpci=0000:02:00.0
Packit Service c5cf8c
  $calc --if xml --input $xmldir/96em64t-4n4d3ca2co-pci.xml pci=0000:02:00.0 xpci=0000:02:00.1
Packit Service c5cf8c
  echo
Packit Service c5cf8c
  cat << EOF | $calc --if synthetic --input "node:4 core:4 pu:4"
Packit Service c5cf8c
pu:0
Packit Service c5cf8c
core:0 core:15
Packit Service c5cf8c
node:0 node:3
Packit Service c5cf8c
0x0001 0x00002 0x000004 0x000000000008
Packit Service c5cf8c
0x0000000000000000000000000000000000000000000000000000000000000000000000000000001
Packit Service c5cf8c
0x1,0x0,0x0
Packit Service c5cf8c
root
Packit Service c5cf8c
EOF
Packit Service c5cf8c
) > "$file"
Packit Service c5cf8c
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-hwloc-calc.output "$file"
Packit Service c5cf8c
rm -rf "$tmp"