#include <threads.h>
Public Types | |
typedef T | const_iterator |
Public Member Functions | |
BlockedRange (const unsigned int new_grainsize=1000) | |
BlockedRange (const const_iterator first, const const_iterator last, const unsigned int new_grainsize=1000) | |
BlockedRange (const BlockedRange< T > &r) | |
BlockedRange (BlockedRange< T > &r, Threads::split) | |
void | reset (const const_iterator first, const const_iterator last) |
const_iterator | begin () const |
const_iterator | end () const |
unsigned int | grainsize () const |
void | grainsize (const unsigned int &gs) |
int | size () const |
bool | empty () const |
bool | is_divisible () const |
Private Attributes | |
const_iterator | _end |
const_iterator | _begin |
unsigned int | _grainsize |
Blocked range which can be subdivided and executed in parallel.
typedef T libMesh::Threads::BlockedRange< T >::const_iterator |
Allows an StoredRange
to behave like an STL container.
|
inlineexplicit |
|
inline |
Constructor. Takes the beginning and end of the range. Optionally takes the grainsize
parameter, which is the smallest chunk the range may be broken into for parallel execution.
Definition at line 144 of file threads.h.
References libMesh::Threads::BlockedRange< T >::reset().
|
inline |
Copy constructor. The StoredRange
can be copied into subranges for parallel execution. In this way the initial StoredRange
can be thought of as the root of a binary tree. The root element is the only element which interacts with the user. It takes a specified range of objects and packs it into a contiguous vector which can be split efficiently. However, there is no need for the child ranges to contain this vector, so long as the parent outlives the children. So we implement the copy constructor to specifically omit the _objs
vector.
Definition at line 165 of file threads.h.
|
inline |
Splits the range r
. The first half of the range is left in place, the second half of the range is placed in *this.
Definition at line 176 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin, and libMesh::Threads::BlockedRange< T >::_end.
|
inline |
Beginning of the range.
Definition at line 202 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin.
|
inline |
true
if the range is empty. Definition at line 232 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin, and libMesh::Threads::BlockedRange< T >::_end.
|
inline |
End of the range.
Definition at line 207 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_end.
|
inline |
The grain size for the range. The range will be subdivided into subranges not to exceed the grain size.
Definition at line 213 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_grainsize.
Referenced by libMesh::Threads::BlockedRange< T >::is_divisible().
|
inline |
Set the grain size.
Definition at line 218 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_grainsize.
|
inline |
true
if the range can be subdivided. Definition at line 237 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin, libMesh::Threads::BlockedRange< T >::_end, and libMesh::Threads::BlockedRange< T >::grainsize().
|
inline |
Resets the StoredRange
to contain [first,last).
Definition at line 192 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin, and libMesh::Threads::BlockedRange< T >::_end.
Referenced by libMesh::Threads::BlockedRange< T >::BlockedRange().
|
inline |
Definition at line 223 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin, and libMesh::Threads::BlockedRange< T >::_end.
|
private |
Definition at line 242 of file threads.h.
Referenced by libMesh::Threads::BlockedRange< T >::begin(), libMesh::Threads::BlockedRange< T >::BlockedRange(), libMesh::Threads::BlockedRange< T >::empty(), libMesh::Threads::BlockedRange< T >::is_divisible(), libMesh::Threads::BlockedRange< T >::reset(), and libMesh::Threads::BlockedRange< T >::size().
|
private |
Definition at line 241 of file threads.h.
Referenced by libMesh::Threads::BlockedRange< T >::BlockedRange(), libMesh::Threads::BlockedRange< T >::empty(), libMesh::Threads::BlockedRange< T >::end(), libMesh::Threads::BlockedRange< T >::is_divisible(), libMesh::Threads::BlockedRange< T >::reset(), and libMesh::Threads::BlockedRange< T >::size().
|
private |
Definition at line 243 of file threads.h.
Referenced by libMesh::Threads::BlockedRange< T >::grainsize().