2023-06-27 10:43:04 +02:00
|
|
|
# Copyright (c) 2022-2023 Barcelona Supercomputing Center (BSC)
|
2022-09-19 12:39:02 +02:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-12-15 10:56:31 +01:00
|
|
|
find_package(Nanos6)
|
2023-05-31 19:16:18 +02:00
|
|
|
include(CheckOmpSs2Compiler)
|
2023-12-15 10:56:31 +01:00
|
|
|
|
2023-05-31 19:16:18 +02:00
|
|
|
if(NOT OMPSS2_COMPILER_FOUND)
|
2023-05-30 18:16:08 +02:00
|
|
|
if(ENABLE_ALL_TESTS)
|
|
|
|
message(FATAL_ERROR "Compiler doesn't support -fompss-2 flag, cannot enable Nanos6 RT tests")
|
|
|
|
else()
|
|
|
|
message(STATUS "Compiler doesn't support -fompss-2 flag, disabling Nanos6 RT tests")
|
|
|
|
endif()
|
2022-09-29 12:41:59 +02:00
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2022-10-04 19:54:55 +02:00
|
|
|
if(NOT NANOS6_FOUND)
|
2023-05-30 18:16:08 +02:00
|
|
|
if(ENABLE_ALL_TESTS)
|
|
|
|
message(FATAL_ERROR "Nanos6 not found, cannot enable Nanos6 RT tests")
|
|
|
|
else()
|
|
|
|
message(STATUS "Nanos6 not found, disabling Nanos6 RT tests")
|
|
|
|
endif()
|
2022-09-29 12:41:59 +02:00
|
|
|
return()
|
|
|
|
else()
|
|
|
|
message(STATUS "Enabling Nanos6 RT tests")
|
|
|
|
endif()
|
|
|
|
|
2022-08-25 18:56:55 +02:00
|
|
|
function(nanos6_rt_test)
|
2022-09-27 15:41:43 +02:00
|
|
|
set(switches "")
|
|
|
|
set(single LEVEL)
|
|
|
|
set(multi "")
|
|
|
|
cmake_parse_arguments(
|
|
|
|
NANOS6_TEST "${switches}" "${single}" "${multi}" ${ARGN})
|
2022-08-25 18:56:55 +02:00
|
|
|
ovni_test(${ARGN})
|
2023-05-31 19:16:18 +02:00
|
|
|
target_compile_options("${OVNI_TEST_NAME}" PUBLIC "-fompss-2=libnanos6")
|
|
|
|
target_link_options("${OVNI_TEST_NAME}" PUBLIC "-fompss-2=libnanos6")
|
2022-08-25 18:56:55 +02:00
|
|
|
set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY
|
|
|
|
ENVIRONMENT "NANOS6_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nanos6/nanos6.toml")
|
2022-09-27 15:41:43 +02:00
|
|
|
if(NANOS6_TEST_LEVEL)
|
|
|
|
set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY
|
|
|
|
ENVIRONMENT "NANOS6_CONFIG_OVERRIDE=instrument.ovni.level=${NANOS6_TEST_LEVEL}")
|
|
|
|
endif()
|
2022-08-25 18:56:55 +02:00
|
|
|
endfunction()
|
|
|
|
|
2022-08-25 19:30:44 +02:00
|
|
|
nanos6_rt_test(simple-task.c)
|
|
|
|
nanos6_rt_test(nested-task.c)
|
2022-09-08 13:41:52 +02:00
|
|
|
nanos6_rt_test(several-tasks.c)
|
2022-09-13 15:36:55 +02:00
|
|
|
nanos6_rt_test(sched-add.c)
|
2022-09-21 13:02:24 +02:00
|
|
|
nanos6_rt_test(if0.c)
|
2022-12-13 13:29:09 +01:00
|
|
|
#nanos6_rt_test(taskfor.c) #Taskfor no longer supported
|
2023-06-27 10:43:04 +02:00
|
|
|
nanos6_rt_test(taskloop.c)
|
2023-02-20 18:42:15 +01:00
|
|
|
nanos6_rt_test(spawn-task.c)
|
|
|
|
nanos6_rt_test(spawn-task-external.c)
|
|
|
|
nanos6_rt_test(spawn-task-external-bad.c SHOULD_FAIL
|
|
|
|
REGEX "ovni_finish: thread [0-9]* is not dead")
|
2022-09-29 12:41:59 +02:00
|
|
|
|
|
|
|
# Test multiple instrumentation levels
|
2022-09-27 15:41:43 +02:00
|
|
|
nanos6_rt_test(simple-task.c NAME simple-task-level-1 LEVEL 1)
|
|
|
|
nanos6_rt_test(simple-task.c NAME simple-task-level-2 LEVEL 2)
|
|
|
|
nanos6_rt_test(simple-task.c NAME simple-task-level-3 LEVEL 3)
|