| 
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()  | 
0 commit comments