Skip to content

Commit 129a2ad

Browse files
authored
Merge pull request #415 from lukaszstolarczuk/dd_bind_modes_tests
Add bind modes tests and run on multi-numa machine
2 parents a0881ba + 9c4ddf7 commit 129a2ad

File tree

8 files changed

+460
-29
lines changed

8 files changed

+460
-29
lines changed

.github/scripts/get_system_info.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ function system_info {
3030
# source /opt/intel/oneapi/setvars.sh
3131
# sycl-ls
3232

33+
echo "**********numactl topology**********"
34+
numactl -H
35+
3336
echo "**********VGA info**********"
3437
lspci | grep -i VGA
3538

.github/workflows/multi_numa.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Runs tests on multi-numa machine
2+
name: MultiNuma
3+
4+
on: [workflow_call]
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
multi_numa:
11+
name: ${{matrix.os}}
12+
# run only on upstream; forks will not have the HW
13+
if: github.repository == 'oneapi-src/unified-memory-framework'
14+
15+
strategy:
16+
matrix:
17+
os: [ubuntu-22.04]
18+
runs-on: ["DSS-MULTI-NUMA", "DSS-${{matrix.os}}"]
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23+
24+
- name: Get information about platform
25+
run: .github/scripts/get_system_info.sh
26+
27+
- name: Configure build
28+
run: >
29+
cmake
30+
-B ${{github.workspace}}/build
31+
-DCMAKE_BUILD_TYPE=Debug
32+
-DCMAKE_C_COMPILER=gcc
33+
-DCMAKE_CXX_COMPILER=g++
34+
-DUMF_BUILD_SHARED_LIBRARY=OFF
35+
-DUMF_BUILD_BENCHMARKS=OFF
36+
-DUMF_BUILD_TESTS=ON
37+
-DUMF_DEVELOPER_MODE=ON
38+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
39+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
40+
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
41+
-DUMF_ENABLE_POOL_TRACKING=ON
42+
43+
- name: Build UMF
44+
run: cmake --build ${{github.workspace}}/build -j $(nproc)
45+
46+
- name: Run tests
47+
working-directory: ${{github.workspace}}/build
48+
run: ctest --output-on-failure --test-dir test

.github/workflows/pr_push.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,6 @@ jobs:
167167
Valgrind:
168168
needs: [Build]
169169
uses: ./.github/workflows/valgrind.yml
170+
MultiNuma:
171+
needs: [Build]
172+
uses: ./.github/workflows/multi_numa.yml

.github/workflows/qemu.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,4 @@ jobs:
123123
fi
124124
125125
scp -P 2222 ${{github.workspace}}/scripts/qemu/run-build.sh [email protected]:/home/cxltest
126-
scp -P 2222 ${{github.workspace}}/.github/scripts/install_hwloc.sh [email protected]:/home/cxltest
127126
ssh [email protected] -p 2222 -t "bash /home/cxltest/run-build.sh https://github.com/$CI_REPO ${{env.CI_BRANCH}}"

scripts/qemu/run-build.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ repo=$1
1010
branch=$2
1111

1212
echo password | sudo -Sk apt update
13-
echo password | sudo -Sk apt install -y git cmake gcc g++ numactl libnuma-dev libjemalloc-dev libtbb-dev
14-
15-
# install packages required for building hwloc from source
16-
echo password | sudo -Sk apt install -y autoconf libtool
17-
source install_hwloc.sh
13+
echo password | sudo -Sk apt install -y git cmake gcc g++ numactl libnuma-dev libhwloc-dev libjemalloc-dev libtbb-dev pkg-config
1814

1915
numactl -H
2016

src/provider/provider_os_memory.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,11 @@ static umf_result_t translate_params(umf_os_memory_provider_params_t *in_params,
196196
result = translate_numa_mode(in_params->numa_mode, emptyNodeset,
197197
&provider->numa_policy);
198198
if (result != UMF_RESULT_SUCCESS) {
199-
LOG_ERR("incorrect NUMA mode: %u", in_params->numa_mode);
199+
LOG_ERR("incorrect NUMA mode (%u) or wrong params",
200+
in_params->numa_mode);
200201
return result;
201202
}
203+
LOG_INFO("established HWLOC NUMA policy: %u", provider->numa_policy);
202204

203205
provider->numa_flags = getHwlocMembindFlags(in_params->numa_mode);
204206

@@ -247,13 +249,15 @@ static umf_result_t os_initialize(void *params, void **provider) {
247249

248250
os_provider->nodeset_str_buf = umf_ba_global_alloc(NODESET_STR_BUF_LEN);
249251
if (!os_provider->nodeset_str_buf) {
250-
LOG_INFO("Allocating memory for printing NUMA nodes failed");
252+
LOG_INFO("allocating memory for printing NUMA nodes failed");
251253
} else {
252254
if (hwloc_bitmap_list_snprintf(os_provider->nodeset_str_buf,
253255
NODESET_STR_BUF_LEN,
254256
os_provider->nodeset)) {
255257
LOG_INFO("OS provider initialized with NUMA nodes: %s",
256258
os_provider->nodeset_str_buf);
259+
} else if (hwloc_bitmap_iszero(os_provider->nodeset)) {
260+
LOG_INFO("OS provider initialized with empty NUMA nodeset");
257261
}
258262
}
259263

test/common/numa_helpers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ int getNumaNodeByPtr(void *ptr) {
2222
int retm =
2323
get_mempolicy(&nodeId, nullptr, 0, ptr, MPOL_F_ADDR | MPOL_F_NODE);
2424
UT_ASSERTeq(retm, 0);
25+
UT_ASSERT(nodeId >= 0);
26+
2527
return nodeId;
2628
}
2729

0 commit comments

Comments
 (0)