2024-03-21 16:15:45 +01:00
|
|
|
# Copyright (c) 2022-2024 Barcelona Supercomputing Center (BSC)
|
2022-10-04 19:54:55 +02:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-12-15 10:56:31 +01:00
|
|
|
find_package(Nodes)
|
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 NODES RT tests")
|
|
|
|
else()
|
|
|
|
message(STATUS "Compiler doesn't support -fompss-2 flag, disabling NODES RT tests")
|
|
|
|
endif()
|
2022-10-04 19:54:55 +02:00
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT NODES_FOUND)
|
2023-05-30 18:16:08 +02:00
|
|
|
if(ENABLE_ALL_TESTS)
|
|
|
|
message(FATAL_ERROR "NODES not found, cannot enable NODES RT tests")
|
|
|
|
else()
|
|
|
|
message(STATUS "NODES not found, disabling NODES RT tests")
|
|
|
|
endif()
|
2022-10-04 19:54:55 +02:00
|
|
|
return()
|
|
|
|
else()
|
|
|
|
message(STATUS "Enabling NODES RT tests")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
function(nodes_rt_test)
|
2024-03-21 16:15:45 +01:00
|
|
|
set(switches "")
|
|
|
|
set(single LEVEL)
|
|
|
|
set(multi "")
|
|
|
|
cmake_parse_arguments(
|
|
|
|
NODES_TEST "${switches}" "${single}" "${multi}" ${ARGN})
|
2022-10-04 19:54:55 +02:00
|
|
|
ovni_test(${ARGN})
|
|
|
|
|
2023-05-31 19:16:18 +02:00
|
|
|
target_compile_options("${OVNI_TEST_NAME}" PUBLIC "-fompss-2=libnodes")
|
|
|
|
target_link_options("${OVNI_TEST_NAME}" PUBLIC "-fompss-2=libnodes")
|
2022-10-04 19:54:55 +02:00
|
|
|
set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY
|
|
|
|
ENVIRONMENT "NANOS6_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nodes/nanos6.toml")
|
2022-10-07 11:28:10 +02:00
|
|
|
|
2023-07-07 10:52:46 +02:00
|
|
|
set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY
|
|
|
|
ENVIRONMENT "NOSV_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nodes/nosv.toml")
|
|
|
|
|
|
|
|
set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY
|
|
|
|
ENVIRONMENT "NODES_OVNI=1")
|
2024-03-21 16:15:45 +01:00
|
|
|
|
|
|
|
if(DEFINED NODES_TEST_LEVEL)
|
|
|
|
set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY
|
|
|
|
ENVIRONMENT "NOSV_CONFIG_OVERRIDE=ovni.level=${NODES_TEST_LEVEL}")
|
|
|
|
endif()
|
2022-10-04 19:54:55 +02:00
|
|
|
endfunction()
|
|
|
|
|
2023-02-15 19:32:34 +01:00
|
|
|
nodes_rt_test(../nanos6/simple-task.c NAME simple-task SORT)
|
|
|
|
nodes_rt_test(../nanos6/nested-task.c NAME nested-task SORT)
|
|
|
|
nodes_rt_test(../nanos6/several-tasks.c NAME several-tasks SORT)
|
|
|
|
nodes_rt_test(../nanos6/if0.c NAME if0 SORT)
|
|
|
|
nodes_rt_test(../nanos6/sched-add.c NAME sched-add SORT)
|
2023-06-27 10:43:04 +02:00
|
|
|
nodes_rt_test(../nanos6/taskloop.c NAME taskloop SORT)
|
2023-04-14 10:25:17 +02:00
|
|
|
nodes_rt_test(taskiter.c SORT)
|
2024-03-21 16:58:08 +01:00
|
|
|
|
2024-06-10 16:52:14 +02:00
|
|
|
# Test multiple instrumentation levels
|
|
|
|
nodes_rt_test(../nanos6/several-tasks.c NAME several-tasks-level-1 LEVEL 1 SORT)
|
|
|
|
nodes_rt_test(../nanos6/several-tasks.c NAME several-tasks-level-2 LEVEL 2 SORT)
|
|
|
|
nodes_rt_test(../nanos6/several-tasks.c NAME several-tasks-level-3 LEVEL 3 SORT)
|
|
|
|
nodes_rt_test(../nanos6/several-tasks.c NAME several-tasks-level-4 LEVEL 4 SORT)
|
|
|
|
|
|
|
|
# Same but with breakdown enabled
|
2024-06-13 09:53:42 +02:00
|
|
|
nodes_rt_test(../nanos6/several-tasks.c NAME several-tasks-breakdown-level-1 LEVEL 1 SORT BREAKDOWN
|
|
|
|
SHOULD_FAIL REGEX "nosv.can_breakdown is false, missing events to enable breakdown")
|
|
|
|
nodes_rt_test(../nanos6/several-tasks.c NAME several-tasks-breakdown-level-2 LEVEL 2 SORT BREAKDOWN
|
|
|
|
SHOULD_FAIL REGEX "nosv.can_breakdown is false, missing events to enable breakdown")
|
|
|
|
# From level 3 up the breakdown can be enabled
|
2024-06-10 16:52:14 +02:00
|
|
|
nodes_rt_test(../nanos6/several-tasks.c NAME several-tasks-breakdown-level-3 LEVEL 3 SORT BREAKDOWN)
|
|
|
|
nodes_rt_test(../nanos6/several-tasks.c NAME several-tasks-breakdown-level-4 LEVEL 4 SORT BREAKDOWN)
|
|
|
|
|
2024-03-21 16:58:08 +01:00
|
|
|
|
|
|
|
include(CheckPerfParanoid)
|
|
|
|
if (PERF_PARANOID_KERNEL)
|
|
|
|
message(STATUS "Enabling perf paranoid tests for NODES")
|
2024-03-22 15:35:46 +01:00
|
|
|
nodes_rt_test(fibonacci.c SORT LEVEL 3 DRIVER "fibonacci.driver.sh")
|
2024-03-21 16:58:08 +01:00
|
|
|
elseif(ENABLE_ALL_TESTS)
|
|
|
|
message(FATAL_ERROR "Cannot enable perf paranoid tests for NODES")
|
|
|
|
else()
|
|
|
|
message(STATUS "Disabling perf paranoid tests for NODES")
|
|
|
|
endif()
|
2024-06-20 17:39:42 +02:00
|
|
|
|
|
|
|
nodes_rt_test(fibonacci-mark.c SORT)
|
|
|
|
nodes_rt_test(heat-mark.c SORT)
|