Skip to content

Commit 5914cd2

Browse files
authored
Merge pull request #847 from ldorau/Add_IPC_tests_umfIpcTest_to_the_file_provider
Add IPC tests (`umfIpcTest`) to the file provider
2 parents e08e311 + dee91d1 commit 5914cd2

File tree

5 files changed

+69
-5
lines changed

5 files changed

+69
-5
lines changed

.github/workflows/reusable_dax.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ jobs:
9797
run: >
9898
UMF_TESTS_DEVDAX_PATH="/dev/dax${{env.DEVDAX_NAMESPACE}}"
9999
UMF_TESTS_DEVDAX_SIZE="$(ndctl list --namespace=namespace${{env.DEVDAX_NAMESPACE}} | grep size | cut -d':' -f2 | cut -d',' -f1)"
100-
ctest -C ${{matrix.build_type}} -R devdax -V
100+
ctest -C ${{matrix.build_type}} -V -R devdax
101101
102102
- name: Run the FSDAX tests
103103
working-directory: ${{env.BUILD_DIR}}
104104
run: >
105105
UMF_TESTS_FSDAX_PATH=${{env.UMF_TESTS_FSDAX_PATH}}
106106
UMF_TESTS_FSDAX_PATH_2=${{env.UMF_TESTS_FSDAX_PATH_2}}
107-
ctest -C ${{matrix.build_type}} -V -R "umf-provider_file_memory|umf_example_dram_and_fsdax|umf-ipc_file_prov_fsdax"
107+
ctest -C ${{matrix.build_type}} -V -R "file|fsdax"
108108
109109
# TODO: enable the provider_devdax_memory_ipc test when the IPC tests with the proxy library are fixed
110110
# see the issue: https://github.com/oneapi-src/unified-memory-framework/issues/864
@@ -114,15 +114,17 @@ jobs:
114114
LD_PRELOAD=./lib/libumf_proxy.so
115115
UMF_TESTS_DEVDAX_PATH="/dev/dax${{env.DEVDAX_NAMESPACE}}"
116116
UMF_TESTS_DEVDAX_SIZE="$(ndctl list --namespace=namespace${{env.DEVDAX_NAMESPACE}} | grep size | cut -d':' -f2 | cut -d',' -f1)"
117-
ctest -C ${{matrix.build_type}} -R devdax -E provider_devdax_memory_ipc -V
117+
ctest -C ${{matrix.build_type}} -V -R devdax -E provider_devdax_memory_ipc
118118
119+
# TODO: enable the provider_file_memory_ipc test when the IPC tests with the proxy library are fixed
120+
# see the issue: https://github.com/oneapi-src/unified-memory-framework/issues/864
119121
- name: Run the FSDAX tests with the proxy library
120122
working-directory: ${{env.BUILD_DIR}}
121123
run: >
122124
LD_PRELOAD=./lib/libumf_proxy.so
123125
UMF_TESTS_FSDAX_PATH=${{env.UMF_TESTS_FSDAX_PATH}}
124126
UMF_TESTS_FSDAX_PATH_2=${{env.UMF_TESTS_FSDAX_PATH_2}}
125-
ctest -C ${{matrix.build_type}} -V -R "umf-provider_file_memory|umf_example_dram_and_fsdax|umf-ipc_file_prov_fsdax"
127+
ctest -C ${{matrix.build_type}} -V -R "file|fsdax" -E provider_file_memory_ipc
126128
127129
- name: Check coverage
128130
if: ${{ matrix.build_type == 'Debug' }}

.github/workflows/reusable_proxy_lib.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ jobs:
5959
- name: Build UMF
6060
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
6161

62+
# TODO enable the provider_file_memory_ipc test when the IPC tests with the proxy library are fixed
63+
# see the issue: https://github.com/oneapi-src/unified-memory-framework/issues/864
6264
- name: Run "ctest --output-on-failure" with proxy library
6365
working-directory: ${{env.BUILD_DIR}}
64-
run: LD_PRELOAD=./lib/libumf_proxy.so ctest --output-on-failure
66+
run: LD_PRELOAD=./lib/libumf_proxy.so ctest --output-on-failure -E provider_file_memory_ipc
6567

6668
- name: Run "./test/umf_test-memoryPool" with proxy library
6769
working-directory: ${{env.BUILD_DIR}}

test/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ if(LINUX AND (NOT UMF_DISABLE_HWLOC)) # OS-specific functions are implemented
301301
NAME provider_file_memory
302302
SRCS provider_file_memory.cpp
303303
LIBS ${UMF_UTILS_FOR_TEST})
304+
add_umf_test(
305+
NAME provider_file_memory_ipc
306+
SRCS provider_file_memory_ipc.cpp
307+
LIBS ${UMF_UTILS_FOR_TEST} ${LIB_JEMALLOC_POOL})
304308

305309
# This test requires Linux-only file memory provider
306310
if(UMF_POOL_JEMALLOC_ENABLED)

test/provider_file_memory_ipc.cpp

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright (C) 2024 Intel Corporation
2+
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
3+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
#include <umf/memory_provider.h>
6+
#include <umf/providers/provider_file_memory.h>
7+
#ifdef UMF_POOL_JEMALLOC_ENABLED
8+
#include <umf/pools/pool_jemalloc.h>
9+
#endif
10+
#ifdef UMF_POOL_SCALABLE_ENABLED
11+
#include <umf/pools/pool_scalable.h>
12+
#endif
13+
14+
#include "ipcFixtures.hpp"
15+
16+
using umf_test::test;
17+
18+
#define FILE_PATH ((char *)"tmp_file")
19+
20+
umf_file_memory_provider_params_t get_file_params_shared(char *path) {
21+
umf_file_memory_provider_params_t file_params =
22+
umfFileMemoryProviderParamsDefault(path);
23+
file_params.visibility = UMF_MEM_MAP_SHARED;
24+
return file_params;
25+
}
26+
27+
umf_file_memory_provider_params_t file_params_shared =
28+
get_file_params_shared(FILE_PATH);
29+
30+
HostMemoryAccessor hostAccessor;
31+
32+
static std::vector<ipcTestParams> ipcManyPoolsTestParamsList = {
33+
// TODO: enable it when sizes of allocations in ipcFixtures.hpp are fixed
34+
// {umfProxyPoolOps(), nullptr, umfFileMemoryProviderOps(),
35+
// &file_params_shared, &hostAccessor, true},
36+
#ifdef UMF_POOL_JEMALLOC_ENABLED
37+
{umfJemallocPoolOps(), nullptr, umfFileMemoryProviderOps(),
38+
&file_params_shared, &hostAccessor, false},
39+
#endif
40+
#ifdef UMF_POOL_SCALABLE_ENABLED
41+
{umfScalablePoolOps(), nullptr, umfFileMemoryProviderOps(),
42+
&file_params_shared, &hostAccessor, false},
43+
#endif
44+
};
45+
46+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(umfIpcTest);
47+
48+
INSTANTIATE_TEST_SUITE_P(FileProviderDifferentPoolsTest, umfIpcTest,
49+
::testing::ValuesIn(ipcManyPoolsTestParamsList));
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
Conditional variable destruction false-positive
3+
drd:CondErr
4+
...
5+
fun:pthread_cond_destroy@*
6+
...
7+
}

0 commit comments

Comments
 (0)