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/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/jacobi3d/source/nosv.cpp b/examples/distributed/jacobi3d/source/nosv.cpp index f57b6aa..c70d260 100644 --- a/examples/distributed/jacobi3d/source/nosv.cpp +++ b/examples/distributed/jacobi3d/source/nosv.cpp @@ -17,15 +17,16 @@ #include #include #include -#include -#include -#include -#include #include #include #include +#include +#include +#include +#include + #ifdef _TASKR_DISTRIBUTED_ENGINE_MPI #include #include 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/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 5096252..5415c6e 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(); } + INSTRUMENTATION_THREAD_END(); #endif diff --git a/meson.build b/meson.build index a38cb0c..b03c312 100644 --- a/meson.build +++ b/meson.build @@ -14,11 +14,32 @@ taskrDependencies = [ ] if meson.is_subproject() == false - # Selecting default HiCR Backends - HiCRBackends = [ 'hwloc', 'pthreads', 'boost', 'nosv' ] + HiCRBackends = [ ] + if get_option('buildExamples') or get_option('buildTests') - # Getting selected distributed engine + # Selecting default HiCR Backends + HiCRBackends = ['hwloc'] + + 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 + 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..541d34f 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) 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) of the examples. Default: pthreads', + value: ['pthreads'] +) + option('buildTests', type : 'boolean', value : false, description: 'Indicates whether to build tests' )