@@ -8,11 +8,11 @@ set_property ( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYP
8
8
9
9
# Add option and check environment to determine if developer tests should be run
10
10
if ($ENV{OPENCOARRAYS_DEVELOPER} )
11
- option (RUN_DEVELOPER_TESTS "Run tests intended only for developers" ON )
11
+ option (CAF_RUN_DEVELOPER_TESTS "Run tests intended only for developers" ON )
12
12
else ()
13
- option (RUN_DEVELOPER_TESTS "Run tests intended only for developers" OFF )
13
+ option (CAF_RUN_DEVELOPER_TESTS "Run tests intended only for developers" OFF )
14
14
endif ()
15
- mark_as_advanced (RUN_DEVELOPER_TESTS )
15
+ mark_as_advanced (CAF_RUN_DEVELOPER_TESTS )
16
16
17
17
if ( NOT DEFINED ENV{OPENCOARRAYS_DEVELOPER} )
18
18
set ( ENV{OPENCOARRAYS_DEVELOPER} FALSE )
@@ -387,7 +387,7 @@ include(GNUInstallDirs)
387
387
#-------------------------------
388
388
# Recurse into the src directory
389
389
#-------------------------------
390
- include_directories (${CMAKE_CURRENT_SOURCE_DIR} /src )
390
+ include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR} /src )
391
391
392
392
add_subdirectory (src )
393
393
@@ -465,6 +465,24 @@ function(add_mpi_test name num_mpi_proc path)
465
465
set_property (TEST ${name} PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
466
466
endfunction (add_mpi_test )
467
467
468
+ function (add_fault_tolerant_mpi_test name num_mpi_proc path )
469
+ if ( ((N LESS num_mpi_proc ) OR (N EQUAL 0 )) )
470
+ message (STATUS "Test ${name} is oversubscribed: ${num_mpi_proc} ranks requested with ${N} system processor available." )
471
+ if ( openmpi )
472
+ if ( N LESS 2 )
473
+ set ( num_mpi_proc 2 )
474
+ set (test_parameters --oversubscribe )
475
+ else ()
476
+ set ( num_mpi_proc ${N} )
477
+ endif ()
478
+ message ( STATUS "Open-MPI detected, over-riding oversubscribed test, ${name} , with ${num_mpi_proc} ranks." )
479
+ endif ()
480
+ endif ()
481
+ set (test_parameters ${test_parameters} ${MPIEXEC_NUMPROC_FLAG} ${num_mpi_proc} -disable-auto-cleanup )
482
+ add_test (NAME ${name} COMMAND ${MPIEXEC} ${test_parameters} "${path} " )
483
+ set_property (TEST ${name} PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
484
+ endfunction (add_fault_tolerant_mpi_test )
485
+
468
486
set (tests_root ${CMAKE_CURRENT_BINARY_DIR} /src/tests )
469
487
470
488
@@ -480,7 +498,7 @@ if(opencoarrays_aware_compiler)
480
498
add_mpi_test (register_alloc_comp_1 2 ${tests_root} /unit/init_register/register_alloc_comp_1 )
481
499
add_mpi_test (register_alloc_comp_2 2 ${tests_root} /unit/init_register/register_alloc_comp_2 )
482
500
add_mpi_test (register_alloc_comp_3 2 ${tests_root} /unit/init_register/register_alloc_comp_3 )
483
- if (RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER} )
501
+ if (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER} )
484
502
message ( STATUS "Running Developer tests is enabled." )
485
503
add_mpi_test (async_comp_alloc 6 ${tests_root} /unit/init_register/async_comp_alloc )
486
504
# Timeout async_comp_alloc test after 3 seconds to progess past the known failure
@@ -523,16 +541,34 @@ if(opencoarrays_aware_compiler)
523
541
# GFortran PR 78505 only fixed on trunk/gcc 7
524
542
add_mpi_test (source -alloc-no-sync 8 ${tests_root} /regression/reported/source-alloc-sync )
525
543
endif ()
526
- if (RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER} )
544
+ if (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER} )
527
545
add_mpi_test (convert-before-put 3 ${tests_root} /regression/reported/convert-before-put )
528
546
endif ()
529
547
add_mpi_test (event-post 3 ${tests_root} /regression/reported/event-post )
530
548
add_mpi_test (co_reduce-factorial 4 ${tests_root} /regression/reported/co_reduce-factorial )
531
549
add_mpi_test (co_reduce-factorial-int8 4 ${tests_root} /regression/reported/co_reduce-factorial-int8 )
532
550
add_mpi_test (co_reduce-factorial-int64 4 ${tests_root} /regression/reported/co_reduce-factorial-int64 )
533
551
add_mpi_test (co_reduce_string 4 ${tests_root} /unit/collectives/co_reduce_string )
534
- # remove this before merging into master
535
- # set_property(TEST co_reduce-factorial PROPERTY WILL_FAIL TRUE)
552
+
553
+ # IMAGE FAIL tests
554
+ if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7 )
555
+ add_mpi_test (image_status_test_1 4 ${tests_root} /unit/fail_images/image_status_test_1 )
556
+ if (CAF_ENABLE_FAILED_IMAGES )
557
+ # No other way to check that image_fail_test_1 passes.
558
+ add_fault_tolerant_mpi_test (image_fail_test_1 4 ${tests_root} /unit/fail_images/image_fail_test_1 )
559
+ set_property (TEST image_fail_test_1 PROPERTY FAIL_REGULAR_EXPRESSION "Test failed" )
560
+ set_property (TEST image_fail_test_1 PROPERTY PASS_REGULAR_EXPRESSION "Test passed" )
561
+ add_fault_tolerant_mpi_test (image_fail_and_sync_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_sync_test_1 )
562
+ if (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER} )
563
+ add_fault_tolerant_mpi_test (image_fail_and_sync_test_2 4 ${tests_root} /unit/fail_images/image_fail_and_sync_test_2 )
564
+ endif ()
565
+ add_fault_tolerant_mpi_test (image_fail_and_sync_test_3 4 ${tests_root} /unit/fail_images/image_fail_and_sync_test_3 )
566
+ add_fault_tolerant_mpi_test (image_fail_and_status_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_status_test_1 )
567
+ add_fault_tolerant_mpi_test (image_fail_and_failed_images_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_failed_images_test_1 )
568
+ add_fault_tolerant_mpi_test (image_fail_and_stopped_images_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_stopped_images_test_1 )
569
+ add_fault_tolerant_mpi_test (image_fail_and_get_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_get_test_1 )
570
+ endif ()
571
+ endif ()
536
572
else ()
537
573
add_test (co_sum_extension ${tests_root} /unit/extensions/test-co_sum-extension.sh )
538
574
set_property (TEST co_sum_extension PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
0 commit comments