Skip to content

Add IPC tests (umfIpcTest) to the file provider #847

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
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
10 changes: 6 additions & 4 deletions .github/workflows/reusable_dax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/reusable_proxy_lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
49 changes: 49 additions & 0 deletions test/provider_file_memory_ipc.cpp
Original file line number Diff line number Diff line change
@@ -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 <umf/memory_provider.h>
#include <umf/providers/provider_file_memory.h>
#ifdef UMF_POOL_JEMALLOC_ENABLED
#include <umf/pools/pool_jemalloc.h>
#endif
#ifdef UMF_POOL_SCALABLE_ENABLED
#include <umf/pools/pool_scalable.h>
#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<ipcTestParams> 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));
7 changes: 7 additions & 0 deletions test/supp/drd-umf_test-provider_file_memory_ipc.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
Conditional variable destruction false-positive
drd:CondErr
...
fun:pthread_cond_destroy@*
...
}
Loading