vSMC
vSMC: Scalable Monte Carlo
backend_tbb.hpp
Go to the documentation of this file.
1 //============================================================================
2 // vSMC/include/vsmc/smp/backend_tbb.hpp
3 //----------------------------------------------------------------------------
4 // vSMC: Scalable Monte Carlo
5 //----------------------------------------------------------------------------
6 // Copyright (c) 2013-2016, Yan Zhou
7 // All rights reserved.
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are met:
11 //
12 // Redistributions of source code must retain the above copyright notice,
13 // this list of conditions and the following disclaimer.
14 //
15 // Redistributions in binary form must reproduce the above copyright notice,
16 // this list of conditions and the following disclaimer in the documentation
17 // and/or other materials provided with the distribution.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
20 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 // POSSIBILITY OF SUCH DAMAGE.
30 //============================================================================
31 
32 #ifndef VSMC_SMP_BACKEND_TBB_HPP
33 #define VSMC_SMP_BACKEND_TBB_HPP
34 
36 #include <tbb/tbb.h>
37 
38 #define VSMC_DEFINE_SMP_BACKEND_TBB_PARALLEL_RUN_INITIALIZE(args) \
39  this->eval_param(particle, param); \
40  this->eval_pre(particle); \
41  work_type work(this, &particle); \
42  ::tbb::parallel_reduce args; \
43  this->eval_post(particle); \
44  return work.accept();
45 
46 #define VSMC_DEFINE_SMP_BACKEND_TBB_PARALLEL_RUN_MOVE(args) \
47  this->eval_pre(iter, particle); \
48  work_type work(this, iter, &particle); \
49  ::tbb::parallel_reduce args; \
50  this->eval_post(iter, particle); \
51  return work.accept();
52 
53 #define VSMC_DEFINE_SMP_BACKEND_TBB_PARALLEL_RUN_MONITOR_EVAL(args) \
54  this->eval_pre(iter, particle); \
55  work_type work(this, iter, dim, &particle, r); \
56  ::tbb::parallel_for args; \
57  this->eval_post(iter, particle);
58 
59 namespace vsmc
60 {
61 
63 
64 template <typename StateBase>
67 class StateTBB : public StateBase
68 {
69  public:
71 
72  explicit StateTBB(size_type N) : StateBase(N) {}
73 
74  template <typename IntType>
75  void copy(size_type N, const IntType *index)
76  {
77  parallel_copy_run(index, ::tbb::blocked_range<size_type>(0, N));
78  }
79 
80  protected:
81  template <typename IntType>
82  class work_type
83  {
84  public:
85  work_type(StateTBB<StateBase> *state, const IntType *index)
86  : state_(state), index_(index)
87  {
88  }
89 
90  void operator()(const ::tbb::blocked_range<size_type> &range) const
91  {
92  for (size_type i = range.begin(); i != range.end(); ++i) {
93  state_->copy_particle(static_cast<size_type>(index_[i]), i);
94  }
95  }
96 
97  private:
98  StateTBB<StateBase> *const state_;
99  const IntType *const index_;
100  }; // class work_type
101 
102  template <typename IntType>
104  const IntType *index, const ::tbb::blocked_range<size_type> &range)
105  {
106  ::tbb::parallel_for(range, work_type<IntType>(this, index));
107  }
108 
109  template <typename IntType>
110  void parallel_copy_run(const IntType *index,
111  const ::tbb::blocked_range<size_type> &range,
112  const ::tbb::auto_partitioner &partitioner)
113  {
114  ::tbb::parallel_for(
115  range, work_type<IntType>(this, index), partitioner);
116  }
117 
118  template <typename IntType>
119  void parallel_copy_run(const IntType *index,
120  const ::tbb::blocked_range<size_type> &range,
121  const ::tbb::simple_partitioner &partitioner)
122  {
123  ::tbb::parallel_for(
124  range, work_type<IntType>(this, index), partitioner);
125  }
126 
127  template <typename IntType>
128  void parallel_copy_run(const IntType *index,
129  const ::tbb::blocked_range<size_type> &range,
130  ::tbb::affinity_partitioner &partitioner)
131  {
132  ::tbb::parallel_for(
133  range, work_type<IntType>(this, index), partitioner);
134  }
135 
136 #if __TBB_TASK_GROUP_CONTEXT
137  template <typename IntType>
138  void parallel_copy_run(const IntType *index,
139  const ::tbb::blocked_range<size_type> &range,
140  const ::tbb::auto_partitioner &partitioner,
141  ::tbb::task_group_context &context)
142  {
143  ::tbb::parallel_for(
144  range, work_type<IntType>(this, index), partitioner, context);
145  }
146 
147  template <typename IntType>
148  void parallel_copy_run(const IntType *index,
149  const ::tbb::blocked_range<size_type> &range,
150  const ::tbb::simple_partitioner &partitioner,
151  ::tbb::task_group_context &context)
152  {
153  ::tbb::parallel_for(
154  range, work_type<IntType>(this, index), partitioner, context);
155  }
156 
157  template <typename IntType>
158  void parallel_copy_run(const IntType *index,
159  const ::tbb::blocked_range<size_type> &range,
160  ::tbb::affinity_partitioner &partitioner,
161  ::tbb::task_group_context &context)
162  {
163  ::tbb::parallel_for(
164  range, work_type<IntType>(this, index), partitioner, context);
165  }
166 #endif // __TBB_TASK_GROUP_CONTEXT
167 }; // class StateTBB
168 
171 template <typename T, typename Derived>
172 class InitializeTBB : public InitializeBase<T, Derived>
173 {
174  public:
175  std::size_t operator()(Particle<T> &particle, void *param)
176  {
177  return parallel_run(particle, param,
178  ::tbb::blocked_range<typename Particle<T>::size_type>(
179  0, particle.size()));
180  }
181 
182  protected:
184 
185  class work_type
186  {
187  public:
189 
191  : wptr_(wptr), pptr_(pptr), accept_(0)
192  {
193  }
194 
195  work_type(const work_type &other, ::tbb::split)
196  : wptr_(other.wptr_), pptr_(other.pptr_), accept_(0)
197  {
198  }
199 
200  void operator()(const ::tbb::blocked_range<size_type> &range)
201  {
202  for (size_type i = range.begin(); i != range.end(); ++i)
203  accept_ += wptr_->eval_sp(pptr_->sp(i));
204  }
205 
206  void join(const work_type &other) { accept_ += other.accept_; }
207 
208  std::size_t accept() const { return accept_; }
209 
210  private:
211  InitializeTBB<T, Derived> *const wptr_;
212  Particle<T> *const pptr_;
213  std::size_t accept_;
214  }; // class work_type
215 
216  std::size_t parallel_run(Particle<T> &particle, void *param,
217  const ::tbb::blocked_range<typename Particle<T>::size_type> &range)
218  {
220  }
221 
222  std::size_t parallel_run(Particle<T> &particle, void *param,
223  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
224  const ::tbb::auto_partitioner &partitioner)
225  {
227  (range, work, partitioner));
228  }
229 
230  std::size_t parallel_run(Particle<T> &particle, void *param,
231  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
232  const ::tbb::simple_partitioner &partitioner)
233  {
235  (range, work, partitioner));
236  }
237 
238  std::size_t parallel_run(Particle<T> &particle, void *param,
239  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
240  ::tbb::affinity_partitioner &partitioner)
241  {
243  (range, work, partitioner));
244  }
245 
246 #if __TBB_TASK_GROUP_CONTEXT
247  std::size_t parallel_run(Particle<T> &particle, void *param,
248  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
249  const ::tbb::auto_partitioner &partitioner,
250  ::tbb::task_group_context &context)
251  {
253  (range, work, partitioner, context));
254  }
255 
256  std::size_t parallel_run(Particle<T> &particle, void *param,
257  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
258  const ::tbb::simple_partitioner &partitioner,
259  ::tbb::task_group_context &context)
260  {
262  (range, work, partitioner, context));
263  }
264 
265  std::size_t parallel_run(Particle<T> &particle, void *param,
266  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
267  ::tbb::affinity_partitioner &partitioner,
268  ::tbb::task_group_context &context)
269  {
271  (range, work, partitioner, context));
272  }
273 #endif // __TBB_TASK_GROUP_CONTEXT
274 }; // class InitializeTBB
275 
278 template <typename T, typename Derived>
279 class MoveTBB : public MoveBase<T, Derived>
280 {
281  public:
282  std::size_t operator()(std::size_t iter, Particle<T> &particle)
283  {
284  return parallel_run(iter, particle,
285  ::tbb::blocked_range<typename Particle<T>::size_type>(
286  0, particle.size()));
287  }
288 
289  protected:
291 
292  class work_type
293  {
294  public:
296 
298  MoveTBB<T, Derived> *wptr, std::size_t iter, Particle<T> *pptr)
299  : wptr_(wptr), iter_(iter), pptr_(pptr), accept_(0)
300  {
301  }
302 
303  work_type(const work_type &other, ::tbb::split)
304  : wptr_(other.wptr_)
305  , iter_(other.iter_)
306  , pptr_(other.pptr_)
307  , accept_(0)
308  {
309  }
310 
311  void operator()(const ::tbb::blocked_range<size_type> &range)
312  {
313  for (size_type i = range.begin(); i != range.end(); ++i)
314  accept_ += wptr_->eval_sp(iter_, pptr_->sp(i));
315  }
316 
317  void join(const work_type &other) { accept_ += other.accept_; }
318 
319  std::size_t accept() const { return accept_; }
320 
321  private:
322  MoveTBB<T, Derived> *const wptr_;
323  const std::size_t iter_;
324  Particle<T> *const pptr_;
325  std::size_t accept_;
326  }; // class work_type
327 
328  std::size_t parallel_run(std::size_t iter, Particle<T> &particle,
329  const ::tbb::blocked_range<typename Particle<T>::size_type> &range)
330  {
332  }
333 
334  std::size_t parallel_run(std::size_t iter, Particle<T> &particle,
335  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
336  const ::tbb::auto_partitioner &partitioner)
337  {
339  (range, work, partitioner));
340  }
341 
342  std::size_t parallel_run(std::size_t iter, Particle<T> &particle,
343  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
344  const ::tbb::simple_partitioner &partitioner)
345  {
347  (range, work, partitioner));
348  }
349 
350  std::size_t parallel_run(std::size_t iter, Particle<T> &particle,
351  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
352  ::tbb::affinity_partitioner &partitioner)
353  {
355  (range, work, partitioner));
356  }
357 
358 #if __TBB_TASK_GROUP_CONTEXT
359  std::size_t parallel_run(std::size_t iter, Particle<T> &particle,
360  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
361  const ::tbb::auto_partitioner &partitioner,
362  ::tbb::task_group_context &context)
363  {
365  (range, work, partitioner, context));
366  }
367 
368  std::size_t parallel_run(std::size_t iter, Particle<T> &particle,
369  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
370  const ::tbb::simple_partitioner &partitioner,
371  ::tbb::task_group_context &context)
372  {
374  (range, work, partitioner, context));
375  }
376 
377  std::size_t parallel_run(std::size_t iter, Particle<T> &particle,
378  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
379  ::tbb::affinity_partitioner &partitioner,
380  ::tbb::task_group_context &context)
381  {
383  (range, work, partitioner, context));
384  }
385 #endif // __TBB_TASK_GROUP_CONTEXT
386 }; // class MoveTBB
387 
390 template <typename T, typename Derived>
391 class MonitorEvalTBB : public MonitorEvalBase<T, Derived>
392 {
393  public:
395  std::size_t iter, std::size_t dim, Particle<T> &particle, double *r)
396  {
397  parallel_run(iter, dim, particle, r,
398  ::tbb::blocked_range<typename Particle<T>::size_type>(
399  0, particle.size()));
400  }
401 
402  protected:
404 
405  class work_type
406  {
407  public:
409 
410  work_type(MonitorEvalTBB<T, Derived> *wptr, std::size_t iter,
411  std::size_t dim, Particle<T> *pptr, double *r)
412  : wptr_(wptr), iter_(iter), dim_(dim), pptr_(pptr), r_(r)
413  {
414  }
415 
416  void operator()(const ::tbb::blocked_range<size_type> &range) const
417  {
418  for (size_type i = range.begin(); i != range.end(); ++i) {
419  wptr_->eval_sp(iter_, dim_, pptr_->sp(i),
420  r_ + static_cast<std::size_t>(i) * dim_);
421  }
422  }
423 
424  private:
425  MonitorEvalTBB<T, Derived> *const wptr_;
426  const std::size_t iter_;
427  const std::size_t dim_;
428  Particle<T> *const pptr_;
429  double *const r_;
430  }; // class work_type
431 
432  void parallel_run(std::size_t iter, std::size_t dim, Particle<T> &particle,
433  double *r,
434  const ::tbb::blocked_range<typename Particle<T>::size_type> &range)
435  {
437  }
438 
439  void parallel_run(std::size_t iter, std::size_t dim, Particle<T> &particle,
440  double *r,
441  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
442  const ::tbb::auto_partitioner &partitioner)
443  {
445  (range, work, partitioner));
446  }
447 
448  void parallel_run(std::size_t iter, std::size_t dim, Particle<T> &particle,
449  double *r,
450  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
451  const ::tbb::simple_partitioner &partitioner)
452  {
454  (range, work, partitioner));
455  }
456 
457  void parallel_run(std::size_t iter, std::size_t dim, Particle<T> &particle,
458  double *r,
459  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
460  ::tbb::affinity_partitioner &partitioner)
461  {
463  (range, work, partitioner));
464  }
465 
466 #if __TBB_TASK_GROUP_CONTEXT
467  void parallel_run(std::size_t iter, std::size_t dim, Particle<T> &particle,
468  double *r,
469  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
470  const ::tbb::auto_partitioner &partitioner,
471  ::tbb::task_group_context &context)
472  {
474  (range, work, partitioner, context));
475  }
476 
477  void parallel_run(std::size_t iter, std::size_t dim, Particle<T> &particle,
478  double *r,
479  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
480  const ::tbb::simple_partitioner &partitioner,
481  ::tbb::task_group_context &context)
482  {
484  (range, work, partitioner, context));
485  }
486 
487  void parallel_run(std::size_t iter, std::size_t dim, Particle<T> &particle,
488  double *r,
489  const ::tbb::blocked_range<typename Particle<T>::size_type> &range,
490  ::tbb::affinity_partitioner &partitioner,
491  ::tbb::task_group_context &context)
492  {
494  (range, work, partitioner, context));
495  }
496 #endif // __TBB_TASK_GROUP_CONTEXT
497 }; // class MonitorEvalTBB
498 
499 } // namespace vsmc
500 
501 #endif // VSMC_SMP_BACKEND_TBB_HPP
Definition: monitor.hpp:49
SizeType< T > size_type
Definition: particle.hpp:51
Particle class representing the whole particle set.
Definition: particle.hpp:48
void parallel_copy_run(const IntType *index, const ::tbb::blocked_range< size_type > &range, const ::tbb::auto_partitioner &partitioner)
std::size_t accept() const
Sampler<T>::init_type subtype using Intel Threading Building Blocks.
Definition: backend_tbb.hpp:62
void join(const work_type &other)
std::size_t parallel_run(Particle< T > &particle, void *param, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::auto_partitioner &partitioner,::tbb::task_group_context &context)
void operator()(const ::tbb::blocked_range< size_type > &range)
void operator()(const ::tbb::blocked_range< size_type > &range) const
StateTBB(size_type N)
Definition: backend_tbb.hpp:72
void parallel_run(std::size_t iter, std::size_t dim, Particle< T > &particle, double *r, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::simple_partitioner &partitioner)
std::size_t parallel_run(Particle< T > &particle, void *param, const ::tbb::blocked_range< typename Particle< T >::size_type > &range,::tbb::affinity_partitioner &partitioner,::tbb::task_group_context &context)
Monitor evalution base dispatch class.
void parallel_copy_run(const IntType *index, const ::tbb::blocked_range< size_type > &range, const ::tbb::simple_partitioner &partitioner,::tbb::task_group_context &context)
work_type(MonitorEvalTBB< T, Derived > *wptr, std::size_t iter, std::size_t dim, Particle< T > *pptr, double *r)
std::size_t parallel_run(std::size_t iter, Particle< T > &particle, const ::tbb::blocked_range< typename Particle< T >::size_type > &range,::tbb::affinity_partitioner &partitioner)
void parallel_run(std::size_t iter, std::size_t dim, Particle< T > &particle, double *r, const ::tbb::blocked_range< typename Particle< T >::size_type > &range,::tbb::affinity_partitioner &partitioner)
void operator()(std::size_t iter, std::size_t dim, Particle< T > &particle, double *r)
void parallel_run(std::size_t iter, std::size_t dim, Particle< T > &particle, double *r, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::simple_partitioner &partitioner,::tbb::task_group_context &context)
void parallel_run(std::size_t iter, std::size_t dim, Particle< T > &particle, double *r, const ::tbb::blocked_range< typename Particle< T >::size_type > &range)
#define VSMC_DEFINE_SMP_BACKEND_FORWARD(Name)
void operator()(const ::tbb::blocked_range< size_type > &range) const
Definition: backend_tbb.hpp:90
#define VSMC_DEFINE_SMP_BACKEND_TBB_PARALLEL_RUN_INITIALIZE(args)
Definition: backend_tbb.hpp:38
std::size_t parallel_run(std::size_t iter, Particle< T > &particle, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::simple_partitioner &partitioner,::tbb::task_group_context &context)
void copy(size_type N, const IntType *index)
Definition: backend_tbb.hpp:75
void parallel_copy_run(const IntType *index, const ::tbb::blocked_range< size_type > &range)
typename Particle< T >::size_type size_type
#define VSMC_DEFINE_SMP_BACKEND_TBB_PARALLEL_RUN_MOVE(args)
Definition: backend_tbb.hpp:46
Monitor<T>::eval_type subtype using Intel Threading Building Blocks.
Definition: backend_tbb.hpp:62
std::size_t operator()(std::size_t iter, Particle< T > &particle)
std::size_t parallel_run(Particle< T > &particle, void *param, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::simple_partitioner &partitioner,::tbb::task_group_context &context)
std::size_t parallel_run(std::size_t iter, Particle< T > &particle, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::simple_partitioner &partitioner)
work_type(InitializeTBB< T, Derived > *wptr, Particle< T > *pptr)
void parallel_run(std::size_t iter, std::size_t dim, Particle< T > &particle, double *r, const ::tbb::blocked_range< typename Particle< T >::size_type > &range,::tbb::affinity_partitioner &partitioner,::tbb::task_group_context &context)
Sampler<T>::move_type subtype using Intel Threading Building Blocks.
Definition: backend_tbb.hpp:62
void operator()(const ::tbb::blocked_range< size_type > &range)
#define VSMC_DEFINE_SMP_BACKEND_TBB_PARALLEL_RUN_MONITOR_EVAL(args)
Definition: backend_tbb.hpp:53
std::size_t accept() const
std::size_t parallel_run(Particle< T > &particle, void *param, const ::tbb::blocked_range< typename Particle< T >::size_type > &range)
std::size_t parallel_run(std::size_t iter, Particle< T > &particle, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::auto_partitioner &partitioner)
work_type(MoveTBB< T, Derived > *wptr, std::size_t iter, Particle< T > *pptr)
work_type(const work_type &other,::tbb::split)
std::size_t parallel_run(std::size_t iter, Particle< T > &particle, const ::tbb::blocked_range< typename Particle< T >::size_type > &range,::tbb::affinity_partitioner &partitioner,::tbb::task_group_context &context)
work_type(const work_type &other,::tbb::split)
void parallel_run(std::size_t iter, std::size_t dim, Particle< T > &particle, double *r, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::auto_partitioner &partitioner,::tbb::task_group_context &context)
SizeType< StateBase > size_type
Definition: backend_tbb.hpp:70
void parallel_copy_run(const IntType *index, const ::tbb::blocked_range< size_type > &range, const ::tbb::auto_partitioner &partitioner,::tbb::task_group_context &context)
Move base dispatch class.
std::size_t parallel_run(Particle< T > &particle, void *param, const ::tbb::blocked_range< typename Particle< T >::size_type > &range,::tbb::affinity_partitioner &partitioner)
std::size_t parallel_run(Particle< T > &particle, void *param, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::simple_partitioner &partitioner)
void parallel_copy_run(const IntType *index, const ::tbb::blocked_range< size_type > &range, const ::tbb::simple_partitioner &partitioner)
typename Particle< T >::size_type size_type
Particle::value_type subtype using Intel Threading Building Blocks.
Definition: backend_tbb.hpp:67
typename SizeTypeTrait< T >::type SizeType
Definition: traits.hpp:212
std::size_t parallel_run(Particle< T > &particle, void *param, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::auto_partitioner &partitioner)
void parallel_copy_run(const IntType *index, const ::tbb::blocked_range< size_type > &range,::tbb::affinity_partitioner &partitioner)
void join(const work_type &other)
size_type size() const
Number of particles.
Definition: particle.hpp:122
work_type(StateTBB< StateBase > *state, const IntType *index)
Definition: backend_tbb.hpp:85
std::size_t parallel_run(std::size_t iter, Particle< T > &particle, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::auto_partitioner &partitioner,::tbb::task_group_context &context)
#define VSMC_DEFINE_SMP_BACKEND_SPECIAL(SMP, Name)
std::size_t parallel_run(std::size_t iter, Particle< T > &particle, const ::tbb::blocked_range< typename Particle< T >::size_type > &range)
std::size_t operator()(Particle< T > &particle, void *param)
void parallel_copy_run(const IntType *index, const ::tbb::blocked_range< size_type > &range,::tbb::affinity_partitioner &partitioner,::tbb::task_group_context &context)
typename Particle< T >::size_type size_type
Initialize base dispatch class.
void parallel_run(std::size_t iter, std::size_t dim, Particle< T > &particle, double *r, const ::tbb::blocked_range< typename Particle< T >::size_type > &range, const ::tbb::auto_partitioner &partitioner)