From bf6dc3e82c9a9959d6b2bca5476510427d94a9df Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Tue, 5 Nov 2024 10:36:08 +0100 Subject: [PATCH 1/2] Disable the provider_file_memory_ipc test with the proxy library Disable the provider_file_memory_ipc test with the proxy library, because the IPC tests do not work with the proxy library. Ref: #864 Signed-off-by: Lukasz Dorau --- .github/workflows/reusable_dax.yml | 10 ++++++---- .github/workflows/reusable_proxy_lib.yml | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reusable_dax.yml b/.github/workflows/reusable_dax.yml index 787fe5360..b30cc0afc 100644 --- a/.github/workflows/reusable_dax.yml +++ b/.github/workflows/reusable_dax.yml @@ -97,14 +97,14 @@ jobs: run: > UMF_TESTS_DEVDAX_PATH="/dev/dax${{env.DEVDAX_NAMESPACE}}" UMF_TESTS_DEVDAX_SIZE="$(ndctl list --namespace=namespace${{env.DEVDAX_NAMESPACE}} | grep size | cut -d':' -f2 | cut -d',' -f1)" - ctest -C ${{matrix.build_type}} -R devdax -V + ctest -C ${{matrix.build_type}} -V -R devdax - name: Run the FSDAX tests working-directory: ${{env.BUILD_DIR}} run: > UMF_TESTS_FSDAX_PATH=${{env.UMF_TESTS_FSDAX_PATH}} UMF_TESTS_FSDAX_PATH_2=${{env.UMF_TESTS_FSDAX_PATH_2}} - ctest -C ${{matrix.build_type}} -V -R "umf-provider_file_memory|umf_example_dram_and_fsdax|umf-ipc_file_prov_fsdax" + ctest -C ${{matrix.build_type}} -V -R "file|fsdax" # TODO: enable the provider_devdax_memory_ipc test when the IPC tests with the proxy library are fixed # see the issue: https://github.com/oneapi-src/unified-memory-framework/issues/864 @@ -114,15 +114,17 @@ jobs: LD_PRELOAD=./lib/libumf_proxy.so UMF_TESTS_DEVDAX_PATH="/dev/dax${{env.DEVDAX_NAMESPACE}}" UMF_TESTS_DEVDAX_SIZE="$(ndctl list --namespace=namespace${{env.DEVDAX_NAMESPACE}} | grep size | cut -d':' -f2 | cut -d',' -f1)" - ctest -C ${{matrix.build_type}} -R devdax -E provider_devdax_memory_ipc -V + ctest -C ${{matrix.build_type}} -V -R devdax -E provider_devdax_memory_ipc + # TODO: enable the provider_file_memory_ipc test when the IPC tests with the proxy library are fixed + # see the issue: https://github.com/oneapi-src/unified-memory-framework/issues/864 - name: Run the FSDAX tests with the proxy library working-directory: ${{env.BUILD_DIR}} run: > LD_PRELOAD=./lib/libumf_proxy.so UMF_TESTS_FSDAX_PATH=${{env.UMF_TESTS_FSDAX_PATH}} UMF_TESTS_FSDAX_PATH_2=${{env.UMF_TESTS_FSDAX_PATH_2}} - ctest -C ${{matrix.build_type}} -V -R "umf-provider_file_memory|umf_example_dram_and_fsdax|umf-ipc_file_prov_fsdax" + ctest -C ${{matrix.build_type}} -V -R "file|fsdax" -E provider_file_memory_ipc - name: Check coverage if: ${{ matrix.build_type == 'Debug' }} diff --git a/.github/workflows/reusable_proxy_lib.yml b/.github/workflows/reusable_proxy_lib.yml index 3babd205e..56211b97d 100644 --- a/.github/workflows/reusable_proxy_lib.yml +++ b/.github/workflows/reusable_proxy_lib.yml @@ -59,9 +59,11 @@ jobs: - name: Build UMF run: cmake --build ${{env.BUILD_DIR}} -j $(nproc) + # TODO enable the provider_file_memory_ipc test when the IPC tests with the proxy library are fixed + # see the issue: https://github.com/oneapi-src/unified-memory-framework/issues/864 - name: Run "ctest --output-on-failure" with proxy library working-directory: ${{env.BUILD_DIR}} - run: LD_PRELOAD=./lib/libumf_proxy.so ctest --output-on-failure + run: LD_PRELOAD=./lib/libumf_proxy.so ctest --output-on-failure -E provider_file_memory_ipc - name: Run "./test/umf_test-memoryPool" with proxy library working-directory: ${{env.BUILD_DIR}} From dee91d1d4e5264c9e44e045a34cee3c6d01fe564 Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Wed, 6 Nov 2024 14:26:32 +0100 Subject: [PATCH 2/2] Add IPC tests (umfIpcTest) to the file provider Signed-off-by: Lukasz Dorau --- test/CMakeLists.txt | 4 ++ test/provider_file_memory_ipc.cpp | 49 +++++++++++++++++++ ...drd-umf_test-provider_file_memory_ipc.supp | 7 +++ 3 files changed, 60 insertions(+) create mode 100644 test/provider_file_memory_ipc.cpp create mode 100644 test/supp/drd-umf_test-provider_file_memory_ipc.supp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 475e2b19f..a4d7c1418 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -283,6 +283,10 @@ if(LINUX AND (NOT UMF_DISABLE_HWLOC)) # OS-specific functions are implemented NAME provider_file_memory SRCS provider_file_memory.cpp LIBS ${UMF_UTILS_FOR_TEST}) + add_umf_test( + NAME provider_file_memory_ipc + SRCS provider_file_memory_ipc.cpp + LIBS ${UMF_UTILS_FOR_TEST} ${LIB_JEMALLOC_POOL}) # This test requires Linux-only file memory provider if(UMF_POOL_JEMALLOC_ENABLED) diff --git a/test/provider_file_memory_ipc.cpp b/test/provider_file_memory_ipc.cpp new file mode 100644 index 000000000..619c13b05 --- /dev/null +++ b/test/provider_file_memory_ipc.cpp @@ -0,0 +1,49 @@ +// Copyright (C) 2024 Intel Corporation +// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#include +#ifdef UMF_POOL_JEMALLOC_ENABLED +#include +#endif +#ifdef UMF_POOL_SCALABLE_ENABLED +#include +#endif + +#include "ipcFixtures.hpp" + +using umf_test::test; + +#define FILE_PATH ((char *)"tmp_file") + +umf_file_memory_provider_params_t get_file_params_shared(char *path) { + umf_file_memory_provider_params_t file_params = + umfFileMemoryProviderParamsDefault(path); + file_params.visibility = UMF_MEM_MAP_SHARED; + return file_params; +} + +umf_file_memory_provider_params_t file_params_shared = + get_file_params_shared(FILE_PATH); + +HostMemoryAccessor hostAccessor; + +static std::vector ipcManyPoolsTestParamsList = { +// TODO: enable it when sizes of allocations in ipcFixtures.hpp are fixed +// {umfProxyPoolOps(), nullptr, umfFileMemoryProviderOps(), +// &file_params_shared, &hostAccessor, true}, +#ifdef UMF_POOL_JEMALLOC_ENABLED + {umfJemallocPoolOps(), nullptr, umfFileMemoryProviderOps(), + &file_params_shared, &hostAccessor, false}, +#endif +#ifdef UMF_POOL_SCALABLE_ENABLED + {umfScalablePoolOps(), nullptr, umfFileMemoryProviderOps(), + &file_params_shared, &hostAccessor, false}, +#endif +}; + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(umfIpcTest); + +INSTANTIATE_TEST_SUITE_P(FileProviderDifferentPoolsTest, umfIpcTest, + ::testing::ValuesIn(ipcManyPoolsTestParamsList)); diff --git a/test/supp/drd-umf_test-provider_file_memory_ipc.supp b/test/supp/drd-umf_test-provider_file_memory_ipc.supp new file mode 100644 index 000000000..76844585d --- /dev/null +++ b/test/supp/drd-umf_test-provider_file_memory_ipc.supp @@ -0,0 +1,7 @@ +{ + Conditional variable destruction false-positive + drd:CondErr + ... + fun:pthread_cond_destroy@* + ... +}