Reference documentation for deal.II version 8.1.0
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
WorkStream::internal::Implementation3::IteratorRangeToItemStream< Iterator, ScratchData, CopyData > Class Template Reference

#include <work_stream.h>

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

Classes

struct  ItemType
 

Public Member Functions

 IteratorRangeToItemStream (const typename std::vector< Iterator >::const_iterator &begin, const typename std::vector< Iterator >::const_iterator &end, const unsigned int buffer_size, const unsigned int chunk_size, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data)
 
virtual void * operator() (void *)
 

Private Member Functions

void init_buffer_elements (const unsigned int element)
 

Private Attributes

std::pair< typename std::vector< Iterator >::const_iterator, typename std::vector< Iterator >::const_iterator > remaining_iterator_range
 
std::vector< ItemTypeitem_buffer
 
Threads::ThreadLocalStorage< typename ItemType::ScratchAndCopyDataListthread_local_scratch_and_copy
 
const ScratchData & sample_scratch_data
 
const CopyData & sample_copy_data
 
const unsigned int chunk_size
 

Detailed Description

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

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

Definition at line 727 of file work_stream.h.

Constructor & Destructor Documentation

template<typename Iterator, typename ScratchData, typename CopyData>
WorkStream::internal::Implementation3::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::IteratorRangeToItemStream ( const typename std::vector< Iterator >::const_iterator &  begin,
const typename std::vector< Iterator >::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 range of iterators into an array of the kind of object we want to loop over, 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 848 of file work_stream.h.

Member Function Documentation

template<typename Iterator, typename ScratchData, typename CopyData>
virtual void* WorkStream::internal::Implementation3::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::operator() ( void *  )
inlinevirtual

Create an item and return a pointer to it.

Definition at line 886 of file work_stream.h.

template<typename Iterator, typename ScratchData, typename CopyData>
void WorkStream::internal::Implementation3::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::init_buffer_elements ( const unsigned int  element)
inlineprivate

Initialize the pointers and vector elements in the specified entry of the item_buffer.

Definition at line 986 of file work_stream.h.

Member Data Documentation

template<typename Iterator, typename ScratchData, typename CopyData>
std::pair<typename std::vector<Iterator>::const_iterator,typename std::vector<Iterator>::const_iterator> WorkStream::internal::Implementation3::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::remaining_iterator_range
private

The interval of iterators still to be worked on. This range will shrink over time.

Definition at line 937 of file work_stream.h.

template<typename Iterator, typename ScratchData, typename CopyData>
std::vector<ItemType> WorkStream::internal::Implementation3::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::item_buffer
private

A buffer that will store items.

Definition at line 942 of file work_stream.h.

template<typename Iterator, typename ScratchData, typename CopyData>
Threads::ThreadLocalStorage<typename ItemType::ScratchAndCopyDataList> WorkStream::internal::Implementation3::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::thread_local_scratch_and_copy
private

Pointer to a thread local variable identifying the scratch and copy data objects each thread will use. The same is true as discussed for the implementation in the Implementation2::IteratorRangeToItemStream class and the paper by Turcksin, Kronbichler and Bangerth (see workstream_paper).

Definition at line 951 of file work_stream.h.

template<typename Iterator, typename ScratchData, typename CopyData>
const ScratchData& WorkStream::internal::Implementation3::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::sample_scratch_data
private

A reference to a sample scratch data that will be used to initialize the thread-local pointers to a scratch data object each of the worker tasks uses.

Definition at line 958 of file work_stream.h.

template<typename Iterator, typename ScratchData, typename CopyData>
const CopyData& WorkStream::internal::Implementation3::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::sample_copy_data
private

A reference to a sample scratch data that will be used to initialize the thread-local pointers to a scratch data object each of the worker tasks uses.

Definition at line 965 of file work_stream.h.

template<typename Iterator, typename ScratchData, typename CopyData>
const unsigned int WorkStream::internal::Implementation3::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 979 of file work_stream.h.


The documentation for this class was generated from the following file: