-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
1006 lines (908 loc) · 56.2 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright (c) 2020-2021 Gregor Daiß
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
cmake_minimum_required(VERSION 3.16)
project(CPPuddle CXX C) # Some random project name
set(CMAKE_CXX_STANDARD 17)
#------------------------------------------------------------------------------------------------------------
# Version
set(CPPUDDLE_VERSION_MAJOR 0)
set(CPPUDDLE_VERSION_MINOR 3)
set(CPPUDDLE_VERSION_PATCH 1)
set(CPPUDDLE_VERSION_STRING "${CPPUDDLE_VERSION_MAJOR}.${CPPUDDLE_VERSION_MINOR}.${CPPUDDLE_VERSION_PATCH}.")
#------------------------------------------------------------------------------------------------------------
# Define Options
# GPU-related options
option(CPPUDDLE_WITH_CUDA "Enable CUDA tests/examples" OFF)
option(CPPUDDLE_WITH_KOKKOS "Enable KOKKOS tests/examples" OFF)
set(CPPUDDLE_WITH_MAX_NUMBER_GPUS "1" CACHE STRING "Number of GPUs that will be used. Should match the number of GPUs used when using the maximum number of HPX worker threads. Should be 1 for non-HPX builds.")
# HPX-related options
option(CPPUDDLE_WITH_HPX "Enable basic HPX integration and examples" OFF)
option(CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS "Enable HPX-aware allocators for even better HPX integration" ON)
set(CPPUDDLE_WITH_HPX_MUTEX ON CACHE BOOL
"Use HPX spinlock mutex instead of std::mutex")
set(CPPUDDLE_WITH_NUMBER_BUCKETS "128" CACHE STRING "Number of internal recycle buckets buffer type. Should ideally match the intended number of HPX workers or be 1 in non-HPX builds.")
# Test-related options
option(CPPUDDLE_WITH_COUNTERS "Turns on allocations counters. Useful for extended testing" OFF)
option(CPPUDDLE_WITH_TESTS "Build tests/examples" OFF)
set(CPPUDDLE_WITH_DEADLOCK_TEST_REPETITONS "100000" CACHE STRING "Number of repetitions for the aggregation executor deadlock tests")
option(CPPUDDLE_WITH_BUFFER_RECYCLING "Enables the default recycling behaviour! Turning this off will have a major negative performance impact and is only intended for testing!" ON)
option(CPPUDDLE_WITH_AGGRESSIVE_CONTENT_RECYCLING "Allows the aggressive allocators variants to reuse contents from previous buffers (and thus skip initializations)" ON)
option(CPPUDDLE_WITH_EXECUTOR_RECYCLING "Enables the default executor recycling behaviour! Turning this off will have a major negative performance impact and is only intended for testing!" ON)
# Tooling options
option(CPPUDDLE_WITH_CLANG_TIDY "Enable clang tidy warnings" OFF)
option(CPPUDDLE_WITH_CLANG_FORMAT "Enable clang format target" OFF)
option(CPPUDDLE_WITH_DOCUMENTATION "Build documentation using doxygen." OFF)
#------------------------------------------------------------------------------------------------------------
# Define dependencies and conflicts/incompatibilities
# Find HPX for HPX-enabled builds
if (CPPUDDLE_WITH_HPX)
find_package(HPX 1.8.0 REQUIRED) # older versions might work but are untested with the current cppuddle
endif()
# HPX build are really better with HPX-aware allocators: Warn if disabled
if(CPPUDDLE_WITH_HPX)
if(NOT CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS)
message(WARNING " CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS=ON is recommended for HPX builds \
(currently OFF even though CPPUDDLE_WITH_HPX=ON). Performance negatively impacted!")
endif()
endif()
if(CPPUDDLE_WITH_NUMBER_GPUS GREATER 1)
if(NOT CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS)
message(FATAL_ERROR " CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS=ON is required Multi-GPU builds!")
endif()
endif()
if(CPPUDDLE_WITH_NUMBER_BUCKETS GREATER 1)
if(NOT CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS)
message(FATAL_ERROR " CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS=ON is required for Multi-Worker build! \
Either turn it on or configure with CPPUDDLE_WITH_NUMBER_BUCKETS=1 !")
endif()
endif()
# HPX-aware allocators require HPX-Support. Warn if HPX support is disabled as we fallback on non-aware
# allocators
if(NOT CPPUDDLE_WITH_HPX)
if(CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS)
message(WARNING " CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS=ON even though CPPUDDLE_WITH_HPX=OFF. \
Falling back on non-hpx-aware allocators which will negatively impact performance!")
endif()
endif()
# GPU options -- mostly for tests actually, otherwise simply including the the headers
# offers users all functionality regardless of these options
if (CPPUDDLE_WITH_CUDA)
enable_language(CUDA)
endif ()
if (CPPUDDLE_WITH_KOKKOS)
# Find packages
find_package(Kokkos 3.0.0 REQUIRED)
find_package(HPXKokkos REQUIRED)
# Check that everything required is activated
if (NOT CPPUDDLE_WITH_HPX)
message(FATAL_ERROR " KOKKOS support requires HPX flag to be turned on")
endif()
#if (NOT CPPUDDLE_WITH_CUDA AND NOT CPPUDDLE_WITH_HIP)
# message(FATAL_ERROR "KOKKOS support requires CUDA flag to be turned on")
#endif()
# Check that Kokkos and HPX options are consistent.
if(Kokkos_ENABLE_CUDA)
if(NOT HPX_WITH_CUDA)
message(FATAL_ERROR " Kokkos was built with CUDA support, HPX was not")
endif()
kokkos_check(OPTIONS CUDA_LAMBDA)
if(NOT HPX_WITH_CUDA)
message(FATAL_ERROR " Kokkos was built with CUDA support, HPX was not")
endif()
else()
if(HPX_WITH_CUDA)
message(FATAL_ERROR " HPX was built with CUDA support, Kokkos was not")
endif()
endif()
kokkos_check(DEVICES HPX)
endif()
# For builds with tests we need Boost for the program_options
if (CPPUDDLE_WITH_TESTS)
find_package(Boost REQUIRED program_options)
endif()
# Add Linter warnings
if (CPPUDDLE_WITH_CLANG_TIDY)
find_program(CLANG_TIDY "clang-tidy")
if(CLANG_TIDY)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-header-filter=.;-checks=*,-fuchsia*,-misc-unused-parameters,-readability-named-parameter,-cert*,-android*,-modernize-pass-by-value,-hicpp-use-equals-default,-modernize-use-equals-default")
endif()
endif()
# Define clang format target
if (CPPUDDLE_WITH_CLANG_FORMAT)
file(GLOB_RECURSE
ALL_CXX_SOURCE_FILES
src/*.cpp tests/*.cpp test/*.cu tests/*.hpp src/*.hpp include/*.hpp src/*.cu
)
find_program(CLANG_FORMAT "clang-format")
if(CLANG_FORMAT)
add_custom_target(
clang-format
COMMAND clang-format
-i
#-style=llvm
-style=file # checks .clang-format file
${ALL_CXX_SOURCE_FILES}
)
endif()
endif()
if (CPPUDDLE_WITH_DOCUMENTATION)
add_subdirectory(docs)
endif ()
#------------------------------------------------------------------------------------------------------------
# Define library targets and installation
# (also includes various warnings for non-optimal build configurations)
# TODO Cleanup targets:
# this is leftover from the days where cppuddle was not header-only
## Interface targets
add_library(buffer_manager INTERFACE)
if (CPPUDDLE_WITH_HPX)
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_HAVE_HPX")
if(CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS)
message(INFO " Compiling with HPX-aware allocators!")
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_HAVE_HPX_AWARE_ALLOCATORS")
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_HAVE_MAX_NUMBER_GPUS=${CPPUDDLE_WITH_MAX_NUMBER_GPUS}")
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_HAVE_NUMBER_BUCKETS=${CPPUDDLE_WITH_NUMBER_BUCKETS}")
else()
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_HAVE_MAX_NUMBER_GPUS=1")
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_HAVE_NUMBER_BUCKETS=1")
endif()
else()
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_HAVE_MAX_NUMBER_GPUS=1")
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_HAVE_NUMBER_BUCKETS=1")
endif()
if (CPPUDDLE_WITH_COUNTERS)
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_HAVE_COUNTERS")
endif()
target_include_directories(buffer_manager INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
)
add_library(stream_manager INTERFACE)
if (CPPUDDLE_WITH_HPX)
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_HAVE_HPX")
if(CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS)
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_HAVE_HPX_AWARE_ALLOCATORS")
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_HAVE_MAX_NUMBER_GPUS=${CPPUDDLE_WITH_MAX_NUMBER_GPUS}")
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_HAVE_NUMBER_BUCKETS=${CPPUDDLE_WITH_NUMBER_BUCKETS}")
else()
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_HAVE_MAX_NUMBER_GPUS=1")
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_HAVE_NUMBER_BUCKETS=1")
endif()
else()
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_HAVE_MAX_NUMBER_GPUS=1")
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_HAVE_NUMBER_BUCKETS=1")
endif()
if (CPPUDDLE_WITH_COUNTERS)
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_HAVE_COUNTERS")
endif()
target_include_directories(stream_manager INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
)
if(CPPUDDLE_WITH_HPX_MUTEX)
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_HAVE_HPX_MUTEX")
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_HAVE_HPX_MUTEX")
message(INFO " Compiling with HPX spinlock")
else()
message(INFO " Compiling with std::mutex!")
endif()
if(CPPUDDLE_WITH_BUFFER_RECYCLING)
message(INFO " Using default buffer recycling behaviour!")
else()
message(WARNING " Slow Build: Buffer recycling is deactivated. This should only be used for performance tests!")
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_DEACTIVATE_BUFFER_RECYCLING")
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_DEACTIVATE_BUFFER_RECYCLING")
endif()
if(CPPUDDLE_WITH_AGGRESSIVE_CONTENT_RECYCLING)
message(INFO " Using default behaviour for aggressive content reusage (only relevant for aggressive allocators)!")
else()
message(WARNING " Slow Build: Aggressive allocators (and thus content recycling) is disabled. This should only be used for performance tests!")
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_DEACTIVATE_AGGRESSIVE_ALLOCATORS")
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_DEACTIVATE_AGGRESSIVE_ALLOCATORS")
endif()
if(CPPUDDLE_WITH_EXECUTOR_RECYCLING)
message(INFO " Using default executor recycling behaviour!")
else()
message(WARNING " Slow Build: executor recycling is deactivated. This should only be used for performance tests!")
target_compile_definitions(buffer_manager INTERFACE "CPPUDDLE_DEACTIVATE_EXECUTOR_RECYCLING")
target_compile_definitions(stream_manager INTERFACE "CPPUDDLE_DEACTIVATE_EXECUTOR_RECYCLING")
endif()
# install libs with the defitions:
install(TARGETS buffer_manager EXPORT CPPuddle
)
install(TARGETS stream_manager EXPORT CPPuddle
)
# install all headers
install(
DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include
)
install(FILES cppuddle-config.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/CPPuddle/)
install(EXPORT CPPuddle NAMESPACE CPPuddle:: DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/CPPuddle/)
#Boost::boost Boost::program_options HPX::hpx Kokkos::kokkos HPXKokkos::hpx_kokkos buffer_manager stream_manager
if (CPPUDDLE_WITH_TESTS)
if (CPPUDDLE_WITH_CUDA)
add_hpx_executable(
recycling-with-hpx-cuda
DEPENDENCIES
Boost::boost Boost::program_options HPX::hpx buffer_manager stream_manager
COMPONENT_DEPENDENCIES iostreams
SOURCES
examples/recycling-with-hpx-cuda.cu
)
if (CPPUDDLE_WITH_KOKKOS)
add_hpx_executable(
recycling-with-hpx-kokkos
DEPENDENCIES
Boost::boost Boost::program_options Kokkos::kokkos HPXKokkos::hpx_kokkos HPX::hpx buffer_manager stream_manager
COMPONENT_DEPENDENCIES iostreams
SOURCES
examples/recycling-with-hpx-kokkos.cpp
)
add_hpx_executable(
kernel-aggregation-with-hpx-kokkos
DEPENDENCIES
Boost::boost Boost::program_options Kokkos::kokkos HPXKokkos::hpx_kokkos HPX::hpx buffer_manager stream_manager
COMPONENT_DEPENDENCIES iostreams
SOURCES
examples/kernel-aggregation-with-hpx-kokkos.cpp
)
endif()
endif()
endif()
#------------------------------------------------------------------------------------------------------------
# Define cmake targets for all tests/example executables
## Add target for tests and tests definitions
if (CPPUDDLE_WITH_TESTS)
if(NOT CPPUDDLE_WITH_BUFFER_RECYCLING)
message(FATAL_ERROR "The CPPuddle tests only work with CPPUDDLE_WITH_BUFFER_RECYCLING=ON. Turning off buffer recycling is not recommended in general!")
endif()
add_executable(allocator_test tests/allocator_test.cpp)
if (CPPUDDLE_WITH_HPX)
target_link_libraries(allocator_test
${Boost_LIBRARIES} HPX::hpx Boost::boost Boost::program_options buffer_manager)
else()
target_link_libraries(allocator_test
${Boost_LIBRARIES} Boost::boost Boost::program_options buffer_manager)
endif()
add_executable(allocator_aligned_test tests/allocator_aligned_test.cpp)
if (CPPUDDLE_WITH_HPX)
target_link_libraries(allocator_aligned_test
${Boost_LIBRARIES} HPX::hpx Boost::boost Boost::program_options buffer_manager)
else()
target_link_libraries(allocator_aligned_test
${Boost_LIBRARIES} Boost::boost Boost::program_options buffer_manager)
endif()
if (CPPUDDLE_WITH_HPX)
add_executable(allocator_hpx_test tests/allocator_hpx_test.cpp)
target_link_libraries(allocator_hpx_test
PRIVATE Boost::boost Boost::program_options HPX::hpx buffer_manager)
if (CPPUDDLE_WITH_CUDA)
add_executable(allocator_cuda_test tests/allocator_cuda_test.cu)
target_link_libraries(allocator_cuda_test
PRIVATE Kokkos::kokkos HPXKokkos::hpx_kokkos buffer_manager)
target_compile_definitions(allocator_cuda_test PRIVATE CPPUDDLE_HAVE_CUDA)
add_executable(
stream_test
tests/stream_test.cpp
include/stream_manager.hpp)
target_link_libraries(stream_test
PRIVATE HPX::hpx buffer_manager stream_manager)
target_compile_definitions(stream_test PRIVATE CPPUDDLE_HAVE_CUDA)
if (CPPUDDLE_WITH_KOKKOS)
add_executable(
allocator_kokkos_test
tests/allocator_kokkos_test.cpp
include/buffer_manager.hpp)
target_link_libraries(allocator_kokkos_test
PRIVATE Boost::boost Boost::program_options HPX::hpx Kokkos::kokkos HPXKokkos::hpx_kokkos buffer_manager)
target_compile_definitions(allocator_kokkos_test PRIVATE HPX_WITH_CUDA CPPUDDLE_HAVE_CUDA)
add_hpx_executable(
allocator_kokkos_executor_for_loop_test
DEPENDENCIES
HPX::hpx Kokkos::kokkos HPXKokkos::hpx_kokkos buffer_manager
SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/tests/allocator_kokkos_executor_for_loop_test.cpp)
# target_link_libraries(allocator_kokkos_executor_for_loop_test
# PRIVATE HPX::hpx Kokkos::kokkos HPXKokkos::hpx_kokkos buffer_manager)
target_compile_definitions(allocator_kokkos_executor_for_loop_test PRIVATE HPX_WITH_CUDA CPPUDDLE_HAVE_CUDA)
add_hpx_executable(
work_aggregation_test
DEPENDENCIES
Boost::boost Boost::program_options HPX::hpx Kokkos::kokkos HPXKokkos::hpx_kokkos buffer_manager stream_manager
COMPONENT_DEPENDENCIES iostreams
SOURCES
tests/work_aggregation_test.cpp
)
add_hpx_executable(
work_aggregation_cpu_triad
DEPENDENCIES
Boost::boost Boost::program_options HPX::hpx Kokkos::kokkos HPXKokkos::hpx_kokkos buffer_manager stream_manager
COMPONENT_DEPENDENCIES iostreams
SOURCES
tests/work_aggregation_cpu_triad.cpp
)
add_hpx_executable(
work_aggregation_cuda_triad
DEPENDENCIES
Boost::boost Boost::program_options HPX::hpx Kokkos::kokkos HPXKokkos::hpx_kokkos buffer_manager stream_manager
COMPONENT_DEPENDENCIES iostreams
SOURCES
tests/work_aggregation_cuda_triad.cpp
)
target_compile_definitions(work_aggregation_test PRIVATE CPPUDDLE_HAVE_CUDA)
endif() # end WITH KOKKOS
endif() # end with CUDA
endif() # end with HPX
if (CPPUDDLE_WITH_COUNTERS)
add_compile_definitions(CPPUDDLE_HAVE_COUNTERS)
endif()
if (CPPUDDLE_WITH_HPX)
add_compile_definitions(CPPUDDLE_WITH_HPX)
endif()
#------------------------------------------------------------------------------------------------------------
# Define actual tests (usually running the binary and checking its output for certain patterns via regex)
enable_testing()
# Basic functionality tests
add_test(allocator_test.run allocator_test --arraysize 5000000 --passes 200 --outputfile allocator_test.out)
set_tests_properties(allocator_test.run PROPERTIES
FIXTURES_SETUP allocator_test_output
)
if (CPPUDDLE_WITH_COUNTERS)
add_test(allocator_test.analyse_recycle_rate cat allocator_test.out)
set_tests_properties(allocator_test.analyse_recycle_rate PROPERTIES
FIXTURES_REQUIRED allocator_test_output
PASS_REGULAR_EXPRESSION "==> Recycle rate: [ ]* 99.5%"
)
add_test(allocator_test.analyse_marked_buffers_cleanup cat allocator_test.out)
set_tests_properties(allocator_test.analyse_marked_buffers_cleanup PROPERTIES
FIXTURES_REQUIRED allocator_test_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that were marked as used upon cleanup:[ ]* 0"
)
add_test(allocator_test.analyse_cleaned_buffers cat allocator_test.out)
set_tests_properties(allocator_test.analyse_cleaned_buffers PROPERTIES
FIXTURES_REQUIRED allocator_test_output
PASS_REGULAR_EXPRESSION "--> Number cleaned up buffers:[ ]* 1"
)
add_test(allocator_test.analyse_created_buffers cat allocator_test.out)
set_tests_properties(allocator_test.analyse_created_buffers PROPERTIES
FIXTURES_REQUIRED allocator_test_output
PASS_REGULAR_EXPRESSION "--> Number of times a new buffer had to be created for a request:[ ]* 1"
)
add_test(allocator_test.analyse_bad_allocs cat allocator_test.out)
set_tests_properties(allocator_test.analyse_bad_allocs PROPERTIES
FIXTURES_REQUIRED allocator_test_output
PASS_REGULAR_EXPRESSION "--> Number of bad_allocs that triggered garbage collection: [ ]* 0"
)
endif()
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug") # Performance tests only make sense with optimizations on
add_test(allocator_test.performance.analyse_aggressive_performance cat allocator_test.out)
set_tests_properties(allocator_test.performance.analyse_aggressive_performance PROPERTIES
FIXTURES_REQUIRED allocator_test_output
PASS_REGULAR_EXPRESSION "Test information: Aggressive recycler was faster than default allocator!"
)
endif()
add_test(allocator_test.fixture_cleanup ${CMAKE_COMMAND} -E remove allocator_test.out)
set_tests_properties(allocator_test.fixture_cleanup PROPERTIES
FIXTURES_CLEANUP allocator_test_output
)
# Valgrind test only works properly in non-HPX builds
# With HPX, we get errors straight from the HPX runtime.
# Non-HPX build is part of the github actions CI, the valgrind tests thus get done there
if (NOT (CPPUDDLE_WITH_HPX))
find_program(VALGRIND_COMMAND valgrind)
if (VALGRIND_COMMAND)
add_test(allocator_memcheck.valgrind
${VALGRIND_COMMAND} --trace-children=yes --leak-check=full --undef-value-errors=no --show-error-list=yes ./allocator_test --arraysize 5000000 --passes 200)
set_tests_properties(allocator_memcheck.valgrind PROPERTIES
PASS_REGULAR_EXPRESSION "ERROR SUMMARY: 0 errors from 0 contexts"
)
add_test(allocator_aligned_memcheck.valgrind
${VALGRIND_COMMAND} --trace-children=yes --leak-check=full --undef-value-errors=no --show-error-list=yes ./allocator_aligned_test --arraysize 5000000 --passes 200)
set_tests_properties(allocator_aligned_memcheck.valgrind PROPERTIES
PASS_REGULAR_EXPRESSION "ERROR SUMMARY: 0 errors from 0 contexts"
)
endif()
endif()
# Aligned alloc tests
add_test(allocator_aligned_test.run allocator_aligned_test --arraysize 5000000 --passes 200 --outputfile allocator_aligned_test.out)
set_tests_properties(allocator_aligned_test.run PROPERTIES
FIXTURES_SETUP allocator_aligned_test_output
)
if (CPPUDDLE_WITH_COUNTERS)
add_test(allocator_aligned_test.analyse_recycle_rate cat allocator_aligned_test.out)
set_tests_properties(allocator_aligned_test.analyse_recycle_rate PROPERTIES
FIXTURES_REQUIRED allocator_aligned_test_output
PASS_REGULAR_EXPRESSION "==> Recycle rate: [ ]* 99.5%"
)
add_test(allocator_aligned_test.analyse_marked_buffers_cleanup cat allocator_aligned_test.out)
set_tests_properties(allocator_aligned_test.analyse_marked_buffers_cleanup PROPERTIES
FIXTURES_REQUIRED allocator_aligned_test_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that were marked as used upon cleanup:[ ]* 0"
)
add_test(allocator_aligned_test.analyse_cleaned_buffers cat allocator_aligned_test.out)
set_tests_properties(allocator_aligned_test.analyse_cleaned_buffers PROPERTIES
FIXTURES_REQUIRED allocator_aligned_test_output
PASS_REGULAR_EXPRESSION "--> Number cleaned up buffers:[ ]* 1"
)
add_test(allocator_aligned_test.analyse_created_buffers cat allocator_aligned_test.out)
set_tests_properties(allocator_aligned_test.analyse_created_buffers PROPERTIES
FIXTURES_REQUIRED allocator_aligned_test_output
PASS_REGULAR_EXPRESSION "--> Number of times a new buffer had to be created for a request:[ ]* 1"
)
add_test(allocator_aligned_test.analyse_bad_allocs cat allocator_aligned_test.out)
set_tests_properties(allocator_aligned_test.analyse_bad_allocs PROPERTIES
FIXTURES_REQUIRED allocator_aligned_test_output
PASS_REGULAR_EXPRESSION "--> Number of bad_allocs that triggered garbage collection: [ ]* 0"
)
endif()
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug") # Performance tests only make sense with optimizations on
add_test(allocator_aligned_test.performance.analyse_aggressive_performance cat allocator_aligned_test.out)
set_tests_properties(allocator_aligned_test.performance.analyse_aggressive_performance PROPERTIES
FIXTURES_REQUIRED allocator_aligned_test_output
PASS_REGULAR_EXPRESSION "Test information: Aggressive recycler was faster than default allocator!"
)
endif()
add_test(allocator_aligned_test.fixture_cleanup ${CMAKE_COMMAND} -E remove allocator_aligned_test.out)
set_tests_properties(allocator_aligned_test.fixture_cleanup PROPERTIES
FIXTURES_CLEANUP allocator_aligned_test_output
)
if (CPPUDDLE_WITH_HPX)
# Concurrency tests
add_test(allocator_concurrency_test.run allocator_hpx_test --hpx:threads=4 --passes 200 --futures=4 --outputfile allocator_concurrency_test.out)
set_tests_properties(allocator_concurrency_test.run PROPERTIES
FIXTURES_SETUP allocator_concurrency_output
PROCESSORS 4
)
if (CPPUDDLE_WITH_COUNTERS)
add_test(allocator_concurrency_test.analyse_recycle_rate cat allocator_concurrency_test.out)
set_tests_properties(allocator_concurrency_test.analyse_recycle_rate PROPERTIES
FIXTURES_REQUIRED allocator_concurrency_output
PASS_REGULAR_EXPRESSION "==> Recycle rate: [ ]* 99.*%"
)
add_test(allocator_concurrency_test.analyse_marked_buffers_cleanup cat allocator_concurrency_test.out)
set_tests_properties(allocator_concurrency_test.analyse_marked_buffers_cleanup PROPERTIES
FIXTURES_REQUIRED allocator_concurrency_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that were marked as used upon cleanup:[ ]* 0"
)
add_test(allocator_concurrency_test.analyse_cleaned_buffers cat allocator_concurrency_test.out)
set_tests_properties(allocator_concurrency_test.analyse_cleaned_buffers PROPERTIES
FIXTURES_REQUIRED allocator_concurrency_output
PASS_REGULAR_EXPRESSION "--> Number cleaned up buffers:[ ]* 4"
)
add_test(allocator_concurrency_test.analyse_created_buffers cat allocator_concurrency_test.out)
set_tests_properties(allocator_concurrency_test.analyse_created_buffers PROPERTIES
FIXTURES_REQUIRED allocator_concurrency_output
PASS_REGULAR_EXPRESSION "--> Number of times a new buffer had to be created for a request:[ ]* 4"
)
add_test(allocator_concurrency_test.analyse_bad_allocs cat allocator_concurrency_test.out)
set_tests_properties(allocator_concurrency_test.analyse_bad_allocs PROPERTIES
FIXTURES_REQUIRED allocator_concurrency_output
PASS_REGULAR_EXPRESSION "--> Number of bad_allocs that triggered garbage collection: [ ]* 0"
)
add_test(allocator_concurrency_test.analyse_bad_hints cat allocator_concurrency_test.out)
set_tests_properties(allocator_concurrency_test.analyse_bad_allocs PROPERTIES
FIXTURES_REQUIRED allocator_concurrency_output
PASS_REGULAR_EXPRESSION "--> Number wrong deallocation hints: [ ]* 0"
)
endif()
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug") # Performance tests only make sense with optimizations on
add_test(allocator_concurrency_test.performance.analyse_aggressive_performance cat allocator_concurrency_test.out)
set_tests_properties(allocator_concurrency_test.performance.analyse_aggressive_performance PROPERTIES
FIXTURES_REQUIRED allocator_concurrency_output
PASS_REGULAR_EXPRESSION "Test information: Aggressive recycler was faster than default allocator!"
)
endif()
add_test(allocator_concurrency_test.fixture_cleanup ${CMAKE_COMMAND} -E remove allocator_concurrency_test.out)
set_tests_properties(allocator_concurrency_test.fixture_cleanup PROPERTIES
FIXTURES_CLEANUP allocator_concurrency_output
)
# GPU related tests
if (CPPUDDLE_WITH_CUDA)
add_test(allocator_cuda_test.run allocator_cuda_test --hpx:threads=4)
set_tests_properties(allocator_cuda_test.run PROPERTIES
PROCESSORS 4
)
add_test(stream_test.run stream_test --hpx:threads=4)
set_tests_properties(stream_test.run PROPERTIES
PROCESSORS 4
)
if (CPPUDDLE_WITH_KOKKOS)
add_test(allocator_kokkos_test.run allocator_kokkos_test --outputfile allocator_kokkos_test.out)
set_tests_properties(allocator_kokkos_test.run PROPERTIES
FIXTURES_SETUP allocator_kokkos_output
)
add_test(allocator_kokkos_test.analyse_recycle_rate cat allocator_kokkos_test.out)
set_tests_properties(allocator_kokkos_test.analyse_recycle_rate PROPERTIES
FIXTURES_REQUIRED allocator_kokkos_output
PASS_REGULAR_EXPRESSION "==> Recycle rate: [ ]* 99%"
)
add_test(allocator_kokkos_test.analyse_marked_buffers_cleanup cat allocator_kokkos_test.out)
set_tests_properties(allocator_kokkos_test.analyse_marked_buffers_cleanup PROPERTIES
FIXTURES_REQUIRED allocator_kokkos_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that were marked as used upon cleanup:[ ]* 0"
)
add_test(allocator_kokkos_test.analyse_cleaned_buffers cat allocator_kokkos_test.out)
set_tests_properties(allocator_kokkos_test.analyse_cleaned_buffers PROPERTIES
FIXTURES_REQUIRED allocator_kokkos_output
PASS_REGULAR_EXPRESSION "--> Number cleaned up buffers:[ ]* 3"
)
add_test(allocator_kokkos_test.analyse_created_buffers cat allocator_kokkos_test.out)
set_tests_properties(allocator_kokkos_test.analyse_created_buffers PROPERTIES
FIXTURES_REQUIRED allocator_kokkos_output
PASS_REGULAR_EXPRESSION "--> Number of times a new buffer had to be created for a request:[ ]* 3"
)
add_test(allocator_kokkos_test.analyse_bad_allocs cat allocator_kokkos_test.out)
set_tests_properties(allocator_kokkos_test.analyse_bad_allocs PROPERTIES
FIXTURES_REQUIRED allocator_kokkos_output
PASS_REGULAR_EXPRESSION "--> Number of bad_allocs that triggered garbage collection: [ ]* 0"
)
add_test(allocator_kokkos_executor_for_loop_test.run allocator_kokkos_executor_for_loop_test --hpx:threads=4)
set_tests_properties(allocator_kokkos_executor_for_loop_test.run PROPERTIES
PROCESSORS 4
)
add_test(aggregation_basic_sequential_test.run work_aggregation_test --hpx:threads=1 --outputfile=aggregation_basic_sequential_test.out --scenario=sequential_test)
set_tests_properties(aggregation_basic_sequential_test.run PROPERTIES
FIXTURES_SETUP aggregation_basic_sequential_test_output
)
add_test(aggregation_basic_sequential_test.analyse_int_buffers cat aggregation_basic_sequential_test.out)
set_tests_properties(aggregation_basic_sequential_test.analyse_int_buffers PROPERTIES
FIXTURES_REQUIRED aggregation_basic_sequential_test_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that got requested from this manager: [ ]* 2"
)
add_test(aggregation_basic_sequential_test.analyse_float_buffers cat aggregation_basic_sequential_test.out)
set_tests_properties(aggregation_basic_sequential_test.analyse_float_buffers PROPERTIES
FIXTURES_REQUIRED aggregation_basic_sequential_test_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that got requested from this manager: [ ]* 6"
)
add_test(aggregation_basic_sequential_test.analyse_cleanup cat aggregation_basic_sequential_test.out)
set_tests_properties(aggregation_basic_sequential_test.analyse_cleanup PROPERTIES
FIXTURES_REQUIRED aggregation_basic_sequential_test_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that were marked as used upon cleanup: [ ]* 0"
)
add_test(aggregation_basic_parallel_test.run work_aggregation_test --hpx:threads=4 --outputfile=aggregation_basic_parallel_test.out --scenario=sequential_test)
set_tests_properties(aggregation_basic_parallel_test.run PROPERTIES
FIXTURES_SETUP aggregation_basic_parallel_test_output
PROCESSORS 4
)
add_test(aggregation_basic_parallel_test.analyse_int_buffers cat aggregation_basic_parallel_test.out)
set_tests_properties(aggregation_basic_parallel_test.analyse_int_buffers PROPERTIES
FIXTURES_REQUIRED aggregation_basic_parallel_test_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that got requested from this manager: [ ]* 2"
)
add_test(aggregation_basic_parallel_test.analyse_float_buffers cat aggregation_basic_parallel_test.out)
set_tests_properties(aggregation_basic_parallel_test.analyse_float_buffers PROPERTIES
FIXTURES_REQUIRED aggregation_basic_parallel_test_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that got requested from this manager: [ ]* 6"
)
add_test(aggregation_basic_parallel_test.analyse_cleanup cat aggregation_basic_parallel_test.out)
set_tests_properties(aggregation_basic_parallel_test.analyse_cleanup PROPERTIES
FIXTURES_REQUIRED aggregation_basic_parallel_test_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that were marked as used upon cleanup: [ ]* 0"
)
add_test(aggregation_basic_parallel_test.analyse_cleanup cat aggregation_basic_parallel_test.out)
set_tests_properties(aggregation_basic_parallel_test.analyse_cleanup PROPERTIES
FIXTURES_REQUIRED aggregation_basic_parallel_test_output
PASS_REGULAR_EXPRESSION "--> Number wrong deallocation hints: [ ]* 0"
)
add_test(aggregation_interruption_test.run work_aggregation_test --hpx:threads=1 --outputfile=aggregation_interruption_test.out --scenario=interruption_test)
set_tests_properties(aggregation_interruption_test.run PROPERTIES
FIXTURES_SETUP aggregation_interruption_test_output
)
add_test(aggregation_interruption_test.analyse_continuation_output cat aggregation_interruption_test.out)
set_tests_properties(aggregation_interruption_test.analyse_continuation_output PROPERTIES
FIXTURES_REQUIRED aggregation_interruption_test_output
PASS_REGULAR_EXPRESSION "Got executor 1"
)
add_test(aggregation_interruption_test.analyse_kernel_output cat aggregation_interruption_test.out)
set_tests_properties(aggregation_interruption_test.analyse_kernel_output PROPERTIES
FIXTURES_REQUIRED aggregation_interruption_test_output
PASS_REGULAR_EXPRESSION "d is 2"
)
add_test(aggregation_failure_test.run work_aggregation_test --hpx:threads=1 --outputfile=aggregation_failure_test.out --scenario=failure_test)
set_tests_properties(aggregation_failure_test.run PROPERTIES
FIXTURES_SETUP aggregation_failure_test_output
)
add_test(aggregation_failure_test.analyse_value_error cat aggregation_failure_test.out)
set_tests_properties(aggregation_failure_test.analyse_value_error PROPERTIES
FIXTURES_REQUIRED aggregation_failure_test_output
PASS_REGULAR_EXPRESSION "Mismatched values error in aggregated post call of executor"
)
add_test(aggregation_failure_test.analyse_type_error cat aggregation_failure_test.out)
set_tests_properties(aggregation_failure_test.analyse_type_error PROPERTIES
FIXTURES_REQUIRED aggregation_failure_test_output
PASS_REGULAR_EXPRESSION "Mismatched types error in aggregated post call of executor"
)
add_test(aggregation_add_pointer_test.run work_aggregation_test --hpx:threads=4 --outputfile=aggregation_add_pointer_test.out --scenario=pointer_add_test)
set_tests_properties(aggregation_add_pointer_test.run PROPERTIES
FIXTURES_SETUP aggregation_add_pointer_test_output
PROCESSORS 4
)
add_test(aggregation_add_pointer_test.analyse_number_launches cat aggregation_add_pointer_test.out)
set_tests_properties(aggregation_add_pointer_test.analyse_number_launches PROPERTIES
FIXTURES_REQUIRED aggregation_add_pointer_test_output
PASS_REGULAR_EXPRESSION "Number add_pointer_launches=2"
)
add_test(aggregation_add_pointer_test.analyse_number_buffers cat aggregation_add_pointer_test.out)
set_tests_properties(aggregation_add_pointer_test.analyse_number_buffers PROPERTIES
FIXTURES_REQUIRED aggregation_add_pointer_test_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that got requested from this manager: [ ]* 6"
)
add_test(aggregation_add_references_test_sequential.run work_aggregation_test --hpx:threads=1 --outputfile=aggregation_add_references_test_sequential.out --scenario=references_add_test)
set_tests_properties(aggregation_add_references_test_sequential.run PROPERTIES
FIXTURES_SETUP aggregation_add_references_test_sequential_output
PROCESSORS 1
)
add_test(aggregation_add_references_test_sequential.analyse_number_launches cat aggregation_add_references_test_sequential.out)
set_tests_properties(aggregation_add_references_test_sequential.analyse_number_launches PROPERTIES
FIXTURES_REQUIRED aggregation_add_references_test_sequential_output
PASS_REGULAR_EXPRESSION "Number add_launches=1"
)
add_test(aggregation_add_references_test_sequential.analyse_number_buffers cat aggregation_add_references_test_sequential.out)
set_tests_properties(aggregation_add_references_test_sequential.analyse_number_buffers PROPERTIES
FIXTURES_REQUIRED aggregation_add_references_test_sequential_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that got requested from this manager: [ ]* 3"
)
add_test(aggregation_add_references_test.run work_aggregation_test --hpx:threads=4 --outputfile=aggregation_add_references_test.out --scenario=references_add_test)
set_tests_properties(aggregation_add_references_test.run PROPERTIES
FIXTURES_SETUP aggregation_add_references_test_output
PROCESSORS 4
)
add_test(aggregation_add_references_test.analyse_number_launches cat aggregation_add_references_test.out)
set_tests_properties(aggregation_add_references_test.analyse_number_launches PROPERTIES
FIXTURES_REQUIRED aggregation_add_references_test_output
PASS_REGULAR_EXPRESSION "Number add_launches=1"
)
add_test(aggregation_add_references_test.analyse_number_buffers cat aggregation_add_references_test.out)
set_tests_properties(aggregation_add_references_test.analyse_number_buffers PROPERTIES
FIXTURES_REQUIRED aggregation_add_references_test_output
PASS_REGULAR_EXPRESSION "--> Number of buffers that got requested from this manager: [ ]* 3"
)
# STREAM TESTS CPU
# set to larger value for Jenkins checks?
set(deadlock_check_repetitions ${CPPUDDLE_WITH_DEADLOCK_TEST_REPETITONS})
#set(deadlock_check_repetitions "100000")
message(STATUS "Deadlock check repetitions set to ${deadlock_check_repetitions}")
# Try with few slices -- good to detect deadlocking on errors with the continuations
add_test(aggregation_stream_triad_cpu_eager_test1.run work_aggregation_cpu_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=2048 --problem_size=25600 --kernel_size=256 --max_slices=2 --repetitions=${deadlock_check_repetitions} --executor_type=EAGER --outputfile=aggregation_stream_triad_cpu_eager_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_eager_test1.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cpu_eager_test_output1
PROCESSORS 4
TIMEOUT 600
)
add_test(aggregation_stream_triad_cpu_eager_test1.check_errors cat aggregation_stream_triad_cpu_eager_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_eager_test1.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_eager_test_output1
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cpu_eager_test1.check_success cat aggregation_stream_triad_cpu_eager_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_eager_test1.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_eager_test_output1
PASS_REGULAR_EXPRESSION "SUCCESS"
)
# Try with odd number of slices
# This would deadlock given the STRICT executor, the EAGER one should have no problem
add_test(aggregation_stream_triad_cpu_eager_test2.run work_aggregation_cpu_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=2048 --problem_size=25600 --kernel_size=256 --max_slices=17 --repetitions=${deadlock_check_repetitions} --executor_type=EAGER --outputfile=aggregation_stream_triad_cpu_eager_test2.out)
set_tests_properties(aggregation_stream_triad_cpu_eager_test2.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cpu_eager_test_output2
PROCESSORS 4
TIMEOUT 600
)
add_test(aggregation_stream_triad_cpu_eager_test2.check_errors cat aggregation_stream_triad_cpu_eager_test2.out)
set_tests_properties(aggregation_stream_triad_cpu_eager_test2.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_eager_test_output2
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cpu_eager_test2.check_success cat aggregation_stream_triad_cpu_eager_test2.out)
set_tests_properties(aggregation_stream_triad_cpu_eager_test2.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_eager_test_output2
PASS_REGULAR_EXPRESSION "SUCCESS"
)
# Try with large number of slices -- this is basically what should be used in production, hence it should be tested
add_test(aggregation_stream_triad_cpu_eager_test3.run work_aggregation_cpu_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=2048 --problem_size=25600 --kernel_size=256 --max_slices=100 --repetitions=${deadlock_check_repetitions} --executor_type=EAGER --outputfile=aggregation_stream_triad_cpu_eager_test3.out)
set_tests_properties(aggregation_stream_triad_cpu_eager_test3.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cpu_eager_test_output3
PROCESSORS 4
TIMEOUT 600
)
add_test(aggregation_stream_triad_cpu_eager_test3.check_errors cat aggregation_stream_triad_cpu_eager_test3.out)
set_tests_properties(aggregation_stream_triad_cpu_eager_test3.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_eager_test_output3
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cpu_eager_test3.check_success cat aggregation_stream_triad_cpu_eager_test3.out)
set_tests_properties(aggregation_stream_triad_cpu_eager_test3.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_eager_test_output3
PASS_REGULAR_EXPRESSION "SUCCESS"
)
# Basic test for the ENDLESS executor -- number slices should not matter here, hence the large value for it
add_test(aggregation_stream_triad_cpu_endless_test1.run work_aggregation_cpu_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=2048 --problem_size=25600 --kernel_size=256 --max_slices=99999999 --repetitions=${deadlock_check_repetitions} --executor_type=ENDLESS --outputfile=aggregation_stream_triad_cpu_endless_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_endless_test1.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cpu_endless_test_output1
PROCESSORS 4
TIMEOUT 600
)
add_test(aggregation_stream_triad_cpu_endless_test1.check_errors cat aggregation_stream_triad_cpu_endless_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_endless_test1.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_endless_test_output1
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cpu_endless_test1.check_success cat aggregation_stream_triad_cpu_endless_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_endless_test1.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_endless_test_output1
PASS_REGULAR_EXPRESSION "SUCCESS"
)
# Basic test for the STRICT executor
add_test(aggregation_stream_triad_cpu_strict_test1.run work_aggregation_cpu_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=2048 --problem_size=25600 --kernel_size=256 --max_slices=100 --repetitions=${deadlock_check_repetitions} --executor_type=STRICT --outputfile=aggregation_stream_triad_cpu_strict_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_test1.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cpu_strict_test_output1
PROCESSORS 4
TIMEOUT 600
)
add_test(aggregation_stream_triad_cpu_strict_test1.check_errors cat aggregation_stream_triad_cpu_strict_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_test1.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_strict_test_output1
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cpu_strict_test1.check_success cat aggregation_stream_triad_cpu_strict_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_test1.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_strict_test_output1
PASS_REGULAR_EXPRESSION "SUCCESS"
)
# STRICT number of kernel launches should always be same -- hence we can check the aggregation working correctly here -- here it should be exactly 200 (no aggregation happening)
add_test(aggregation_stream_triad_cpu_strict_aggregation_test1.run work_aggregation_cpu_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=2048 --problem_size=25600 --kernel_size=256 --max_slices=1 --repetitions=2 --executor_type=STRICT --outputfile=aggregation_stream_triad_cpu_strict_aggregation_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test1.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cpu_strict_aggregation_test_output1
PROCESSORS 4
TIMEOUT 90
)
add_test(aggregation_stream_triad_cpu_strict_aggregation_test1.check_errors cat aggregation_stream_triad_cpu_strict_aggregation_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test1.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_strict_aggregation_test_output1
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cpu_strict_aggregation_test1.check_success cat aggregation_stream_triad_cpu_strict_aggregation_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test1.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_strict_aggregation_test_output1
PASS_REGULAR_EXPRESSION "SUCCESS"
)
add_test(aggregation_stream_triad_cpu_strict_aggregation_test1.check_launch_counter cat aggregation_stream_triad_cpu_strict_aggregation_test1.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test1.check_launch_counter PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_strict_aggregation_test_output1
PASS_REGULAR_EXPRESSION "Kernel launch counter: 200"
)
# STRICT number of kernel launches should always be same -- hence we can check the aggregation working correctly here -- here it should be exactly 30
add_test(aggregation_stream_triad_cpu_strict_aggregation_test2.run work_aggregation_cpu_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=2048 --problem_size=25600 --kernel_size=256 --max_slices=10 --repetitions=3 --executor_type=STRICT --outputfile=aggregation_stream_triad_cpu_strict_aggregation_test2.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test2.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cpu_strict_aggregation_test_output2
PROCESSORS 4
TIMEOUT 90
)
add_test(aggregation_stream_triad_cpu_strict_aggregation_test2.check_errors cat aggregation_stream_triad_cpu_strict_aggregation_test2.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test2.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_strict_aggregation_test_output2
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cpu_strict_aggregation_test2.check_success cat aggregation_stream_triad_cpu_strict_aggregation_test2.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test2.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_strict_aggregation_test_output2
PASS_REGULAR_EXPRESSION "SUCCESS"
)
add_test(aggregation_stream_triad_cpu_strict_aggregation_test2.check_launch_counter cat aggregation_stream_triad_cpu_strict_aggregation_test2.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test2.check_launch_counter PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_strict_aggregation_test_output2
PASS_REGULAR_EXPRESSION "Kernel launch counter: 30"
)
# STRICT number of kernel launches should always be same -- hence we can check the aggregation working correctly here -- here it should be exactly 1
add_test(aggregation_stream_triad_cpu_strict_aggregation_test3.run work_aggregation_cpu_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=2048 --problem_size=25600 --kernel_size=256 --max_slices=100 --repetitions=1 --executor_type=STRICT --outputfile=aggregation_stream_triad_cpu_strict_aggregation_test3.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test3.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cpu_strict_aggregation_test_output3
PROCESSORS 4
TIMEOUT 90
)
add_test(aggregation_stream_triad_cpu_strict_aggregation_test3.check_errors cat aggregation_stream_triad_cpu_strict_aggregation_test3.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test3.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_strict_aggregation_test_output3
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cpu_strict_aggregation_test3.check_success cat aggregation_stream_triad_cpu_strict_aggregation_test3.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test3.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_strict_aggregation_test_output3
PASS_REGULAR_EXPRESSION "SUCCESS"
)
add_test(aggregation_stream_triad_cpu_strict_aggregation_test3.check_launch_counter cat aggregation_stream_triad_cpu_strict_aggregation_test3.out)
set_tests_properties(aggregation_stream_triad_cpu_strict_aggregation_test3.check_launch_counter PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cpu_strict_aggregation_test_output3
PASS_REGULAR_EXPRESSION "Kernel launch counter: 1"
)
# STREAM TESTS CUDA
# Try with few slices -- good to detect deadlocking on errors with the continuations
add_test(aggregation_stream_triad_cuda_eager_test1.run work_aggregation_cuda_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=4 --problem_size=102400 --kernel_size=1024 --max_slices=2 --repetitions=${deadlock_check_repetitions} --executor_type=EAGER --outputfile=aggregation_stream_triad_cuda_eager_test1.out)
set_tests_properties(aggregation_stream_triad_cuda_eager_test1.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cuda_eager_test_output1
PROCESSORS 4
TIMEOUT 1200
)
add_test(aggregation_stream_triad_cuda_eager_test1.check_errors cat aggregation_stream_triad_cuda_eager_test1.out)
set_tests_properties(aggregation_stream_triad_cuda_eager_test1.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cuda_eager_test_output1
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cuda_eager_test1.check_success cat aggregation_stream_triad_cuda_eager_test1.out)
set_tests_properties(aggregation_stream_triad_cuda_eager_test1.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cuda_eager_test_output1
PASS_REGULAR_EXPRESSION "SUCCESS"
)
# Try with odd number of slices
# This would deadlock given the STRICT executor, the EAGER one should have no problem
add_test(aggregation_stream_triad_cuda_eager_test2.run work_aggregation_cuda_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=4 --problem_size=102400 --kernel_size=1024 --max_slices=17 --repetitions=${deadlock_check_repetitions} --executor_type=EAGER --outputfile=aggregation_stream_triad_cuda_eager_test2.out)
set_tests_properties(aggregation_stream_triad_cuda_eager_test2.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cuda_eager_test_output2
PROCESSORS 4
TIMEOUT 1200
)
add_test(aggregation_stream_triad_cuda_eager_test2.check_errors cat aggregation_stream_triad_cuda_eager_test2.out)
set_tests_properties(aggregation_stream_triad_cuda_eager_test2.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cuda_eager_test_output2
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cuda_eager_test2.check_success cat aggregation_stream_triad_cuda_eager_test2.out)
set_tests_properties(aggregation_stream_triad_cuda_eager_test2.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cuda_eager_test_output2
PASS_REGULAR_EXPRESSION "SUCCESS"
)
# Try with large number of slices -- this is basically what should be used in production, hence it should be tested
add_test(aggregation_stream_triad_cuda_eager_test3.run work_aggregation_cuda_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=4 --problem_size=102400 --kernel_size=1024 --max_slices=100 --repetitions=${deadlock_check_repetitions} --executor_type=EAGER --outputfile=aggregation_stream_triad_cuda_eager_test3.out)
set_tests_properties(aggregation_stream_triad_cuda_eager_test3.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cuda_eager_test_output3
PROCESSORS 4
TIMEOUT 1200
)
add_test(aggregation_stream_triad_cuda_eager_test3.check_errors cat aggregation_stream_triad_cuda_eager_test3.out)
set_tests_properties(aggregation_stream_triad_cuda_eager_test3.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cuda_eager_test_output3
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cuda_eager_test3.check_success cat aggregation_stream_triad_cuda_eager_test3.out)
set_tests_properties(aggregation_stream_triad_cuda_eager_test3.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cuda_eager_test_output3
PASS_REGULAR_EXPRESSION "SUCCESS"
)
# Basic test for the ENDLESS executor -- number slices should not matter here, hence the large value for it
add_test(aggregation_stream_triad_cuda_endless_test1.run work_aggregation_cuda_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=4 --problem_size=102400 --kernel_size=1024 --max_slices=99999999 --repetitions=${deadlock_check_repetitions} --executor_type=ENDLESS --outputfile=aggregation_stream_triad_cuda_endless_test1.out)
set_tests_properties(aggregation_stream_triad_cuda_endless_test1.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cuda_endless_test_output1
PROCESSORS 4
TIMEOUT 1200
)
add_test(aggregation_stream_triad_cuda_endless_test1.check_errors cat aggregation_stream_triad_cuda_endless_test1.out)
set_tests_properties(aggregation_stream_triad_cuda_endless_test1.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cuda_endless_test_output1
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cuda_endless_test1.check_success cat aggregation_stream_triad_cuda_endless_test1.out)
set_tests_properties(aggregation_stream_triad_cuda_endless_test1.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cuda_endless_test_output1
PASS_REGULAR_EXPRESSION "SUCCESS"
)
# Basic test for the STRICT executor
add_test(aggregation_stream_triad_cuda_strict_test1.run work_aggregation_cuda_triad --hpx:threads=4 --number_aggregation_executors=1 --number_underlying_executors=4 --problem_size=102400 --kernel_size=1024 --max_slices=100 --repetitions=${deadlock_check_repetitions} --executor_type=STRICT --outputfile=aggregation_stream_triad_cuda_strict_test1.out)
set_tests_properties(aggregation_stream_triad_cuda_strict_test1.run PROPERTIES
FIXTURES_SETUP aggregation_stream_triad_cuda_strict_test_output1
PROCESSORS 4
TIMEOUT 1200
)
add_test(aggregation_stream_triad_cuda_strict_test1.check_errors cat aggregation_stream_triad_cuda_strict_test1.out)
set_tests_properties(aggregation_stream_triad_cuda_strict_test1.check_errors PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cuda_strict_test_output1
FAIL_REGULAR_EXPRESSION "ERROR"
)
add_test(aggregation_stream_triad_cuda_strict_test1.check_success cat aggregation_stream_triad_cuda_strict_test1.out)
set_tests_properties(aggregation_stream_triad_cuda_strict_test1.check_success PROPERTIES
FIXTURES_REQUIRED aggregation_stream_triad_cuda_strict_test_output1
PASS_REGULAR_EXPRESSION "SUCCESS"
)