libMesh::Threads::BlockedRange< T > Class Template Reference
#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 |
Detailed Description
template<typename T>
class libMesh::Threads::BlockedRange< T >
Blocked range which can be subdivided and executed in parallel.
Definition at line 439 of file threads.h.
Member Typedef Documentation
| typedef T libMesh::Threads::BlockedRange< T >::const_iterator |
Allows an StoredRange to behave like an STL container.
Constructor & Destructor Documentation
| libMesh::Threads::BlockedRange< T >::BlockedRange | ( | const unsigned int | new_grainsize = 1000 |
) | [inline, explicit] |
Constructor. Optionally takes the grainsize parameter, which is the smallest chunk the range may be broken into for parallel execution.
Definition at line 452 of file threads.h.
00452 : 00453 _grainsize(new_grainsize) 00454 {}
| libMesh::Threads::BlockedRange< T >::BlockedRange | ( | const const_iterator | first, | |
| const const_iterator | last, | |||
| const unsigned int | new_grainsize = 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.
Definition at line 462 of file threads.h.
References libMesh::Threads::BlockedRange< T >::reset().
00464 : 00465 _grainsize(new_grainsize) 00466 { 00467 this->reset(first, last); 00468 }
| libMesh::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.
Definition at line 483 of file threads.h.
00483 : 00484 _end(r._end), 00485 _begin(r._begin), 00486 _grainsize(r._grainsize) 00487 {}
| libMesh::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 494 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin, and libMesh::Threads::BlockedRange< T >::_end.
00494 : 00495 _end(r._end), 00496 _begin(r._begin), 00497 _grainsize(r._grainsize) 00498 { 00499 const_iterator 00500 beginning = r._begin, 00501 ending = r._end, 00502 middle = beginning + (ending - beginning)/2u; 00503 00504 r._end = _begin = middle; 00505 }
Member Function Documentation
| const_iterator libMesh::Threads::BlockedRange< T >::begin | ( | ) | const [inline] |
Beginning of the range.
Definition at line 520 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin.
00520 { return _begin; }
| bool libMesh::Threads::BlockedRange< T >::empty | ( | ) | const [inline] |
Returns true if the range is empty.
Definition at line 550 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin, and libMesh::Threads::BlockedRange< T >::_end.
| const_iterator libMesh::Threads::BlockedRange< T >::end | ( | ) | const [inline] |
End of the range.
Definition at line 525 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_end.
00525 { return _end; }
| void libMesh::Threads::BlockedRange< T >::grainsize | ( | const unsigned int & | gs | ) | [inline] |
Set the grain size.
Definition at line 536 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_grainsize.
00536 {_grainsize = gs;}
| unsigned int libMesh::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 531 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_grainsize.
Referenced by libMesh::Threads::BlockedRange< T >::is_divisible().
00531 {return _grainsize;}
| bool libMesh::Threads::BlockedRange< T >::is_divisible | ( | ) | const [inline] |
Returns true if the range can be subdivided.
Definition at line 555 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin, libMesh::Threads::BlockedRange< T >::_end, and libMesh::Threads::BlockedRange< T >::grainsize().
| void libMesh::Threads::BlockedRange< T >::reset | ( | const const_iterator | first, | |
| const const_iterator | last | |||
| ) | [inline] |
Resets the StoredRange to contain [first,last).
Definition at line 510 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin, and libMesh::Threads::BlockedRange< T >::_end.
Referenced by libMesh::Threads::BlockedRange< T >::BlockedRange().
| int libMesh::Threads::BlockedRange< T >::size | ( | ) | const [inline] |
- Returns:
- the size of the range.
Definition at line 541 of file threads.h.
References libMesh::Threads::BlockedRange< T >::_begin, and libMesh::Threads::BlockedRange< T >::_end.
Member Data Documentation
const_iterator libMesh::Threads::BlockedRange< T >::_begin [private] |
Definition at line 560 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().
const_iterator libMesh::Threads::BlockedRange< T >::_end [private] |
Definition at line 559 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().
unsigned int libMesh::Threads::BlockedRange< T >::_grainsize [private] |
Definition at line 561 of file threads.h.
Referenced by libMesh::Threads::BlockedRange< T >::grainsize().
The documentation for this class was generated from the following file:
Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:49 UTC
Hosted By: