Skip to content

Commit

Permalink
tests: update to synthetic/annotate now handling GB/GiB correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Feb 9, 2022
1 parent 4d9a984 commit 00a2b78
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions tests/hwloc/hwloc_synthetic.c
@@ -1,6 +1,6 @@
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2018 Inria. All rights reserved.
* Copyright © 2009-2022 Inria. All rights reserved.
* Copyright © 2009 Université Bordeaux
* Copyright © 2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
Expand Down Expand Up @@ -75,7 +75,7 @@ int main(void)

hwloc_topology_init(&topology);
err = hwloc_topology_set_type_filter(topology, HWLOC_OBJ_L1ICACHE, HWLOC_TYPE_FILTER_KEEP_ALL);
err = hwloc_topology_set_synthetic(topology, "pack:2(indexes=3,5) numa:2(memory=256GB indexes=pack) l3u:1(size=20mb) l2:2 l1i:1(size=16kB) l1dcache:2 core:1 pu:2(indexes=l2)");
err = hwloc_topology_set_synthetic(topology, "pack:2(indexes=3,5) numa:2(memory=256GiB indexes=pack) l3u:1(size=20mib) l2:2 l1i:1(size=16kiB) l1dcache:2 core:1 pu:2(indexes=l2)");
assert(!err);
hwloc_topology_load(topology);

Expand Down Expand Up @@ -155,7 +155,7 @@ int main(void)


hwloc_topology_init(&topology);
err = hwloc_topology_set_synthetic(topology, "pack:2 [numa(memory=1GB)] [numa(memory=1MB)] core:2 [numa(indexes=8,7,5,6,4,3,1,2)] pu:4");
err = hwloc_topology_set_synthetic(topology, "pack:2 [numa(memory=1GiB)] [numa(memory=1MiB)] core:2 [numa(indexes=8,7,5,6,4,3,1,2)] pu:4");
assert(!err);
hwloc_topology_load(topology);

Expand Down
2 changes: 1 addition & 1 deletion utils/hwloc/test-build-custom-topology.output
Expand Up @@ -3,7 +3,7 @@
<topology version="2.0">
<object type="Machine" os_index="0" cpuset="0x555500ff" complete_cpuset="0x555500ff" allowed_cpuset="0x555500ff" nodeset="0x0000000d" complete_nodeset="0x0000000d" allowed_nodeset="0x0000000d" gp_index="1">
<info name="Backend" value="Synthetic"/>
<info name="SyntheticDescription" value="pack:2 [numa(memory=100GB)] [numa(memory=10GB)] core:8 pu:2"/>
<info name="SyntheticDescription" value="pack:2 [numa(memory=100GiB)] [numa(memory=10GiB)] core:8 pu:2"/>
<object type="Package" os_index="0" cpuset="0x000000ff" complete_cpuset="0x000000ff" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="26">
<object type="NUMANode" os_index="0" cpuset="0x000000ff" complete_cpuset="0x000000ff" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="27" subtype="DRAM" local_memory="214748364800">
<page_type size="4096" count="26214400"/>
Expand Down
6 changes: 3 additions & 3 deletions utils/hwloc/test-build-custom-topology.sh.in
Expand Up @@ -2,7 +2,7 @@
#-*-sh-*-

#
# Copyright © 2009-2021 Inria. All rights reserved.
# Copyright © 2009-2022 Inria. All rights reserved.
# See COPYING in top-level directory.
#

Expand Down Expand Up @@ -45,7 +45,7 @@ filetmp="$tmp/custom-topology.tmp.xml"
set -e

echo "creating symmetric topology ..."
$lstopo -i "pack:2 [numa(memory=100GB)] [numa(memory=10GB)] core:8 pu:2" --of xml $file
$lstopo -i "pack:2 [numa(memory=100GiB)] [numa(memory=10GiB)] core:8 pu:2" --of xml $file

echo "listing PUs to keep ..."
cpuset=`$calc -i $file pack:0.core:0-3.pu:0-1 pack:1.core:0-7.pu:0`
Expand All @@ -70,7 +70,7 @@ $annotate $file $file -- pack:1.numa:1 -- subtype HBM
$annotate $file $file -- pack:0.numa:0 pack:1.numa:0 -- subtype DRAM

echo "making the first DRAM bigger ..."
$annotate $file $file -- pack:0.numa:0 -- size 200GB
$annotate $file $file -- pack:0.numa:0 -- size 200GiB

echo "adding bandwidth for memory nodes ..."
$annotate $file $file -- pack:0.node:0 -- memattr Bandwidth pack:0 50000
Expand Down

0 comments on commit 00a2b78

Please sign in to comment.