Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.

Commit b89c131

Browse files
author
kc432959
committed
changes for my tests
1 parent 716d4e7 commit b89c131

File tree

3 files changed

+142
-134
lines changed

3 files changed

+142
-134
lines changed
Lines changed: 133 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,133 @@
1-
# SPDX-FileCopyrightText: Intel Corporation
2-
#
3-
# SPDX-License-Identifier: BSD-3-Clause
4-
5-
set(CMAKE_INCLUDE_CURRENT_DIR ON)
6-
7-
# cmake-format: off
8-
add_executable(
9-
mp-bench
10-
mp-bench.cpp
11-
../common/distributed_vector.cpp
12-
../common/dot_product.cpp
13-
../common/inclusive_exclusive_scan.cpp
14-
../common/sort.cpp
15-
../common/stream.cpp
16-
streammp.cpp
17-
rooted.cpp
18-
stencil_1d.cpp
19-
stencil_2d.cpp
20-
chunk.cpp
21-
# mdspan.cpp
22-
mpi.cpp)
23-
# cmake-format: on
24-
25-
# disabled with SYCL due to DRA-135
26-
if(NOT ENABLE_SYCL)
27-
target_sources(mp-bench PRIVATE mdspan.cpp)
28-
endif()
29-
30-
if(ENABLE_SYCL)
31-
target_sources(mp-bench PRIVATE fft3d.cpp)
32-
endif()
33-
34-
if(NOT ENABLE_CUDA)
35-
# does not compile in CUDA because: black_scholes.cpp uses std::log
36-
# shallow_water, wave_equation uses uses exp
37-
target_sources(mp-bench PRIVATE ../common/black_scholes.cpp shallow_water.cpp
38-
wave_equation.cpp)
39-
endif()
40-
41-
# mp-quick-bench is for development. By reducing the number of source files, it
42-
# builds much faster. Change the source files to match what you need to test. It
43-
# is OK to commit changes to the source file list.
44-
add_executable(mp-quick-bench mp-bench.cpp ../common/distributed_vector.cpp)
45-
46-
foreach(mp-bench-exec IN ITEMS mp-bench mp-quick-bench)
47-
target_compile_definitions(${mp-bench-exec} PRIVATE BENCH_MP)
48-
target_link_libraries(${mp-bench-exec} benchmark::benchmark cxxopts DR::mpi)
49-
if(ENABLE_ISHMEM)
50-
target_link_ishmem(${mp-bench-exec})
51-
endif()
52-
if(ENABLE_SYCL)
53-
target_link_libraries(${mp-bench-exec} MKL::MKL_DPCPP)
54-
endif()
55-
endforeach()
56-
57-
if(ENABLE_SYCL)
58-
# target_sources(mp-quick-bench PRIVATE fft3d.cpp)
59-
endif()
60-
61-
cmake_path(GET MPI_CXX_ADDITIONAL_INCLUDE_DIRS FILENAME MPI_IMPL)
62-
63-
# debug mp-bench is too slow
64-
if(CMAKE_BUILD_TYPE STREQUAL "Release" AND NOT MPI_IMPL STREQUAL "openmpi")
65-
# MPI_Win_create fails for communicator with size 1 30000 is minimum because
66-
# of static column size for stencil2D disable DPL benchmarks because we get
67-
# intermittent fails with: ONEAPI_DEVICE_SELECTOR=opencl:cpu mpirun -n 1
68-
# ./mp-bench --vector-size 30000 --rows 100 --columns 100 --check
69-
add_mp_ctest(
70-
NAME mp-bench TIMEOUT 200 TARGS --vector-size 30000 --rows 100 --columns
71-
100 --check --benchmark_filter=-FFT3D.*)
72-
if(ENABLE_SYCL)
73-
add_mp_ctest(
74-
NAME mp-bench TIMEOUT 200 SYCL TARGS --vector-size 30000 --rows 100
75-
--columns 100 --check --benchmark_filter=-.*DPL.*)
76-
endif()
77-
endif()
78-
79-
add_executable(wave_equation wave_equation.cpp)
80-
target_link_libraries(wave_equation cxxopts DR::mpi)
81-
target_compile_definitions(wave_equation PRIVATE STANDALONE_BENCHMARK)
82-
add_mp_ctest(NAME wave_equation)
83-
add_executable(wave_equation_wide wave_equation_wide.cpp)
84-
target_link_libraries(wave_equation_wide cxxopts DR::mpi)
85-
target_compile_definitions(wave_equation_wide PRIVATE STANDALONE_BENCHMARK)
86-
add_mp_ctest(NAME wave_equation_wide)
87-
# add_mp_ctest(TEST_NAME wave_equation_fused NAME wave_equation TARGS -f) #
88-
# DRA-92
89-
if(ENABLE_SYCL)
90-
add_mp_ctest(
91-
TEST_NAME wave_equation-sycl NAME wave_equation TIMEOUT 1000 NPROC 8 SYCL)
92-
add_mp_ctest(
93-
TEST_NAME wave_equation-sycl-benchmark NAME wave_equation TIMEOUT 1000 NPROC 8 SYCL TARGS -t)
94-
add_mp_ctest(
95-
TEST_NAME wave_equation_fused-sycl NAME wave_equation TIMEOUT 1000 NPROC 2 SYCL TARGS -f)
96-
add_mp_ctest(
97-
TEST_NAME wave_equation_wide-sycl NAME wave_equation_wide TIMEOUT 1000 NPROC 8 SYCL)
98-
foreach(redundancy RANGE 1 8)
99-
add_mp_ctest(
100-
TEST_NAME wave_equation_wide-sycl-benchmark-${redundancy} NAME wave_equation_wide TIMEOUT 1000 NPROC 8 SYCL TARGS -t 100 -r ${redundancy})
101-
endforeach()
102-
add_mp_ctest(
103-
TEST_NAME wave_equation_wide-sycl-gpu NAME wave_equation_wide TIMEOUT 1000 NPROC 8 SYCL TARGS --device-memory)
104-
foreach(redundancy RANGE 1 8)
105-
add_mp_ctest(
106-
TEST_NAME wave_equation_wide-sycl-gpu-benchmark-${redundancy} NAME wave_equation_wide TIMEOUT 1000 NPROC 8 SYCL TARGS --device-memory -t 100 -r ${redundancy})
107-
endforeach()
108-
endif()
109-
110-
add_executable(shallow_water shallow_water.cpp)
111-
target_link_libraries(shallow_water cxxopts DR::mpi)
112-
target_compile_definitions(shallow_water PRIVATE STANDALONE_BENCHMARK)
113-
114-
# issue DRA-23 add_mp_ctest(TEST_NAME shallow_water NAME shallow_water NPROC 1)
115-
# add_mp_ctest( TEST_NAME shallow_water_fused NAME shallow_water NPROC 1 TARGS
116-
# -f)
117-
118-
if(ENABLE_SYCL)
119-
if(CMAKE_BUILD_TYPE STREQUAL "Release")
120-
# too long (or hangs?) in debug
121-
122-
add_mp_ctest(
123-
TEST_NAME shallow_water-sycl NAME shallow_water NPROC 2 SYCL)
124-
add_mp_ctest(
125-
TEST_NAME shallow_water_fused-sycl NAME shallow_water NPROC 2 SYCL TARGS
126-
-f)
127-
endif()
128-
129-
add_executable(fft3d_mp fft3d.cpp)
130-
target_link_libraries(fft3d_mp cxxopts DR::mpi MKL::MKL_DPCPP)
131-
target_compile_definitions(fft3d_mp PRIVATE STANDALONE_BENCHMARK)
132-
add_mp_ctest(TEST_NAME fft3d_mp NAME fft3d_mp NPROC 2)
133-
endif()
1+
## SPDX-FileCopyrightText: Intel Corporation
2+
##
3+
## SPDX-License-Identifier: BSD-3-Clause
4+
#
5+
#set(CMAKE_INCLUDE_CURRENT_DIR ON)
6+
#
7+
## cmake-format: off
8+
#add_executable(
9+
# mp-bench
10+
# mp-bench.cpp
11+
# ../common/distributed_vector.cpp
12+
# ../common/dot_product.cpp
13+
# ../common/inclusive_exclusive_scan.cpp
14+
# ../common/sort.cpp
15+
# ../common/stream.cpp
16+
# streammp.cpp
17+
# rooted.cpp
18+
# stencil_1d.cpp
19+
# stencil_2d.cpp
20+
# chunk.cpp
21+
# # mdspan.cpp
22+
# mpi.cpp)
23+
## cmake-format: on
24+
#
25+
## disabled with SYCL due to DRA-135
26+
#if(NOT ENABLE_SYCL)
27+
# target_sources(mp-bench PRIVATE mdspan.cpp)
28+
#endif()
29+
#
30+
#if(ENABLE_SYCL)
31+
# target_sources(mp-bench PRIVATE fft3d.cpp)
32+
#endif()
33+
#
34+
#if(NOT ENABLE_CUDA)
35+
# # does not compile in CUDA because: black_scholes.cpp uses std::log
36+
# # shallow_water, wave_equation uses uses exp
37+
# target_sources(mp-bench PRIVATE ../common/black_scholes.cpp shallow_water.cpp
38+
# wave_equation.cpp)
39+
#endif()
40+
#
41+
## mp-quick-bench is for development. By reducing the number of source files, it
42+
## builds much faster. Change the source files to match what you need to test. It
43+
## is OK to commit changes to the source file list.
44+
#add_executable(mp-quick-bench mp-bench.cpp ../common/distributed_vector.cpp)
45+
#
46+
#foreach(mp-bench-exec IN ITEMS mp-bench mp-quick-bench)
47+
# target_compile_definitions(${mp-bench-exec} PRIVATE BENCH_MP)
48+
# target_link_libraries(${mp-bench-exec} benchmark::benchmark cxxopts DR::mpi)
49+
# if(ENABLE_ISHMEM)
50+
# target_link_ishmem(${mp-bench-exec})
51+
# endif()
52+
# if(ENABLE_SYCL)
53+
# target_link_libraries(${mp-bench-exec} MKL::MKL_DPCPP)
54+
# endif()
55+
#endforeach()
56+
#
57+
#if(ENABLE_SYCL)
58+
# # target_sources(mp-quick-bench PRIVATE fft3d.cpp)
59+
#endif()
60+
#
61+
#cmake_path(GET MPI_CXX_ADDITIONAL_INCLUDE_DIRS FILENAME MPI_IMPL)
62+
#
63+
## debug mp-bench is too slow
64+
#if(CMAKE_BUILD_TYPE STREQUAL "Release" AND NOT MPI_IMPL STREQUAL "openmpi")
65+
# # MPI_Win_create fails for communicator with size 1 30000 is minimum because
66+
# # of static column size for stencil2D disable DPL benchmarks because we get
67+
# # intermittent fails with: ONEAPI_DEVICE_SELECTOR=opencl:cpu mpirun -n 1
68+
# # ./mp-bench --vector-size 30000 --rows 100 --columns 100 --check
69+
# add_mp_ctest(
70+
# NAME mp-bench TIMEOUT 200 TARGS --vector-size 30000 --rows 100 --columns
71+
# 100 --check --benchmark_filter=-FFT3D.*)
72+
# if(ENABLE_SYCL)
73+
# add_mp_ctest(
74+
# NAME mp-bench TIMEOUT 200 SYCL TARGS --vector-size 30000 --rows 100
75+
# --columns 100 --check --benchmark_filter=-.*DPL.*)
76+
# endif()
77+
#endif()
78+
#
79+
#add_executable(wave_equation wave_equation.cpp)
80+
#target_link_libraries(wave_equation cxxopts DR::mpi)
81+
#target_compile_definitions(wave_equation PRIVATE STANDALONE_BENCHMARK)
82+
#add_mp_ctest(NAME wave_equation)
83+
#add_executable(wave_equation_wide wave_equation_wide.cpp)
84+
#target_link_libraries(wave_equation_wide cxxopts DR::mpi)
85+
#target_compile_definitions(wave_equation_wide PRIVATE STANDALONE_BENCHMARK)
86+
#add_mp_ctest(NAME wave_equation_wide)
87+
## add_mp_ctest(TEST_NAME wave_equation_fused NAME wave_equation TARGS -f) #
88+
## DRA-92
89+
#if(ENABLE_SYCL)
90+
# add_mp_ctest(
91+
# TEST_NAME wave_equation-sycl NAME wave_equation TIMEOUT 1000 NPROC 8 SYCL)
92+
# add_mp_ctest(
93+
# TEST_NAME wave_equation-sycl-benchmark NAME wave_equation TIMEOUT 1000 NPROC 8 SYCL TARGS -t)
94+
# add_mp_ctest(
95+
# TEST_NAME wave_equation_fused-sycl NAME wave_equation TIMEOUT 1000 NPROC 2 SYCL TARGS -f)
96+
# add_mp_ctest(
97+
# TEST_NAME wave_equation_wide-sycl NAME wave_equation_wide TIMEOUT 1000 NPROC 8 SYCL)
98+
# foreach(redundancy RANGE 1 8)
99+
# add_mp_ctest(
100+
# TEST_NAME wave_equation_wide-sycl-benchmark-${redundancy} NAME wave_equation_wide TIMEOUT 1000 NPROC 8 SYCL TARGS -t 100 -r ${redundancy})
101+
# endforeach()
102+
# add_mp_ctest(
103+
# TEST_NAME wave_equation_wide-sycl-gpu NAME wave_equation_wide TIMEOUT 1000 NPROC 8 SYCL TARGS --device-memory)
104+
# foreach(redundancy RANGE 1 8)
105+
# add_mp_ctest(
106+
# TEST_NAME wave_equation_wide-sycl-gpu-benchmark-${redundancy} NAME wave_equation_wide TIMEOUT 1000 NPROC 8 SYCL TARGS --device-memory -t 100 -r ${redundancy})
107+
# endforeach()
108+
#endif()
109+
#
110+
#add_executable(shallow_water shallow_water.cpp)
111+
#target_link_libraries(shallow_water cxxopts DR::mpi)
112+
#target_compile_definitions(shallow_water PRIVATE STANDALONE_BENCHMARK)
113+
#
114+
## issue DRA-23 add_mp_ctest(TEST_NAME shallow_water NAME shallow_water NPROC 1)
115+
## add_mp_ctest( TEST_NAME shallow_water_fused NAME shallow_water NPROC 1 TARGS
116+
## -f)
117+
#
118+
#if(ENABLE_SYCL)
119+
# if(CMAKE_BUILD_TYPE STREQUAL "Release")
120+
# # too long (or hangs?) in debug
121+
#
122+
# add_mp_ctest(
123+
# TEST_NAME shallow_water-sycl NAME shallow_water NPROC 2 SYCL)
124+
# add_mp_ctest(
125+
# TEST_NAME shallow_water_fused-sycl NAME shallow_water NPROC 2 SYCL TARGS
126+
# -f)
127+
# endif()
128+
#
129+
# add_executable(fft3d_mp fft3d.cpp)
130+
# target_link_libraries(fft3d_mp cxxopts DR::mpi MKL::MKL_DPCPP)
131+
# target_compile_definitions(fft3d_mp PRIVATE STANDALONE_BENCHMARK)
132+
# add_mp_ctest(TEST_NAME fft3d_mp NAME fft3d_mp NPROC 2)
133+
#endif()

test/gtest/mp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ add_executable(
6060
# is OK to commit changes to the source file list.
6161
add_executable(mp-quick-test
6262
mp-tests.cpp
63-
halo.cpp
63+
halo-3.cpp
6464
)
6565
add_executable(mp-quick-test-3-only
6666
mp-tests.cpp

test/gtest/mp/halo-3.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,27 @@ TYPED_TEST(Halo3, halo_is_visible_after_exchange_not_earlier) {
1818
dv.halo().exchange();
1919

2020
fill(dv, 13);
21+
std::cout << "switch to check values: \n";
2122
switch (dr::mp::default_comm().rank()) {
2223
case 0:
24+
std::cout << "dv[0] = " << *(dv.begin() + 0).local() << "\n";
2325
EXPECT_EQ(*(dv.begin() + 0).local(), 13);
26+
std::cout << "dv[1] = " << *(dv.begin() + 0).local() << "\n";
2427
EXPECT_EQ(*(dv.begin() + 1).local(), 7);
2528
break;
2629
case 1:
30+
std::cout << "dv[0] = " << *(dv.begin() + 0).local() << "\n";
2731
EXPECT_EQ(*(dv.begin() + 0).local(), 7);
32+
std::cout << "dv[1] = " << *(dv.begin() + 0).local() << "\n";
2833
EXPECT_EQ(*(dv.begin() + 1).local(), 13);
34+
std::cout << "dv[2] = " << *(dv.begin() + 0).local() << "\n";
2935
EXPECT_EQ(*(dv.begin() + 2).local(), 7);
3036
break;
3137
case 2:
3238
EXPECT_EQ(*(dv.begin() + 1).local(), 7);
39+
std::cout << "dv[1] = " << *(dv.begin() + 0).local() << "\n";
3340
EXPECT_EQ(*(dv.begin() + 2).local(), 13);
41+
std::cout << "dv[2] = " << *(dv.begin() + 0).local() << "\n";
3442
break;
3543
}
3644

0 commit comments

Comments
 (0)