Skip to content

Commit c794e1e

Browse files
authored
first version of the Hicr backend flexible choice (#11)
* first version of the Hicr backend flexible choice * adding the default to be only boost * adding the fix for only nosv and a new version of tracr * code formatting * adding minor correction in the meson.build file
1 parent d334e53 commit c794e1e

File tree

21 files changed

+206
-115
lines changed

21 files changed

+206
-115
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ build:
1111
- source /home/hicr/.hicr-env.sh
1212
- echo "Building TaskR..."
1313
- mkdir build
14-
- meson setup build -Dbuildtype=debug -Db_coverage=true -DbuildTests=true -DbuildExamples=true -DdistributedEngine=mpi -DbuildInstrumentation=true -DcompileWarningsAsErrors=true
14+
- meson setup build -Dbuildtype=debug -Db_coverage=true -DbuildTests=true -DbuildExamples=true -DdistributedEngine=mpi -DexecutionStateType=boost,nosv -DprocessingUnitType=pthreads,nosv -DbuildInstrumentation=true -DcompileWarningsAsErrors=true
1515
- meson compile -C build
1616
- echo "Running tests..."
1717
- meson test -C build
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
testSuite = [ 'examples', 'distributed', 'jacobi3d' ]
22

3-
threading = executable('threading', [ 'source/pthreads.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] )
3+
if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType')
4+
threading = executable('threading', [ 'source/pthreads.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] )
45

5-
if get_option('buildTests')
6-
test('threading', threading, args : [ '-n', '64', '-i', '10' ], suite: testSuite, workdir: threading.path() + '.p' )
6+
if get_option('buildTests')
7+
test('threading', threading, args : [ '-n', '64', '-i', '10' ], suite: testSuite, workdir: threading.path() + '.p' )
8+
endif
79
endif
810

9-
nosv = executable('nosv', [ 'source/nosv.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] )
11+
if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType')
12+
nosv = executable('nosv', [ 'source/nosv.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] )
1013

11-
if get_option('buildTests')
12-
test('nosv', nosv, args : [ '-n', '64', '-i', '10' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' )
14+
if get_option('buildTests')
15+
test('nosv', nosv, args : [ '-n', '64', '-i', '10' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' )
16+
endif
1317
endif

examples/distributed/jacobi3d/source/nosv.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@
1717
#include <chrono>
1818
#include <hwloc.h>
1919
#include <taskr/taskr.hpp>
20-
#include <hicr/core/communicationManager.hpp>
21-
#include <hicr/core/instanceManager.hpp>
22-
#include <hicr/core/memoryManager.hpp>
23-
#include <hicr/backends/hwloc/topologyManager.hpp>
2420

2521
#include <nosv.h>
2622
#include <hicr/backends/nosv/common.hpp>
2723
#include <hicr/backends/nosv/computeManager.hpp>
2824

25+
#include <hicr/core/communicationManager.hpp>
26+
#include <hicr/core/instanceManager.hpp>
27+
#include <hicr/core/memoryManager.hpp>
28+
#include <hicr/backends/hwloc/topologyManager.hpp>
29+
2930
#ifdef _TASKR_DISTRIBUTED_ENGINE_MPI
3031
#include <hicr/backends/mpi/communicationManager.hpp>
3132
#include <hicr/backends/mpi/instanceManager.hpp>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
testSuite = [ 'examples', 'distributed' ]
22

3-
pingPong = executable('pingPong', [ 'source/main.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] )
3+
if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType')
4+
pingPong = executable('pingPong', [ 'source/main.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] )
45

5-
if get_option('buildTests')
6-
test('pingPong', pingPong, args : [ ], suite: testSuite, workdir: pingPong.path() + '.p' )
6+
if get_option('buildTests')
7+
test('pingPong', pingPong, args : [ ], suite: testSuite, workdir: pingPong.path() + '.p' )
8+
endif
79
endif
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
testSuite = [ 'examples', 'local', 'abcTasks' ]
22

3-
threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ])
3+
if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType')
4+
threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ])
45

5-
if get_option('buildTests')
6-
test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' )
6+
if get_option('buildTests')
7+
test('threading', threading, args : [ ], suite: testSuite, workdir: threading.path() + '.p' )
8+
endif
79
endif
810

9-
nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ])
11+
if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType')
12+
nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ])
1013

11-
if get_option('buildTests')
12-
test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p')
13-
endif
14+
if get_option('buildTests')
15+
test('nosv', nosv, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p')
16+
endif
17+
endif

examples/local/cholesky/meson.build

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ choleskyDep = declare_dependency(
66
compile_args: [ '-ffast-math','-Werror' ]
77
)
88

9-
threading = executable('threading', [ 'source/pthreads.cpp'], include_directories: include_directories(['source']), dependencies: [ choleskyDep] )
9+
if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType')
10+
threading = executable('threading', [ 'source/pthreads.cpp'], include_directories: include_directories(['source']), dependencies: [ choleskyDep] )
1011

11-
if get_option('buildTests')
12-
test('threading', threading, args: [ '384', '24', '0', '0' ], suite: testSuite, workdir: threading.path() + '.p' )
12+
if get_option('buildTests')
13+
test('threading', threading, args: [ '384', '24', '0', '0' ], suite: testSuite, workdir: threading.path() + '.p' )
14+
endif
1315
endif
1416

15-
nosv = executable('nosv', [ 'source/nosv.cpp'], include_directories: include_directories(['source']), dependencies: [ choleskyDep] )
17+
if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType')
18+
nosv = executable('nosv', [ 'source/nosv.cpp'], include_directories: include_directories(['source']), dependencies: [ choleskyDep] )
1619

17-
if get_option('buildTests')
18-
test('nosv', nosv, args: [ '384', '24', '0', '0' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' )
19-
endif
20+
if get_option('buildTests')
21+
test('nosv', nosv, args: [ '384', '24', '0', '0' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' )
22+
endif
23+
endif
Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
testSuite = [ 'examples', 'local', 'conditionVariable' ]
22

3-
threading_conditionVariableWait = executable('threading_conditionVariableWait', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWait'] )
4-
threading_conditionVariableWaitFor = executable('threading_conditionVariableWaitFor', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitFor'] )
5-
threading_conditionVariableWaitCondition = executable('threading_conditionVariableWaitCondition', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitCondition'] )
6-
threading_conditionVariableWaitForCondition = executable('threading_conditionVariableWaitForCondition', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitForCondition'] )
3+
if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType')
4+
threading_conditionVariableWait = executable('threading_conditionVariableWait', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWait'] )
5+
threading_conditionVariableWaitFor = executable('threading_conditionVariableWaitFor', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitFor'] )
6+
threading_conditionVariableWaitCondition = executable('threading_conditionVariableWaitCondition', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitCondition'] )
7+
threading_conditionVariableWaitForCondition = executable('threading_conditionVariableWaitForCondition', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitForCondition'] )
78

8-
if get_option('buildTests')
9-
test('threading_conditionVariableWait', threading_conditionVariableWait, args : [ ], suite: testSuite, workdir: threading_conditionVariableWait.path() + '.p' )
10-
test('threading_conditionVariableWaitFor', threading_conditionVariableWaitFor, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitFor.path() + '.p' )
11-
test('threading_conditionVariableWaitCondition', threading_conditionVariableWaitCondition, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitCondition.path() + '.p' )
12-
test('threading_conditionVariableWaitForCondition', threading_conditionVariableWaitForCondition, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitForCondition.path() + '.p' )
9+
if get_option('buildTests')
10+
test('threading_conditionVariableWait', threading_conditionVariableWait, args : [ ], suite: testSuite, workdir: threading_conditionVariableWait.path() + '.p' )
11+
test('threading_conditionVariableWaitFor', threading_conditionVariableWaitFor, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitFor.path() + '.p' )
12+
test('threading_conditionVariableWaitCondition', threading_conditionVariableWaitCondition, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitCondition.path() + '.p' )
13+
test('threading_conditionVariableWaitForCondition', threading_conditionVariableWaitForCondition, args : [ ], suite: testSuite, workdir: threading_conditionVariableWaitForCondition.path() + '.p' )
14+
endif
1315
endif
1416

15-
nosv_conditionVariableWait = executable('nosv_conditionVariableWait', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWait'] )
16-
nosv_conditionVariableWaitFor = executable('nosv_conditionVariableWaitFor', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitFor'] )
17-
nosv_conditionVariableWaitCondition = executable('nosv_conditionVariableWaitCondition', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitCondition'] )
18-
nosv_conditionVariableWaitForCondition = executable('nosv_conditionVariableWaitForCondition', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitForCondition'] )
17+
if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType')
18+
nosv_conditionVariableWait = executable('nosv_conditionVariableWait', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWait'] )
19+
nosv_conditionVariableWaitFor = executable('nosv_conditionVariableWaitFor', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitFor'] )
20+
nosv_conditionVariableWaitCondition = executable('nosv_conditionVariableWaitCondition', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitCondition'] )
21+
nosv_conditionVariableWaitForCondition = executable('nosv_conditionVariableWaitForCondition', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ], cpp_args: [ '-D__TEST_FUNCTION_=conditionVariableWaitForCondition'] )
1922

20-
if get_option('buildTests')
21-
test('nosv_conditionVariableWait', nosv_conditionVariableWait, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWait.path() + '.p' )
22-
test('nosv_conditionVariableWaitFor', nosv_conditionVariableWaitFor, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitFor.path() + '.p' )
23-
test('nosv_conditionVariableWaitCondition', nosv_conditionVariableWaitCondition, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitCondition.path() + '.p' )
24-
test('nosv_conditionVariableWaitForCondition', nosv_conditionVariableWaitForCondition, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitForCondition.path() + '.p' )
25-
endif
23+
if get_option('buildTests')
24+
test('nosv_conditionVariableWait', nosv_conditionVariableWait, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWait.path() + '.p' )
25+
test('nosv_conditionVariableWaitFor', nosv_conditionVariableWaitFor, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitFor.path() + '.p' )
26+
test('nosv_conditionVariableWaitCondition', nosv_conditionVariableWaitCondition, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitCondition.path() + '.p' )
27+
test('nosv_conditionVariableWaitForCondition', nosv_conditionVariableWaitForCondition, args : [ ], is_parallel : false, suite: testSuite, workdir: nosv_conditionVariableWaitForCondition.path() + '.p' )
28+
endif
29+
endif
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
testSuite = [ 'examples', 'local', 'energySaver' ]
22

3-
threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ])
3+
if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType')
4+
threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ])
45

5-
if get_option('buildTests')
6-
test('threading', threading, args : [ '3', '1', '100' ], suite: testSuite, workdir: threading.path() + '.p' )
6+
if get_option('buildTests')
7+
test('threading', threading, args : [ '3', '1', '100' ], suite: testSuite, workdir: threading.path() + '.p' )
8+
endif
79
endif
810

9-
nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ])
11+
if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType')
12+
nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ])
1013

11-
if get_option('buildTests')
12-
test('nosv', nosv, args : [ '3', '1', '100' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' )
14+
if get_option('buildTests')
15+
test('nosv', nosv, args : [ '3', '1', '100' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' )
16+
endif
1317
endif
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
testSuite = [ 'examples', 'local', 'fibonacci' ]
22

3-
threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ])
3+
if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType')
4+
threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ])
45

5-
if get_option('buildTests')
6-
test('threading', threading, args : [ '10' ], suite: testSuite, workdir: threading.path() + '.p' )
6+
if get_option('buildTests')
7+
test('threading', threading, args : [ '10' ], suite: testSuite, workdir: threading.path() + '.p' )
8+
endif
79
endif
810

9-
nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ])
11+
if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType')
12+
nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ])
1013

11-
if get_option('buildTests')
12-
test('nosv', nosv, args : [ '10' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' )
14+
if get_option('buildTests')
15+
test('nosv', nosv, args : [ '10' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' )
16+
endif
1317
endif
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
testSuite = [ 'examples', 'local', 'manyParallel' ]
22

3-
threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] )
3+
if 'boost' in get_option('executionStateType') and 'pthreads' in get_option('processingUnitType')
4+
threading = executable('threading', [ 'source/pthreads.cpp'], dependencies: [ TaskRBuildDep ] )
45

5-
if get_option('buildTests')
6-
test('threading', threading, args : [ '2', '100' ], suite: testSuite, workdir: threading.path() + '.p' )
6+
if get_option('buildTests')
7+
test('threading', threading, args : [ '2', '100' ], suite: testSuite, workdir: threading.path() + '.p' )
8+
endif
79
endif
810

9-
nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ] )
11+
if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType')
12+
nosv = executable('nosv', [ 'source/nosv.cpp'], dependencies: [ TaskRBuildDep ] )
1013

11-
if get_option('buildTests')
12-
test('nosv', nosv, args : [ '2', '100' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' )
14+
if get_option('buildTests')
15+
test('nosv', nosv, args : [ '2', '100' ], is_parallel : false, suite: testSuite, workdir: nosv.path() + '.p' )
16+
endif
1317
endif

0 commit comments

Comments
 (0)