template<typename T> class Threads::BlockedRange< T >
Blocked range which can be subdivided and executed in parallel.
Definition at line 304 of file threads.h.
Member Typedef Documentation
template<typename T> typedef T Threads::BlockedRange< T >::const_iteratorAllows an StoredRange to behave like an STL container.
Definition at line 310 of file threads.h.
Constructor & Destructor Documentation
template<typename T> Threads::BlockedRange< T >::BlockedRange (const unsigned intgrainsize = 1000) [inline]Constructor. Optionally takes the grainsize parameter, which is the smallest chunk the range may be broken into for parallel execution.
Definition at line 317 of file threads.h.
:
_grainsize(grainsize)
{}
template<typename T> Threads::BlockedRange< T >::BlockedRange (const const_iteratorfirst, const const_iteratorlast, const unsigned intgrainsize = 1000) [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.
template<typename T> Threads::BlockedRange< T >::BlockedRange (const BlockedRange< T > &r) [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.
template<typename T> Threads::BlockedRange< T >::BlockedRange (BlockedRange< T > &r, Threads::split) [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 359 of file threads.h.
References Threads::BlockedRange< T >::_begin, and Threads::BlockedRange< T >::_end.
template<typename T> const_iteratorThreads::BlockedRange< T >::begin () const [inline]Beginning of the range.
Definition at line 385 of file threads.h.
References Threads::BlockedRange< T >::_begin.
{ return _begin; }
template<typename T> bool Threads::BlockedRange< T >::empty () const [inline]Returns true if the range is empty.
Definition at line 415 of file threads.h.
References Threads::BlockedRange< T >::_begin, and Threads::BlockedRange< T >::_end.
{ return (_begin == _end); }
template<typename T> const_iteratorThreads::BlockedRange< T >::end () const [inline]End of the range.
Definition at line 390 of file threads.h.
References Threads::BlockedRange< T >::_end.
{ return _end; }
template<typename T> unsigned int Threads::BlockedRange< T >::grainsize () const [inline]The grain size for the range. The range will be subdivided into subranges not to exceed the grain size.
Definition at line 396 of file threads.h.
References Threads::BlockedRange< T >::_grainsize.
Referenced by Threads::BlockedRange< T >::is_divisible().
{return _grainsize;}
template<typename T> void Threads::BlockedRange< T >::grainsize (const unsigned int &gs) [inline]Set the grain size.
Definition at line 401 of file threads.h.
References Threads::BlockedRange< T >::_grainsize.
{_grainsize = gs;}
template<typename T> bool Threads::BlockedRange< T >::is_divisible () const [inline]Returns true if the range can be subdivided.
Definition at line 420 of file threads.h.
References Threads::BlockedRange< T >::_begin, Threads::BlockedRange< T >::_end, and Threads::BlockedRange< T >::grainsize().
{ return ((_begin + this->grainsize()) < _end); }
template<typename T> void Threads::BlockedRange< T >::reset (const const_iteratorfirst, const const_iteratorlast) [inline]Resets the StoredRange to contain [first,last).
Definition at line 375 of file threads.h.
References Threads::BlockedRange< T >::_begin, and Threads::BlockedRange< T >::_end.
Referenced by Threads::BlockedRange< T >::BlockedRange().
{
_begin = first;
_end = last;
}
template<typename T> int Threads::BlockedRange< T >::size () const [inline]Returns:
the size of the range.
Definition at line 406 of file threads.h.
References Threads::BlockedRange< T >::_begin, and Threads::BlockedRange< T >::_end.
{ return (_end -_begin); }
Member Data Documentation
template<typename T> const_iteratorThreads::BlockedRange< T >::_begin [private]
Definition at line 425 of file threads.h.
Referenced by Threads::BlockedRange< T >::begin(), Threads::BlockedRange< T >::BlockedRange(), Threads::BlockedRange< T >::empty(), Threads::BlockedRange< T >::is_divisible(), Threads::BlockedRange< T >::reset(), and Threads::BlockedRange< T >::size().
template<typename T> const_iteratorThreads::BlockedRange< T >::_end [private]
Definition at line 424 of file threads.h.
Referenced by Threads::BlockedRange< T >::BlockedRange(), Threads::BlockedRange< T >::empty(), Threads::BlockedRange< T >::end(), Threads::BlockedRange< T >::is_divisible(), Threads::BlockedRange< T >::reset(), and Threads::BlockedRange< T >::size().
template<typename T> unsigned int Threads::BlockedRange< T >::_grainsize [private]
Definition at line 426 of file threads.h.
Referenced by Threads::BlockedRange< T >::grainsize().
Author
Generated automatically by Doxygen for libMesh from the source code.