T13_Buf< OutStreamBuf, AutoInternBuf > Class Template Reference

List of all members.

Public Member Functions

void main (void)
 T13_Buf ()
 The pool of buffers must be set at the maximum size.

Private Types

typedef OutStreamBuf::char_type char_type
typedef rpa::orow_iterator<
DataOut, OutStreamBuf > 
OStrItPubT
typedef std::vector< AutoInternBuf > AutoIntBufVec

Private Member Functions

template<class InputRange, class ThrTree>
void tstInput (size_t aSz, ThrTree aThrTree, InputRange aRange)
template<class InputIter, class ThrTree>
void tstNbThrs (InputIter aBeg, InputIter aEnd, size_t aNb, ThrTree aThrTree)
template<class InputIter>
void tstNbElts (InputIter aBeg, InputIter aEnd, size_t aNbElems)

Static Private Member Functions

static std::ostream & info (std::ostream &oStrm)
 Simpy returns an information string for displaying.

Private Attributes

AutoIntBufVec myVecBufStream
 This is used as a pool of output buffers.

Detailed Description

template<class OutStreamBuf, class AutoInternBuf>
class T13_Buf< OutStreamBuf, AutoInternBuf >

This contains all steps levels of this program : Instantiation on different data types, various run-type parameters. 'OutStreamBuf' is the kind of output stream where results are written to. 'InternBuf' is the datatype internally used by 'obuf_iterator'.


Member Typedef Documentation

template<class OutStreamBuf, class AutoInternBuf>
typedef std::vector< AutoInternBuf > T13_Buf< OutStreamBuf, AutoInternBuf >::AutoIntBufVec [private]

This is a pool for per-thread buffers. There can be one and only one buffer per active sub-thread. The access modes of these buffers are :

template<class OutStreamBuf, class AutoInternBuf>
typedef OutStreamBuf::char_type T13_Buf< OutStreamBuf, AutoInternBuf >::char_type [private]

template<class OutStreamBuf, class AutoInternBuf>
typedef rpa::orow_iterator< DataOut, OutStreamBuf > T13_Buf< OutStreamBuf, AutoInternBuf >::OStrItPubT [private]

This data structure is defined in rpa/containers/record.h. It allows to bufferize output streams.


Constructor & Destructor Documentation

template<class OutStreamBuf, class AutoInternBuf>
T13_Buf< OutStreamBuf, AutoInternBuf >::T13_Buf (  )  [inline]

The pool of buffers must be set at the maximum size.


Member Function Documentation

template<class OutStreamBuf, class AutoInternBuf>
static std::ostream& T13_Buf< OutStreamBuf, AutoInternBuf >::info ( std::ostream &  oStrm  )  [inline, static, private]

Simpy returns an information string for displaying.

template<class OutStreamBuf, class AutoInternBuf>
void T13_Buf< OutStreamBuf, AutoInternBuf >::main ( void   )  [inline]

Does all tests for a given internal buffer type. It tries different input types, with different sizes.

As usual, creates a big buffer of input data, all different. Then, various tries based on the number of elements. The number of elements is multiplied by sixty-four at each loop.

template<class OutStreamBuf, class AutoInternBuf>
template<class InputRange, class ThrTree>
void T13_Buf< OutStreamBuf, AutoInternBuf >::tstInput ( size_t  aSz,
ThrTree  aThrTree,
InputRange  aRange 
) [inline, private]

The input range is copied at each use. This is necessary because it is modified at execution. Tries various configurations of obuf_iterator into streams.

Buffering of unlimited size. At the end of the execution of each sub-thread, all thread-specific buffers are merged to the output iterator.

For writing the results with a std::ostream_iterator. Some buffer types have no default constructor, therefore we must use a function that will return a valid pointer.

Writing through unlimited-size buffers. Instead of allocating the buffers on the stack, the calling program gives a pool of pre-allocated buffers (Pool of buffers).

For writing the results with a std::ostream_iterator. Some buffer types have no default constructor, therefore we must use a function that will return a valid pointer.

This mutex protects the output ostream iterator when each sub-thread periodically flushes its specific buffer into it.

This static array gives various buffers sizes to test.

Limited size buffering. Tries with several sizes.

For writing the results with a std::ostream_iterator. Some buffer types have no default constructor, therefore we must use a function that will return a valid pointer.

This is the output iterator type : Fixed-buffer size, without already allocated buffer : They will be on the stack.

Suspiscion that it does not work properly with CR.

The input and output delimiters must be ALWAYS identical.

To shorten this test, we 'reinject' the output iterator.

For writing the results with a std::ostream_iterator. Some buffer types have no default constructor, therefore we must use a function that will return a valid pointer.

This is the output iterator type : Fixed-buffer size, with a set of already allocated buffer (One per thread).

The original delimiter (Without copy) is returned.

template<class OutStreamBuf, class AutoInternBuf>
template<class InputIter>
void T13_Buf< OutStreamBuf, AutoInternBuf >::tstNbElts ( InputIter  aBeg,
InputIter  aEnd,
size_t  aNbElems 
) [inline, private]

Do all tests for given input container type, and number of input elements. Internally, it tries different thread types.

Starts the tests with different number of threads. The number of used threads is multiplied by two at each loop : This allows to make more extreme testing at a reduced CPU cost.

In debug mode, this thread is a 'fake' thread, totally serialized.

template<class OutStreamBuf, class AutoInternBuf>
template<class InputIter, class ThrTree>
void T13_Buf< OutStreamBuf, AutoInternBuf >::tstNbThrs ( InputIter  aBeg,
InputIter  aEnd,
size_t  aNb,
ThrTree  aThrTree 
) [inline, private]

Given an input iterator type, a elements number, and a thread tree, this tests use different kind of input ranges, that is, different kind of scheduling policies (Plus variations on run-time parameters).

The number of steps is divided by two at each loop. If the number of elements is small, we will try with small steps, otherwise bigger steps. Otherwise, the tests take ages to run.

Dynamic scheduling with atomic synchronization.

Dynamic scheduling with mutex synchronization.

Interleaved scheduling.


Member Data Documentation

template<class OutStreamBuf, class AutoInternBuf>
AutoIntBufVec T13_Buf< OutStreamBuf, AutoInternBuf >::myVecBufStream [private]

This is used as a pool of output buffers.


The documentation for this class was generated from the following file:
Generated on Tue Sep 25 10:20:31 2007 for rpa by  doxygen 1.4.7