Public Types | Public Member Functions | Private Member Functions | Private Attributes

WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData > Class Template Reference

Inheritance diagram for WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std_cxx1x::tuple
< std::vector< Iterator >
, ScratchData *, std::vector
< CopyData >, unsigned int > 
ItemType

Public Member Functions

 IteratorRangeToItemStream (const Iterator &begin, const Iterator &end, const unsigned int buffer_size, const unsigned int chunk_size, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data)
 ~IteratorRangeToItemStream ()
virtual void * operator() (void *)

Private Member Functions

void init_buffer_elements (const unsigned int element, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data)

Private Attributes

std::pair< Iterator, Iterator > remaining_iterator_range
std::vector< ItemTypering_buffer
unsigned int n_emitted_items
const unsigned int chunk_size

Detailed Description

template<typename Iterator, typename ScratchData, typename CopyData>
class WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >

A class that creates a sequence of items from a range of iterators.

Definition at line 140 of file work_stream.h.


Member Typedef Documentation

template<typename Iterator, typename ScratchData, typename CopyData>
typedef std_cxx1x::tuple<std::vector<Iterator>, ScratchData*, std::vector<CopyData>, unsigned int> WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::ItemType

A data type that we use to identify items to be worked on.

The first element indicates an array of iterators to work on; the second the scratch space; the third an array of copy data spaces; and the last the number of elements to work on. This last argument is an integer between one and chunk_size. The arrays have a length of chunk_size.

Definition at line 161 of file work_stream.h.


Constructor & Destructor Documentation

template<typename Iterator, typename ScratchData, typename CopyData>
WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::IteratorRangeToItemStream ( const Iterator &  begin,
const Iterator &  end,
const unsigned int  buffer_size,
const unsigned int  chunk_size,
const ScratchData &  sample_scratch_data,
const CopyData &  sample_copy_data 
) [inline]

Constructor. Take an iterator range, the size of a buffer that can hold items, and the sample additional data object that will be passed to each worker and copier function invokation.

Definition at line 172 of file work_stream.h.

References WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::init_buffer_elements(), Threads::TaskGroup< RT >::join_all(), Threads::new_task(), and WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::ring_buffer.

template<typename Iterator, typename ScratchData, typename CopyData>
WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::~IteratorRangeToItemStream (  ) [inline]

Member Function Documentation

template<typename Iterator, typename ScratchData, typename CopyData>
virtual void* WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::operator() ( void *   ) [inline, virtual]
template<typename Iterator, typename ScratchData, typename CopyData>
void WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::init_buffer_elements ( const unsigned int  element,
const ScratchData &  sample_scratch_data,
const CopyData &  sample_copy_data 
) [inline, private]

Member Data Documentation

template<typename Iterator, typename ScratchData, typename CopyData>
std::pair<Iterator,Iterator> WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::remaining_iterator_range [private]
template<typename Iterator, typename ScratchData, typename CopyData>
std::vector<ItemType> WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::ring_buffer [private]
template<typename Iterator, typename ScratchData, typename CopyData>
unsigned int WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::n_emitted_items [private]

Counter for the number of emitted items. Each item may consist of up to chunk_size iterator elements.

Definition at line 266 of file work_stream.h.

Referenced by WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::operator()().

template<typename Iterator, typename ScratchData, typename CopyData>
const unsigned int WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::chunk_size [private]

Number of elements of the iterator range that each thread should work on sequentially; a large number makes sure that each thread gets a significant amount of work before the next task switch happens, whereas a small number is better for load balancing.

Definition at line 280 of file work_stream.h.

Referenced by WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::init_buffer_elements(), and WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::operator()().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:18 by doxygen 1.7.2