Skip to content

Commit 1d825a5

Browse files
committed
Updated domain definitions in examples and benchmarks.
1 parent 7e6235b commit 1d825a5

8 files changed

Lines changed: 149 additions & 40 deletions

File tree

benchmarks/src/Main.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// http://www.boost.org/LICENSE_1_0.txt)
66

7-
#define REACT_ENABLE_LOGGING
7+
//#define REACT_ENABLE_LOGGING
88

99
#include "tbb/tick_count.h"
1010
#include "tbb/tbbmalloc_proxy.h"
@@ -32,10 +32,10 @@ namespace {
3232

3333
using namespace react;
3434

35-
REACTIVE_DOMAIN(ToposortSTDomain, ToposortEngine<sequential>)
36-
REACTIVE_DOMAIN(ToposortDomain, ToposortEngine<parallel>)
37-
REACTIVE_DOMAIN(PulsecountDomain, PulsecountEngine<parallel>)
38-
REACTIVE_DOMAIN(SubtreeDomain, SubtreeEngine<parallel>)
35+
REACTIVE_DOMAIN(ToposortSTDomain, sequential, ToposortEngine)
36+
REACTIVE_DOMAIN(ToposortDomain, parallel, ToposortEngine)
37+
REACTIVE_DOMAIN(PulsecountDomain, parallel, PulsecountEngine)
38+
REACTIVE_DOMAIN(SubtreeDomain, parallel, SubtreeEngine)
3939

4040
void runBenchmarkGrid(std::ostream& out)
4141
{
@@ -216,15 +216,15 @@ void debugBenchmarks()
216216

217217
void profileBenchmark()
218218
{
219-
//RUN_BENCHMARK(std::cout, 1, Benchmark_Grid, BenchmarkParams_Grid(100, 10000),
220-
// PulsecountDomain);
219+
RUN_BENCHMARK(std::cout, 1, Benchmark_Grid, BenchmarkParams_Grid(30, 10000),
220+
ToposortSTDomain);
221221
//ToposortSTDomain, ToposortDomain, PulsecountDomain, SubtreeDomain);
222222

223223
//RUN_BENCHMARK(std::cout, 1, Benchmark_Grid, BenchmarkParams_Grid(30, 10000),
224-
// SourceSetDomain);
224+
//SourceSetDomain);
225225

226-
RUN_BENCHMARK(std::cout, 3, Benchmark_Random, BenchmarkParams_Random(20, 11, 100, 0, 1, 40, 40, false, 41556, 21624),
227-
SubtreeDomain);
226+
//RUN_BENCHMARK(std::cout, 3, Benchmark_Random, BenchmarkParams_Random(20, 11, 100, 0, 1, 40, 40, false, 41556, 21624),
227+
//SubtreeDomain);
228228
//ToposortSTDomain, ToposortDomain, PulsecountDomain, SubtreeDomain);
229229

230230
//RUN_BENCHMARK(std::cout, 1, Benchmark_LifeSim, BenchmarkParams_LifeSim(100, 15, 10000),
@@ -236,6 +236,6 @@ void profileBenchmark()
236236
int main()
237237
{
238238
//runBenchmarks();
239-
debugBenchmarks();
240-
//profileBenchmark();
239+
//debugBenchmarks();
240+
profileBenchmark();
241241
}

examples/src/BasicAlgorithms.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace example1
2323
using namespace std;
2424
using namespace react;
2525

26-
REACTIVE_DOMAIN(D)
26+
REACTIVE_DOMAIN(D, sequential)
2727

2828
class Sensor
2929
{
@@ -62,7 +62,7 @@ namespace example2
6262
using namespace std;
6363
using namespace react;
6464

65-
REACTIVE_DOMAIN(D)
65+
REACTIVE_DOMAIN(D, sequential)
6666

6767
class Employee
6868
{
@@ -100,7 +100,7 @@ namespace example3
100100
using namespace std;
101101
using namespace react;
102102

103-
REACTIVE_DOMAIN(D)
103+
REACTIVE_DOMAIN(D, sequential)
104104

105105
class Counter
106106
{
@@ -142,7 +142,7 @@ namespace example4
142142
using namespace std;
143143
using namespace react;
144144

145-
REACTIVE_DOMAIN(D)
145+
REACTIVE_DOMAIN(D, sequential)
146146

147147
class Sensor
148148
{
@@ -181,7 +181,7 @@ namespace example5
181181
using namespace std;
182182
using namespace react;
183183

184-
REACTIVE_DOMAIN(D)
184+
REACTIVE_DOMAIN(D, sequential)
185185

186186
enum ECmd { increment, decrement, reset };
187187

@@ -244,7 +244,7 @@ namespace example6
244244
using namespace std;
245245
using namespace react;
246246

247-
REACTIVE_DOMAIN(D)
247+
REACTIVE_DOMAIN(D, sequential)
248248

249249
class Sensor
250250
{

examples/src/BasicComposition.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace example1
2121
using namespace std;
2222
using namespace react;
2323

24-
REACTIVE_DOMAIN(D)
24+
REACTIVE_DOMAIN(D, sequential)
2525

2626
class Shape
2727
{
@@ -63,7 +63,7 @@ namespace example2
6363
using namespace std;
6464
using namespace react;
6565

66-
REACTIVE_DOMAIN(D)
66+
REACTIVE_DOMAIN(D, sequential)
6767

6868
class Company
6969
{
@@ -121,7 +121,7 @@ namespace example3
121121
using namespace std;
122122
using namespace react;
123123

124-
REACTIVE_DOMAIN(D)
124+
REACTIVE_DOMAIN(D, sequential)
125125

126126
class Company
127127
{

examples/src/BasicEvents.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace example1
2323
// Defines a domain.
2424
// Each domain represents a separate dependency graph, managed by a dedicated propagation engine.
2525
// Reactives of different domains can not be combined.
26-
REACTIVE_DOMAIN(D)
26+
REACTIVE_DOMAIN(D, sequential)
2727

2828
// Define type aliases for the given domain in this namespace.
2929
// Now we can use EventSourceT instead of D::EventSourceT.
@@ -90,7 +90,7 @@ namespace example2
9090
using namespace std;
9191
using namespace react;
9292

93-
REACTIVE_DOMAIN(D)
93+
REACTIVE_DOMAIN(D, sequential)
9494
USING_REACTIVE_DOMAIN(D)
9595

9696
// An event stream that merges both sources
@@ -152,7 +152,7 @@ namespace example3
152152
using namespace std;
153153
using namespace react;
154154

155-
REACTIVE_DOMAIN(D)
155+
REACTIVE_DOMAIN(D, sequential)
156156
USING_REACTIVE_DOMAIN(D)
157157

158158
EventSourceT<int> numbers = MakeEventSource<D,int>();
@@ -183,7 +183,7 @@ namespace example4
183183
using namespace std;
184184
using namespace react;
185185

186-
REACTIVE_DOMAIN(D)
186+
REACTIVE_DOMAIN(D, sequential)
187187
USING_REACTIVE_DOMAIN(D)
188188

189189
// Data types
@@ -225,7 +225,7 @@ namespace example5
225225
using namespace std;
226226
using namespace react;
227227

228-
REACTIVE_DOMAIN(D)
228+
REACTIVE_DOMAIN(D, sequential)
229229
USING_REACTIVE_DOMAIN(D)
230230

231231
EventSourceT<int> src = MakeEventSource<D,int>();

examples/src/BasicObservers.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace example1
2121
using namespace std;
2222
using namespace react;
2323

24-
REACTIVE_DOMAIN(D)
24+
REACTIVE_DOMAIN(D, sequential)
2525
USING_REACTIVE_DOMAIN(D)
2626

2727
auto x = MakeVar<D>(1);
@@ -103,7 +103,7 @@ namespace example2
103103
using namespace std;
104104
using namespace react;
105105

106-
REACTIVE_DOMAIN(D)
106+
REACTIVE_DOMAIN(D, sequential)
107107
USING_REACTIVE_DOMAIN(D)
108108

109109
EventSourceT<> trigger = MakeEventSource<D>();
@@ -134,7 +134,7 @@ namespace example3
134134
using namespace std;
135135
using namespace react;
136136

137-
REACTIVE_DOMAIN(D)
137+
REACTIVE_DOMAIN(D, sequential)
138138
USING_REACTIVE_DOMAIN(D)
139139

140140
EventSourceT<> trigger = MakeEventSource<D>();

examples/src/BasicReactors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace example1
2020
using namespace std;
2121
using namespace react;
2222

23-
REACTIVE_DOMAIN(D)
23+
REACTIVE_DOMAIN(D, sequential)
2424
USING_REACTIVE_DOMAIN(D)
2525

2626
using PointT = pair<int,int>;

examples/src/BasicSignals.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace example1
2626
// Defines a domain.
2727
// Each domain represents a separate dependency graph, managed by a dedicated propagation engine.
2828
// Reactives of different domains can not be combined.
29-
REACTIVE_DOMAIN(D)
29+
REACTIVE_DOMAIN(D, sequential)
3030

3131
// Define type aliases for the given domain in this namespace.
3232
// Now we can use VarSignalT instead of D::VarSignalT.
@@ -102,7 +102,7 @@ namespace example2
102102
using namespace std;
103103
using namespace react;
104104

105-
REACTIVE_DOMAIN(D)
105+
REACTIVE_DOMAIN(D, sequential)
106106
USING_REACTIVE_DOMAIN(D)
107107

108108
VarSignalT<int> x = MakeVar<D>(1);
@@ -133,7 +133,7 @@ namespace example3
133133
using namespace std;
134134
using namespace react;
135135

136-
REACTIVE_DOMAIN(D)
136+
REACTIVE_DOMAIN(D, sequential)
137137
USING_REACTIVE_DOMAIN(D)
138138

139139
VarSignalT<int> a = MakeVar<D>(1);
@@ -171,7 +171,7 @@ namespace example4
171171
using namespace std;
172172
using namespace react;
173173

174-
REACTIVE_DOMAIN(D)
174+
REACTIVE_DOMAIN(D, sequential)
175175
USING_REACTIVE_DOMAIN(D)
176176

177177
VarSignalT<vector<string>> data = MakeVar<D>(vector<string>{ });
@@ -205,7 +205,7 @@ namespace example5
205205
using namespace std;
206206
using namespace react;
207207

208-
REACTIVE_DOMAIN(D)
208+
REACTIVE_DOMAIN(D, sequential)
209209
USING_REACTIVE_DOMAIN(D)
210210

211211
// Helpers

0 commit comments

Comments
 (0)