Skip to content

Add bind modes tests and run on multi-numa machine #415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/scripts/get_system_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ function system_info {
# source /opt/intel/oneapi/setvars.sh
# sycl-ls

echo "**********numactl topology**********"
numactl -H

echo "**********VGA info**********"
lspci | grep -i VGA

Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/multi_numa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Runs tests on multi-numa machine
name: MultiNuma

on: [workflow_call]

permissions:
contents: read

jobs:
multi_numa:
name: ${{matrix.os}}
# run only on upstream; forks will not have the HW
if: github.repository == 'oneapi-src/unified-memory-framework'

strategy:
matrix:
os: [ubuntu-22.04]
runs-on: ["DSS-MULTI-NUMA", "DSS-${{matrix.os}}"]

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Get information about platform
run: .github/scripts/get_system_info.sh

- name: Configure build
run: >
cmake
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++
-DUMF_BUILD_SHARED_LIBRARY=OFF
-DUMF_BUILD_BENCHMARKS=OFF
-DUMF_BUILD_TESTS=ON
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
-DUMF_ENABLE_POOL_TRACKING=ON

- name: Build UMF
run: cmake --build ${{github.workspace}}/build -j $(nproc)

- name: Run tests
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure --test-dir test
3 changes: 3 additions & 0 deletions .github/workflows/pr_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,6 @@ jobs:
Valgrind:
needs: [Build]
uses: ./.github/workflows/valgrind.yml
MultiNuma:
needs: [Build]
uses: ./.github/workflows/multi_numa.yml
1 change: 0 additions & 1 deletion .github/workflows/qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,4 @@ jobs:
fi

scp -P 2222 ${{github.workspace}}/scripts/qemu/run-build.sh [email protected]:/home/cxltest
scp -P 2222 ${{github.workspace}}/.github/scripts/install_hwloc.sh [email protected]:/home/cxltest
ssh [email protected] -p 2222 -t "bash /home/cxltest/run-build.sh https://github.com/$CI_REPO ${{env.CI_BRANCH}}"
6 changes: 1 addition & 5 deletions scripts/qemu/run-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ repo=$1
branch=$2

echo password | sudo -Sk apt update
echo password | sudo -Sk apt install -y git cmake gcc g++ numactl libnuma-dev libjemalloc-dev libtbb-dev

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

numactl -H

Expand Down
8 changes: 6 additions & 2 deletions src/provider/provider_os_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ static umf_result_t translate_params(umf_os_memory_provider_params_t *in_params,
result = translate_numa_mode(in_params->numa_mode, emptyNodeset,
&provider->numa_policy);
if (result != UMF_RESULT_SUCCESS) {
LOG_ERR("incorrect NUMA mode: %u", in_params->numa_mode);
LOG_ERR("incorrect NUMA mode (%u) or wrong params",
in_params->numa_mode);
return result;
}
LOG_INFO("established HWLOC NUMA policy: %u", provider->numa_policy);

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

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

os_provider->nodeset_str_buf = umf_ba_global_alloc(NODESET_STR_BUF_LEN);
if (!os_provider->nodeset_str_buf) {
LOG_INFO("Allocating memory for printing NUMA nodes failed");
LOG_INFO("allocating memory for printing NUMA nodes failed");
} else {
if (hwloc_bitmap_list_snprintf(os_provider->nodeset_str_buf,
NODESET_STR_BUF_LEN,
os_provider->nodeset)) {
LOG_INFO("OS provider initialized with NUMA nodes: %s",
os_provider->nodeset_str_buf);
} else if (hwloc_bitmap_iszero(os_provider->nodeset)) {
LOG_INFO("OS provider initialized with empty NUMA nodeset");
}
}

Expand Down
2 changes: 2 additions & 0 deletions test/common/numa_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ int getNumaNodeByPtr(void *ptr) {
int retm =
get_mempolicy(&nodeId, nullptr, 0, ptr, MPOL_F_ADDR | MPOL_F_NODE);
UT_ASSERTeq(retm, 0);
UT_ASSERT(nodeId >= 0);

return nodeId;
}

Expand Down
Loading