-
Notifications
You must be signed in to change notification settings - Fork 1
/
cc.hpp
792 lines (655 loc) · 22.9 KB
/
cc.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
// Copyright (C) 2018 Thejaka Amila Kanewala, Marcin Zalewski, Andrew Lumsdaine.
// Boost Software License - Version 1.0 - August 17th, 2003
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// Authors: Thejaka Kanewala
// Andrew Lumsdaine
#ifndef __AGM_CC_HPP
#define __AGM_CC_HPP
#include <boost/config.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/iteration_macros.hpp>
#include <boost/graph/parallel/thread_support.hpp> // for compare_and_swap
#include <boost/graph/parallel/iteration_macros.hpp>
#include <boost/parallel/append_buffer.hpp>
#include <boost/graph/agm/util/stat.hpp>
#include <boost/graph/agm/model/agm.hpp>
#include <boost/graph/agm/runtime/runtime.hpp>
#include <boost/graph/agm/model/general_orderings.hpp>
#include <limits>
namespace boost { namespace graph { namespace agm {
// definition of the CC work item set
typedef int Level;
template<typename Graph,
typename IdDistribution>
class cc_family {
typedef typename boost::graph_traits < Graph >::vertex_descriptor Vertex;
typedef Vertex Component;
#define MAX_COMPONENT std::numeric_limits<Component>::max();
// work item set definition
// Every work item must have the time
// destination, level
typedef std::tuple<Vertex, Component> WorkItem;
typedef std::tuple<Vertex, Component, Level> LevelWorkItem;
// the processing function
template<typename State>
struct cc_pf {
public:
cc_pf(const Graph& _rg,
State& _st,
IdDistribution& _idd,
agm_work_stats& _sr) : g(_rg),
vcomponent(_st),
id_distribution(_idd),
stats(_sr){}
private:
const Graph& g;
State& vcomponent;
IdDistribution& id_distribution;
agm_work_stats& stats;
template<typename SizeType>
SizeType logical_id(SizeType k) {
return id_distribution(k);
}
public:
template<typename buckets>
void operator()(const WorkItem& wi,
int tid,
buckets& outset) {
Vertex v = std::get<0>(wi);
Component component = std::get<1>(wi);
Component old_component = vcomponent[v], last_old_component;
while(component < old_component) {
last_old_component = old_component;
old_component = boost::parallel::val_compare_and_swap(&vcomponent[v], old_component, component);
if (last_old_component == old_component) {
#ifdef PBGL2_PRINT_WORK_STATS
if (old_component < logical_id(v)) {
stats.increment_invalidated(tid);
} else
stats.increment_useful(tid);
#endif
std::set<Vertex> adjacencies;
bool haslowernbr = false;
BGL_FORALL_OUTEDGES_T(v, e, g, Graph) {
Vertex u = boost::target(e, g);
if (logical_id(u) > component) { // ignore self-loops
adjacencies.insert(u);
} else if(logical_id(u) < component) {
// v has a neighbor that is lower than v_component. Therefore, stop the search from v_component
haslowernbr = true;
break;
}
}
if (!haslowernbr) {
typename std::set<Vertex>::iterator ite = adjacencies.begin();
for(; ite != adjacencies.end(); ++ite) {
WorkItem generated((*ite), component);
outset.push(generated, tid);
}
}
return;
}
}
#ifdef PBGL2_PRINT_WORK_STATS
stats.increment_rejected(tid);
#endif
}
template<typename buckets>
void operator()(const LevelWorkItem& wi,
int tid,
buckets& outset) {
Vertex v = std::get<0>(wi);
Component component = std::get<1>(wi);
Component old_component = vcomponent[v], last_old_component;
Level l = std::get<2>(wi);
while(component < old_component) {
last_old_component = old_component;
old_component = boost::parallel::val_compare_and_swap(&vcomponent[v], old_component, component);
if (last_old_component == old_component) {
#ifdef PBGL2_PRINT_WORK_STATS
if (old_component < logical_id(v)) {
stats.increment_invalidated(tid);
} else
stats.increment_useful(tid);
#endif
std::set<Vertex> adjacencies;
bool haslowernbr = false;
BGL_FORALL_OUTEDGES_T(v, e, g, Graph) {
Vertex u = boost::target(e, g);
if (logical_id(u) > component) { // ignore self-loops
adjacencies.insert(u);
} else if(logical_id(u) < component) {
// v has a neighbor that is lower than v_component. Therefore, stop the search from v_component
haslowernbr = true;
break;
}
}
if (!haslowernbr) {
typename std::set<Vertex>::iterator ite = adjacencies.begin();
for(; ite != adjacencies.end(); ++ite) {
LevelWorkItem generated((*ite), component, (l+1));
outset.push(generated, tid);
}
}
return;
}
}
#ifdef PBGL2_PRINT_WORK_STATS
stats.increment_rejected(tid);
#endif
}
};
template<typename State>
struct pre_order_cc_pf {
public:
pre_order_cc_pf(const Graph& _rg,
State& _st,
IdDistribution& _idd,
agm_work_stats& _sr) : g(_rg),
vcomponent(_st),
id_distribution(_idd),
stats(_sr){}
private:
const Graph& g;
State& vcomponent;
IdDistribution& id_distribution;
agm_work_stats& stats;
template<typename SizeType>
SizeType logical_id(SizeType k) {
return id_distribution(k);
}
public:
template<typename buckets>
void operator()(const WorkItem& wi,
int tid,
buckets& outset) {
Vertex v = std::get<0>(wi);
Component component = std::get<1>(wi);
Component old_component = vcomponent[v], last_old_component;
while(component < old_component) {
last_old_component = old_component;
old_component = boost::parallel::val_compare_and_swap(&vcomponent[v], old_component, component);
if (last_old_component == old_component) {
#ifdef PBGL2_PRINT_WORK_STATS
if (old_component < logical_id(v)) {
stats.increment_invalidated(tid);
} else
stats.increment_useful(tid);
#endif
outset.push(wi, tid);
return;
}
}
#ifdef PBGL2_PRINT_WORK_STATS
stats.increment_rejected(tid);
#endif
}
template<typename buckets>
void operator()(const LevelWorkItem& wi,
int tid,
buckets& outset) {
Vertex v = std::get<0>(wi);
Component component = std::get<1>(wi);
Component old_component = vcomponent[v], last_old_component;
while(component < old_component) {
last_old_component = old_component;
old_component = boost::parallel::val_compare_and_swap(&vcomponent[v], old_component, component);
if (last_old_component == old_component) {
#ifdef PBGL2_PRINT_WORK_STATS
if (old_component < logical_id(v)) {
stats.increment_invalidated(tid);
} else
stats.increment_useful(tid);
#endif
outset.push(wi, tid);
return;
}
}
#ifdef PBGL2_PRINT_WORK_STATS
stats.increment_rejected(tid);
#endif
}
};
template<typename State>
struct post_order_cc_pf {
public:
post_order_cc_pf(const Graph& _rg,
State& _st,
IdDistribution& _idd,
agm_work_stats& _sr) : g(_rg),
vcomponent(_st),
id_distribution(_idd),
stats(_sr){}
private:
const Graph& g;
State& vcomponent;
IdDistribution& id_distribution;
agm_work_stats& stats;
template<typename SizeType>
SizeType logical_id(SizeType k) {
return id_distribution(k);
}
public:
template<typename buckets>
void operator()(const WorkItem& wi,
int tid,
buckets& outset) {
Vertex v = std::get<0>(wi);
Component component = std::get<1>(wi);
Component old_component;
__atomic_load(&vcomponent[v], &old_component, __ATOMIC_SEQ_CST);
if (old_component == component) {
std::set<Vertex> adjacencies;
bool haslowernbr = false;
BGL_FORALL_OUTEDGES_T(v, e, g, Graph) {
Vertex u = boost::target(e, g);
if (logical_id(u) > component) { // ignore self-loops
adjacencies.insert(u);
} else if(logical_id(u) < component) {
// v has a neighbor that is lower than v_component. Therefore, stop the search from v_component
haslowernbr = true;
break;
}
}
if (!haslowernbr) {
typename std::set<Vertex>::iterator ite = adjacencies.begin();
for(; ite != adjacencies.end(); ++ite) {
WorkItem generated((*ite), component);
outset.push(generated, tid);
}
}
}
}
template<typename buckets>
void operator()(const LevelWorkItem& wi,
int tid,
buckets& outset) {
Vertex v = std::get<0>(wi);
Component component = std::get<1>(wi);
Component old_component;
Level l = std::get<2>(wi);
__atomic_load(&vcomponent[v], &old_component, __ATOMIC_SEQ_CST);
if (old_component == component) {
std::set<Vertex> adjacencies;
bool haslowernbr = false;
BGL_FORALL_OUTEDGES_T(v, e, g, Graph) {
Vertex u = boost::target(e, g);
if (logical_id(u) > component) { // ignore self-loops
adjacencies.insert(u);
} else if(logical_id(u) < component) {
// v has a neighbor that is lower than v_component. Therefore, stop the search from v_component
haslowernbr = true;
break;
}
}
if (!haslowernbr) {
typename std::set<Vertex>::iterator ite = adjacencies.begin();
for(; ite != adjacencies.end(); ++ite) {
LevelWorkItem generated((*ite), component, (l+1));
outset.push(generated, tid);
}
}
}
}
};
public:
template<typename ComponentMap>
bool verify(Graph& g, ComponentMap& components) {
typedef typename boost::graph_traits<Graph>::vertex_descriptor Vertex;
components.set_consistency_model(boost::parallel::cm_forward);
components.set_max_ghost_cells(0);
{
amplusplus::scoped_epoch epoch(g.transport());
BGL_FORALL_VERTICES_T(v, g, Graph) {
BGL_FORALL_OUTEDGES_T(v, e, g, Graph) {
get(components, source(e, g));
get(components, target(e, g));
}
}
}
{
amplusplus::scoped_epoch epoch(g.transport()); // at the moment get() sends a message
BGL_FORALL_VERTICES_T(v, g, Graph) {
BGL_FORALL_ADJ_T(v, u, g, Graph) {
// std::cout << "verifying vertex v : " << v << std::endl;
//#ifdef PRINT_DEBUG
if (get(components, v) != get(components, u))
std::cout << "Component of " << v << " : " << get(components, v)
<< " component of " << u << " : " << get(components, u)
<< std::endl;
assert(get(components, v) == get(components, u));
}
}
}
components.clear(); // Clear memory used by ghost cells
return true;
}
template<typename component_state,
typename append_buffer_t,
typename work_item_t>
struct threaded_initializer {
private:
int nthreads;
Graph& graph;
IdDistribution& idd;
append_buffer_t* buffer;
component_state& state;
template<typename SizeType>
SizeType logical_id(SizeType k) {
return idd(k);
}
public:
threaded_initializer(int _nthreads,
Graph& _g,
IdDistribution& _idd,
append_buffer_t* _buf,
component_state& _st) : nthreads(_nthreads),
graph(_g),
idd(_idd),
buffer(_buf),
state(_st){}
work_item_t create_wi(WorkItem w, Vertex v, Component comp) {
WorkItem w2(v, comp);
return w2;
}
work_item_t create_wi(LevelWorkItem w, Vertex v, Component comp) {
LevelWorkItem w2(v, comp, 0);
return w2;
}
void operator()(int tid, pf_exec_mode_preorder) {
BGL_PARFORALL_VERTICES_T(u, graph, Graph, tid, nthreads) {
Vertex min_neighbor = logical_id(u);
std::set<Vertex> adjacencies;
BGL_FORALL_OUTEDGES_T(u, e, graph, Graph) {
Vertex v = target(e, graph);
if (u != v) { // ignore self loops
if (adjacencies.insert(v).second) {
// check whether u is the minimum out of its neighbors
if (logical_id(v) < min_neighbor) {
min_neighbor = logical_id(v);
break;
}
}
}
}
if (min_neighbor == logical_id(u)) {
auto comp = logical_id(u);
for (typename std::set<Vertex>::iterator ite = adjacencies.begin();
ite != adjacencies.end(); ++ite) {
assert(comp < logical_id(*ite));
work_item_t w;
buffer->push_back(create_wi(w, (*ite), comp));
}
}
}
}
void operator()(int tid, pf_exec_mode_postorder) {
BGL_PARFORALL_VERTICES_T(u, graph, Graph, tid, nthreads) {
Vertex min_neighbor = logical_id(u);
std::set<Vertex> adjacencies;
BGL_FORALL_OUTEDGES_T(u, e, graph, Graph) {
Vertex v = target(e, graph);
if (u != v) { // ignore self loops
if (adjacencies.insert(v).second) {
// check whether u is the minimum out of its neighbors
if (logical_id(v) < min_neighbor) {
min_neighbor = logical_id(v);
break;
}
}
}
}
if (min_neighbor == logical_id(u)) {
auto comp = logical_id(u);
work_item_t w;
buffer->push_back(create_wi(w, u, comp));
state[u] = MAX_COMPONENT;
}
}
}
void operator()(int tid, pf_exec_mode_splitorder) {
BGL_PARFORALL_VERTICES_T(u, graph, Graph, tid, nthreads) {
Vertex min_neighbor = logical_id(u);
std::set<Vertex> adjacencies;
BGL_FORALL_OUTEDGES_T(u, e, graph, Graph) {
Vertex v = target(e, graph);
if (u != v) { // ignore self loops
if (adjacencies.insert(v).second) {
// check whether u is the minimum out of its neighbors
if (logical_id(v) < min_neighbor) {
min_neighbor = logical_id(v);
break;
}
}
}
}
if (min_neighbor == logical_id(u)) {
auto comp = logical_id(u);
work_item_t w;
buffer->push_back(create_wi(w, u, comp));
}
}
}
};
template<typename RuntimeModelGen,
typename EAGMConfig,
typename ComponentMap,
typename work_item_t,
typename InitialWorkItemSet>
time_type execute(Graph& g,
RuntimeModelGen rtmodelgen,
EAGMConfig& config,
ComponentMap& component_state,
InitialWorkItemSet& initial,
pf_exec_mode_preorder mode,
instance_params& runtime_params,
agm_work_stats& sr,
IdDistribution& iddist) {
//BGL_FORALL_VERTICES_T(v, g, Graph) {
// put(component_state, v, iddist(v));
//}
info("Setting the processing function ...");
// Processing funcion
typedef cc_pf<ComponentMap> ProcessingFunction;
ProcessingFunction pf(g, component_state, iddist, sr);
// CC algorithm
typedef eagm<Graph,
work_item_t,
ProcessingFunction,
EAGMConfig,
RuntimeModelGen,
EMPTY_PF> cc_eagm_t;
cc_eagm_t ccalgo(rtmodelgen,
config,
pf,
initial);
info("Invoking CC algorithm with : ", config.get_pf_mode(mode));
return ccalgo(runtime_params);
}
template<typename RuntimeModelGen,
typename EAGMConfig,
typename ComponentMap,
typename work_item_t,
typename InitialWorkItemSet>
time_type execute(Graph& g,
RuntimeModelGen rtmodelgen,
EAGMConfig& config,
ComponentMap& component_state,
InitialWorkItemSet& initial,
pf_exec_mode_splitorder mode,
instance_params& runtime_params,
agm_work_stats& sr,
IdDistribution& iddist) {
//BGL_FORALL_VERTICES_T(v, g, Graph) {
// put(component_state, v, iddist(v));
//}
info("Setting the processing function ...");
// Pre-Order Processing funcion
typedef pre_order_cc_pf<ComponentMap> PreOrderProcessingFunction;
PreOrderProcessingFunction prepf(g, component_state, iddist, sr);
// Post-Order Processing funcion
typedef post_order_cc_pf<ComponentMap> PostOrderProcessingFunction;
PostOrderProcessingFunction postpf(g, component_state, iddist, sr);
// CC algorithm
typedef eagm<Graph,
work_item_t,
PreOrderProcessingFunction,
EAGMConfig,
RuntimeModelGen,
PostOrderProcessingFunction> cc_eagm_t;
cc_eagm_t ccalgo(rtmodelgen,
config,
prepf,
postpf,
initial);
info("Invoking CC algorithm with : ", config.get_pf_mode(mode));
return ccalgo(runtime_params);
}
template<typename RuntimeModelGen,
typename EAGMConfig,
typename ComponentMap,
typename work_item_t,
typename InitialWorkItemSet>
time_type execute(Graph& g,
RuntimeModelGen rtmodelgen,
EAGMConfig& config,
ComponentMap& component_state,
InitialWorkItemSet& initial,
pf_exec_mode_postorder mode,
instance_params& runtime_params,
agm_work_stats& sr,
IdDistribution& iddist) {
//BGL_FORALL_VERTICES_T(v, g, Graph) {
// put(component_state, v, iddist(v));
//}
info("Setting the processing function ...");
// Processing funcion
typedef cc_pf<ComponentMap> ProcessingFunction;
ProcessingFunction pf(g, component_state, iddist, sr);
// CC algorithm
typedef eagm<Graph,
work_item_t,
EMPTY_PF,
EAGMConfig,
RuntimeModelGen,
ProcessingFunction> cc_eagm_t;
cc_eagm_t ccalgo(rtmodelgen,
config,
pf,
initial);
info("Invoking CC algorithm with : ", config.get_pf_mode(mode));
return ccalgo(runtime_params);
}
template<typename RuntimeModelGen,
typename EAGMConfig>
time_type execute_plain_eagm(Graph& g,
RuntimeModelGen rtmodelgen,
EAGMConfig& config,
instance_params& runtime_params,
agm_work_stats& sr,
IdDistribution& iddist,
bool _verify=true) {
return execute_eagm<RuntimeModelGen, EAGMConfig, WorkItem>
(g,
rtmodelgen,
config,
runtime_params,
sr,
iddist,
_verify);
}
template<typename RuntimeModelGen,
typename EAGMConfig>
time_type execute_w_level_eagm(Graph& g,
RuntimeModelGen rtmodelgen,
EAGMConfig& config,
instance_params& runtime_params,
agm_work_stats& sr,
IdDistribution& iddist,
bool _verify=true) {
return execute_eagm<RuntimeModelGen, EAGMConfig, LevelWorkItem>
(g,
rtmodelgen,
config,
runtime_params,
sr,
iddist,
_verify);
}
template<typename RuntimeModelGen,
typename EAGMConfig,
typename work_item_t>
time_type execute_eagm(Graph& g,
RuntimeModelGen rtmodelgen,
EAGMConfig& config,
instance_params& runtime_params,
agm_work_stats& sr,
IdDistribution& iddist,
bool _verify=true) {
info("Creating the state ...");
// State
typedef typename boost::property_map<Graph, boost::vertex_index_t>::type VertexIndexMap;
std::vector<Component> componentmap(num_vertices(g), std::numeric_limits<Component>::max());
typedef boost::iterator_property_map<typename std::vector<Component>::iterator, VertexIndexMap> ComponentMap;
ComponentMap component_state(componentmap.begin(), get(boost::vertex_index, g));
BGL_FORALL_VERTICES_T(v, g, Graph) {
put(component_state, v, iddist(v));
}
typedef typename EAGMConfig::pf_exec_mode_t mode_t;
mode_t mode;
info("Setting the initial work item set ...");
// Initial work item set
int nthreads = runtime_params.threads;
typedef append_buffer<work_item_t, 10u> InitialBuffer;
InitialBuffer initial;
threaded_initializer<ComponentMap, InitialBuffer, work_item_t> initializer(nthreads, g,
iddist,
&initial,
component_state);
boost::scoped_array<boost::thread> threads(new boost::thread[nthreads - 1]);
for (int i = 0; i < nthreads - 1; ++i) {
boost::thread thr(boost::ref(initializer), i + 1, mode);
threads[i].swap(thr);
}
initializer(0, mode);
for (int i = 0; i < (nthreads - 1); ++i)
threads[i].join();
time_type elapsed = execute<RuntimeModelGen,
EAGMConfig,
ComponentMap,
work_item_t,
InitialBuffer>(g,
rtmodelgen,
config,
component_state,
initial,
mode,
runtime_params,
sr,
iddist);
if (_verify) {
verify(g, component_state);
}
return elapsed;
}
};
}}}
#endif