From 007e573932fdb43c3bca64657dc48002ab1c373d Mon Sep 17 00:00:00 2001 From: noabauma Date: Mon, 26 May 2025 17:13:34 +0200 Subject: [PATCH 1/5] first version of the Hicr backend flexible choice --- examples/distributed/jacobi3d/meson.build | 16 +++++--- examples/distributed/pingPong/meson.build | 8 ++-- examples/local/abcTasks/meson.build | 18 +++++---- examples/local/cholesky/meson.build | 18 +++++---- examples/local/conditionVariable/meson.build | 42 +++++++++++--------- examples/local/energySaver/meson.build | 16 +++++--- examples/local/fibonacci/meson.build | 16 +++++--- examples/local/manyParallel/meson.build | 16 +++++--- examples/local/multiJob/meson.build | 16 +++++--- examples/local/mutex/meson.build | 16 +++++--- examples/local/pendingOperation/meson.build | 16 +++++--- examples/local/resourceList/meson.build | 16 +++++--- examples/local/simple/meson.build | 18 +++++---- examples/local/suspend/meson.build | 16 +++++--- examples/local/workerSpecific/meson.build | 16 +++++--- include/taskr/runtime.hpp | 5 +-- meson.build | 22 +++++++++- meson_options.txt | 12 ++++++ 18 files changed, 195 insertions(+), 108 deletions(-) diff --git a/examples/distributed/jacobi3d/meson.build b/examples/distributed/jacobi3d/meson.build index 3fdd65c..d6f5e28 100644 --- a/examples/distributed/jacobi3d/meson.build +++ b/examples/distributed/jacobi3d/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'distributed', 'jacobi3d' ] -threading = executable('threading', [ 'source/pthreads.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] ) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] ) -if get_option('buildTests') - test('threading', threading, args : [ '-n', '64', '-i', '10' ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ '-n', '64', '-i', '10' ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] ) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] ) -if get_option('buildTests') - test('nosv', nosv, args : [ '-n', '64', '-i', '10' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + if get_option('buildTests') + test('nosv', nosv, args : [ '-n', '64', '-i', '10' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif endif \ No newline at end of file diff --git a/examples/distributed/pingPong/meson.build b/examples/distributed/pingPong/meson.build index ecac93b..4726b47 100644 --- a/examples/distributed/pingPong/meson.build +++ b/examples/distributed/pingPong/meson.build @@ -1,7 +1,9 @@ testSuite = [ 'examples', 'distributed' ] -pingPong = executable('pingPong', [ 'source/main.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] ) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + pingPong = executable('pingPong', [ 'source/main.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] ) -if get_option('buildTests') - test('pingPong', pingPong, args : [ ], suite: testSuite, workdir: pingPong.path() + '.p' ) + if get_option('buildTests') + test('pingPong', pingPong, args : [ ], suite: testSuite, workdir: pingPong.path() + '.p' ) + endif endif diff --git a/examples/local/abcTasks/meson.build b/examples/local/abcTasks/meson.build index 7be6dab..44c7a0f 100644 --- a/examples/local/abcTasks/meson.build +++ b/examples/local/abcTasks/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'local', 'abcTasks' ] -threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ]) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ]) -if get_option('buildTests') - test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ]) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ]) -if get_option('buildTests') - test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p') -endif + if get_option('buildTests') + test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p') + endif +endif \ No newline at end of file diff --git a/examples/local/cholesky/meson.build b/examples/local/cholesky/meson.build index 9648afe..bdda624 100644 --- a/examples/local/cholesky/meson.build +++ b/examples/local/cholesky/meson.build @@ -6,14 +6,18 @@ choleskyDep = declare_dependency( compile_args: [ '-ffast-math','-Werror' ] ) -threading = executable('threading', [ 'source/pthreads.cpp'], include_directories: include_directories(['source']), dependencies: [ choleskyDep] ) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp'], include_directories: include_directories(['source']), dependencies: [ choleskyDep] ) -if get_option('buildTests') - test('threading', threading, args: [ '384', '24', '0', '0' ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args: [ '384', '24', '0', '0' ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp'], include_directories: include_directories(['source']), dependencies: [ choleskyDep] ) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp'], include_directories: include_directories(['source']), dependencies: [ choleskyDep] ) -if get_option('buildTests') - test('nosv', nosv, args: [ '384', '24', '0', '0' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) -endif + if get_option('buildTests') + test('nosv', nosv, args: [ '384', '24', '0', '0' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif +endif \ No newline at end of file diff --git a/examples/local/conditionVariable/meson.build b/examples/local/conditionVariable/meson.build index db7f17d..b2037f4 100644 --- a/examples/local/conditionVariable/meson.build +++ b/examples/local/conditionVariable/meson.build @@ -1,25 +1,29 @@ testSuite = [ 'examples', 'local', 'conditionVariable' ] -threading_conditionVariableWait = executable('threading_conditionVariableWait', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWait'] ) -threading_conditionVariableWaitFor = executable('threading_conditionVariableWaitFor', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitFor'] ) -threading_conditionVariableWaitCondition = executable('threading_conditionVariableWaitCondition', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitCondition'] ) -threading_conditionVariableWaitForCondition = executable('threading_conditionVariableWaitForCondition', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitForCondition'] ) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading_conditionVariableWait = executable('threading_conditionVariableWait', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWait'] ) + threading_conditionVariableWaitFor = executable('threading_conditionVariableWaitFor', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitFor'] ) + threading_conditionVariableWaitCondition = executable('threading_conditionVariableWaitCondition', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitCondition'] ) + threading_conditionVariableWaitForCondition = executable('threading_conditionVariableWaitForCondition', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitForCondition'] ) -if get_option('buildTests') - test('threading_conditionVariableWait', threading_conditionVariableWait, args : [ ], suite: testSuite, workdir: threading_conditionVariableWait.path() + '.p' ) - test('threading_conditionVariableWaitFor', threading_conditionVariableWaitFor, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitFor.path() + '.p' ) - test('threading_conditionVariableWaitCondition', threading_conditionVariableWaitCondition, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitCondition.path() + '.p' ) - test('threading_conditionVariableWaitForCondition', threading_conditionVariableWaitForCondition, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitForCondition.path() + '.p' ) + if get_option('buildTests') + test('threading_conditionVariableWait', threading_conditionVariableWait, args : [ ], suite: testSuite, workdir: threading_conditionVariableWait.path() + '.p' ) + test('threading_conditionVariableWaitFor', threading_conditionVariableWaitFor, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitFor.path() + '.p' ) + test('threading_conditionVariableWaitCondition', threading_conditionVariableWaitCondition, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitCondition.path() + '.p' ) + test('threading_conditionVariableWaitForCondition', threading_conditionVariableWaitForCondition, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitForCondition.path() + '.p' ) + endif endif -nosv_conditionVariableWait = executable('nosv_conditionVariableWait', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWait'] ) -nosv_conditionVariableWaitFor = executable('nosv_conditionVariableWaitFor', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitFor'] ) -nosv_conditionVariableWaitCondition = executable('nosv_conditionVariableWaitCondition', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitCondition'] ) -nosv_conditionVariableWaitForCondition = executable('nosv_conditionVariableWaitForCondition', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitForCondition'] ) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv_conditionVariableWait = executable('nosv_conditionVariableWait', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWait'] ) + nosv_conditionVariableWaitFor = executable('nosv_conditionVariableWaitFor', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitFor'] ) + nosv_conditionVariableWaitCondition = executable('nosv_conditionVariableWaitCondition', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitCondition'] ) + nosv_conditionVariableWaitForCondition = executable('nosv_conditionVariableWaitForCondition', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitForCondition'] ) -if get_option('buildTests') - test('nosv_conditionVariableWait', nosv_conditionVariableWait, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWait.path() + '.p' ) - test('nosv_conditionVariableWaitFor', nosv_conditionVariableWaitFor, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitFor.path() + '.p' ) - test('nosv_conditionVariableWaitCondition', nosv_conditionVariableWaitCondition, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitCondition.path() + '.p' ) - test('nosv_conditionVariableWaitForCondition', nosv_conditionVariableWaitForCondition, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitForCondition.path() + '.p' ) -endif + if get_option('buildTests') + test('nosv_conditionVariableWait', nosv_conditionVariableWait, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWait.path() + '.p' ) + test('nosv_conditionVariableWaitFor', nosv_conditionVariableWaitFor, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitFor.path() + '.p' ) + test('nosv_conditionVariableWaitCondition', nosv_conditionVariableWaitCondition, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitCondition.path() + '.p' ) + test('nosv_conditionVariableWaitForCondition', nosv_conditionVariableWaitForCondition, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitForCondition.path() + '.p' ) + endif +endif \ No newline at end of file diff --git a/examples/local/energySaver/meson.build b/examples/local/energySaver/meson.build index 3af5d73..1d3cd26 100644 --- a/examples/local/energySaver/meson.build +++ b/examples/local/energySaver/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'local', 'energySaver' ] -threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ]) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ]) -if get_option('buildTests') - test('threading', threading, args : [ '3', '1', '100' ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ '3', '1', '100' ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ]) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ]) -if get_option('buildTests') - test('nosv', nosv, args : [ '3', '1', '100' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + if get_option('buildTests') + test('nosv', nosv, args : [ '3', '1', '100' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif endif \ No newline at end of file diff --git a/examples/local/fibonacci/meson.build b/examples/local/fibonacci/meson.build index a53babe..720d203 100644 --- a/examples/local/fibonacci/meson.build +++ b/examples/local/fibonacci/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'local', 'fibonacci' ] -threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ]) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ]) -if get_option('buildTests') - test('threading', threading, args : [ '10' ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ '10' ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ]) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ]) -if get_option('buildTests') - test('nosv', nosv, args : [ '10' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + if get_option('buildTests') + test('nosv', nosv, args : [ '10' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif endif \ No newline at end of file diff --git a/examples/local/manyParallel/meson.build b/examples/local/manyParallel/meson.build index 169e552..0032ad6 100644 --- a/examples/local/manyParallel/meson.build +++ b/examples/local/manyParallel/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'local', 'manyParallel' ] -threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] ) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('threading', threading, args : [ '2', '100' ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ '2', '100' ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ] ) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('nosv', nosv, args : [ '2', '100' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + if get_option('buildTests') + test('nosv', nosv, args : [ '2', '100' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif endif \ No newline at end of file diff --git a/examples/local/multiJob/meson.build b/examples/local/multiJob/meson.build index 1ac5c43..002e324 100644 --- a/examples/local/multiJob/meson.build +++ b/examples/local/multiJob/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'local', 'multiJob' ] -threading = executable('threading', [ 'source/pthreads.cpp', 'source/job1.cpp', 'source/job2.cpp' ], dependencies: [ TaskRBuildDep ] ) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp', 'source/job1.cpp', 'source/job2.cpp' ], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp', 'source/job1.cpp', 'source/job2.cpp' ], dependencies: [ TaskRBuildDep ] ) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp', 'source/job1.cpp', 'source/job2.cpp' ], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + if get_option('buildTests') + test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif endif \ No newline at end of file diff --git a/examples/local/mutex/meson.build b/examples/local/mutex/meson.build index c533416..3c31bfa 100644 --- a/examples/local/mutex/meson.build +++ b/examples/local/mutex/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'local', 'mutex' ] -threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] ) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] ) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + if get_option('buildTests') + test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif endif \ No newline at end of file diff --git a/examples/local/pendingOperation/meson.build b/examples/local/pendingOperation/meson.build index 7ec3684..11bbcfe 100644 --- a/examples/local/pendingOperation/meson.build +++ b/examples/local/pendingOperation/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'local', 'pendingOperation' ] -threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] ) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ] ) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + if get_option('buildTests') + test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif endif \ No newline at end of file diff --git a/examples/local/resourceList/meson.build b/examples/local/resourceList/meson.build index f9dbd19..3f6986a 100644 --- a/examples/local/resourceList/meson.build +++ b/examples/local/resourceList/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'local', 'resourceList' ] -threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ]) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ]) -if get_option('buildTests') - test('threading', threading, args : [ '4', '100', '0', '1', '2', '3' ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ '4', '100', '0', '1', '2', '3' ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ]) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ]) -if get_option('buildTests') - test('nosv', nosv, args : [ '4', '100', '0', '1', '2', '3' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + if get_option('buildTests') + test('nosv', nosv, args : [ '4', '100', '0', '1', '2', '3' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif endif \ No newline at end of file diff --git a/examples/local/simple/meson.build b/examples/local/simple/meson.build index 1f78352..fa6de31 100644 --- a/examples/local/simple/meson.build +++ b/examples/local/simple/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'local', 'simple' ] -threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ]) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ]) -if get_option('buildTests') - test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ]) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ]) -if get_option('buildTests') - test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) -endif + if get_option('buildTests') + test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif +endif \ No newline at end of file diff --git a/examples/local/suspend/meson.build b/examples/local/suspend/meson.build index dc065df..ea2dc76 100644 --- a/examples/local/suspend/meson.build +++ b/examples/local/suspend/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'local', 'suspend' ] -threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] ) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('threading', threading, args : [ '2', '100' ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ '2', '100' ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ] ) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('nosv', nosv, args : [ '2', '100' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + if get_option('buildTests') + test('nosv', nosv, args : [ '2', '100' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif endif \ No newline at end of file diff --git a/examples/local/workerSpecific/meson.build b/examples/local/workerSpecific/meson.build index 6969030..bcea67d 100644 --- a/examples/local/workerSpecific/meson.build +++ b/examples/local/workerSpecific/meson.build @@ -1,13 +1,17 @@ testSuite = [ 'examples', 'local', 'workerSpecific' ] -threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] ) +if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType') + threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + if get_option('buildTests') + test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' ) + endif endif -nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ] ) +if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType') + nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ] ) -if get_option('buildTests') - test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + if get_option('buildTests') + test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' ) + endif endif \ No newline at end of file diff --git a/include/taskr/runtime.hpp b/include/taskr/runtime.hpp index 5096252..ccb00e1 100644 --- a/include/taskr/runtime.hpp +++ b/include/taskr/runtime.hpp @@ -32,7 +32,6 @@ #include #include #include -#include #ifdef ENABLE_INSTRUMENTATION #include @@ -131,7 +130,7 @@ class Runtime #ifdef ENABLE_INSTRUMENTATION // This is to check if ovni has been already initialized by nOS-V - bool external_init_ = (dynamic_cast(_processingUnitComputeManager) == nullptr) ? false : true; + bool external_init_ = (dynamic_cast(_processingUnitComputeManager) == nullptr) ? true : false; // TraCR start tracing INSTRUMENTATION_START(external_init_); @@ -716,7 +715,7 @@ class Runtime INSTRUMENTATION_THREAD_MARK_SET(thread_idx.finished); // TraCR end thread (only if backend is not nOS-V) - if (dynamic_cast(_processingUnitComputeManager) == nullptr) { INSTRUMENTATION_THREAD_END(); } + if (dynamic_cast(_processingUnitComputeManager) != nullptr) { INSTRUMENTATION_THREAD_END(); } #endif diff --git a/meson.build b/meson.build index a38cb0c..7001a4a 100644 --- a/meson.build +++ b/meson.build @@ -15,10 +15,28 @@ taskrDependencies = [ ] if meson.is_subproject() == false # Selecting default HiCR Backends - HiCRBackends = [ 'hwloc', 'pthreads', 'boost', 'nosv' ] + HiCRBackends = ['hwloc'] - # Getting selected distributed engine + if 'boost' in get_option('executionStateType') + HiCRBackends += ['boost'] + endif + + if 'nosv' in get_option('executionStateType') + HiCRBackends += ['nosv'] + endif + + if 'pthreads' in get_option('processingUnitType') + HiCRBackends += ['pthreads'] + endif + + if 'nosv' in get_option('processingUnitType') + if 'nosv' not in HiCRBackends + HiCRBackends += ['nosv'] + endif + endif + + # Getting selected distributed engine distributedEngine = get_option('distributedEngine') # If, selected, adding the dependency for the distributed engine diff --git a/meson_options.txt b/meson_options.txt index 094af32..e561ae8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,6 +4,18 @@ option('distributedEngine', type : 'combo', value: 'none' ) +option('executionStateType', type : 'array', + choices : ['boost', 'nosv'], + description : 'Specifies which HiCR backend to use for the tasks (i.e. executionStates). Default: boost', + value: ['boost', 'nosv'] +) + +option('processingUnitType', type : 'array', + choices : ['pthreads', 'nosv'], + description : 'Specifies which HiCR backend to use for the workers (i.e. processingUnits). Default: pthreads', + value: ['pthreads', 'nosv'] +) + option('buildTests', type : 'boolean', value : false, description: 'Indicates whether to build tests' ) From 1211a641e713dea06061a46722e7808b4e273061 Mon Sep 17 00:00:00 2001 From: noabauma Date: Tue, 27 May 2025 10:11:21 +0200 Subject: [PATCH 2/5] adding the default to be only boost --- meson_options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index e561ae8..066397e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,13 +7,13 @@ option('distributedEngine', type : 'combo', option('executionStateType', type : 'array', choices : ['boost', 'nosv'], description : 'Specifies which HiCR backend to use for the tasks (i.e. executionStates). Default: boost', - value: ['boost', 'nosv'] + value: ['boost'] ) option('processingUnitType', type : 'array', choices : ['pthreads', 'nosv'], description : 'Specifies which HiCR backend to use for the workers (i.e. processingUnits). Default: pthreads', - value: ['pthreads', 'nosv'] + value: ['pthreads'] ) option('buildTests', type : 'boolean', value : false, From 345a5df53aa6573aa922221ce84f89aff43d92ff Mon Sep 17 00:00:00 2001 From: noabauma Date: Tue, 27 May 2025 10:58:32 +0200 Subject: [PATCH 3/5] adding the fix for only nosv and a new version of tracr --- .gitlab-ci.yml | 2 +- examples/distributed/jacobi3d/source/nosv.cpp | 8 +++++--- extern/tracr | 2 +- include/taskr/runtime.hpp | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1bdb517..f3d169d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ build: - source /home/hicr/.hicr-env.sh - echo "Building TaskR..." - mkdir build - - meson setup build -Dbuildtype=debug -Db_coverage=true -DbuildTests=true -DbuildExamples=true -DdistributedEngine=mpi -DbuildInstrumentation=true -DcompileWarningsAsErrors=true + - meson setup build -Dbuildtype=debug -Db_coverage=true -DbuildTests=true -DbuildExamples=true -DdistributedEngine=mpi -DexecutionStateType=boost,nosv -DprocessingUnitType=pthreads,nosv -DbuildInstrumentation=true -DcompileWarningsAsErrors=true - meson compile -C build - echo "Running tests..." - meson test -C build diff --git a/examples/distributed/jacobi3d/source/nosv.cpp b/examples/distributed/jacobi3d/source/nosv.cpp index f57b6aa..8439501 100644 --- a/examples/distributed/jacobi3d/source/nosv.cpp +++ b/examples/distributed/jacobi3d/source/nosv.cpp @@ -17,14 +17,16 @@ #include #include #include + +#include +#include +#include + #include #include #include #include -#include -#include -#include #ifdef _TASKR_DISTRIBUTED_ENGINE_MPI #include diff --git a/extern/tracr b/extern/tracr index 984f5d7..01b9e96 160000 --- a/extern/tracr +++ b/extern/tracr @@ -1 +1 @@ -Subproject commit 984f5d750531199a5cbf13e54d10f45a0f28c107 +Subproject commit 01b9e96067dc17d6965bb9fc9f39cf5afe5ce16b diff --git a/include/taskr/runtime.hpp b/include/taskr/runtime.hpp index ccb00e1..5415c6e 100644 --- a/include/taskr/runtime.hpp +++ b/include/taskr/runtime.hpp @@ -715,7 +715,7 @@ class Runtime INSTRUMENTATION_THREAD_MARK_SET(thread_idx.finished); // TraCR end thread (only if backend is not nOS-V) - if (dynamic_cast(_processingUnitComputeManager) != nullptr) { INSTRUMENTATION_THREAD_END(); } + INSTRUMENTATION_THREAD_END(); #endif From d4c84e75ec3e25ac49d1ab479b95710d2704d139 Mon Sep 17 00:00:00 2001 From: noabauma Date: Tue, 27 May 2025 11:00:16 +0200 Subject: [PATCH 4/5] code formatting --- examples/distributed/jacobi3d/source/nosv.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/distributed/jacobi3d/source/nosv.cpp b/examples/distributed/jacobi3d/source/nosv.cpp index 8439501..c70d260 100644 --- a/examples/distributed/jacobi3d/source/nosv.cpp +++ b/examples/distributed/jacobi3d/source/nosv.cpp @@ -27,7 +27,6 @@ #include #include - #ifdef _TASKR_DISTRIBUTED_ENGINE_MPI #include #include From fbe33a35e7b49e65f38b4046e7b714157a37a418 Mon Sep 17 00:00:00 2001 From: noabauma Date: Tue, 27 May 2025 14:49:45 +0200 Subject: [PATCH 5/5] adding minor correction in the meson.build file --- meson.build | 31 +++++++++++++++++-------------- meson_options.txt | 4 ++-- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 7001a4a..b03c312 100644 --- a/meson.build +++ b/meson.build @@ -14,25 +14,28 @@ taskrDependencies = [ ] if meson.is_subproject() == false - # Selecting default HiCR Backends - HiCRBackends = ['hwloc'] + HiCRBackends = [ ] + if get_option('buildExamples') or get_option('buildTests') + # Selecting default HiCR Backends + HiCRBackends = ['hwloc'] - if 'boost' in get_option('executionStateType') - HiCRBackends += ['boost'] - endif + if 'boost' in get_option('executionStateType') + HiCRBackends += ['boost'] + endif - if 'nosv' in get_option('executionStateType') - HiCRBackends += ['nosv'] - endif + if 'nosv' in get_option('executionStateType') + HiCRBackends += ['nosv'] + endif - if 'pthreads' in get_option('processingUnitType') - HiCRBackends += ['pthreads'] - endif + if 'pthreads' in get_option('processingUnitType') + HiCRBackends += ['pthreads'] + endif - if 'nosv' in get_option('processingUnitType') - if 'nosv' not in HiCRBackends - HiCRBackends += ['nosv'] + if 'nosv' in get_option('processingUnitType') + if 'nosv' not in HiCRBackends + HiCRBackends += ['nosv'] + endif endif endif diff --git a/meson_options.txt b/meson_options.txt index 066397e..541d34f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,13 +6,13 @@ option('distributedEngine', type : 'combo', option('executionStateType', type : 'array', choices : ['boost', 'nosv'], - description : 'Specifies which HiCR backend to use for the tasks (i.e. executionStates). Default: boost', + description : 'Specifies which HiCR backend to use for the tasks (i.e. executionStates) of the examples. Default: boost', value: ['boost'] ) option('processingUnitType', type : 'array', choices : ['pthreads', 'nosv'], - description : 'Specifies which HiCR backend to use for the workers (i.e. processingUnits). Default: pthreads', + description : 'Specifies which HiCR backend to use for the workers (i.e. processingUnits) of the examples. Default: pthreads', value: ['pthreads'] )