Deterministic implementation of ParallelFor. More...
Public Member Functions | |
| TBBDeterministicParallelFor (TBBTaskImplementation *impl, const TBBParallelFor &tbb_for, Integer begin_index, Integer size, Integer grain_size, Integer nb_thread) | |
| void | operator() (tbb::blocked_range< Integer > &range) const |
| Operator for a given thread. | |
| void | _doBlock (Integer task_id, Integer block_id) const |
Deterministic implementation of ParallelFor.
The implementation is deterministic in the sense that it only depends on the iteration interval (m_begin_index and m_size), the specified number of threads (m_nb_thread), and the grain size (m_grain_size).
The algorithm used is similar to the one used by OpenMP for a parallel for with the static option: the iteration interval is divided into several blocks and each block is assigned to a task based on a round-robin algorithm. To determine the number of blocks, two cases are possible:
Definition at line 773 of file TBBTaskImplementation.cc.
|
inline |
Definition at line 777 of file TBBTaskImplementation.cc.
|
inline |
Definition at line 842 of file TBBTaskImplementation.cc.
|
inline |
Operator for a given thread.
Generally, range.size() will be one, because a thread will only process one iteration, but this is not guaranteed by TBB.
Definition at line 829 of file TBBTaskImplementation.cc.