T15_Buf< OutStrmBuf, InternBuf > Class Template Reference

List of all members.

Public Member Functions

template<class IntrnStrmBuf>
void main_streambuf (IntrnStrmBuf *aStrmBuf)
void main (void)

Private Types

typedef OutStrmBuf::char_type char_type
typedef rpa::orow_iterator<
DataOut, OutStrmBuf > 
OStrItPubT
typedef InternBuf VecIntrnBuf [myNbThr]

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)

Private Attributes

VecIntrnBuf myVecBufStream

Detailed Description

template<class OutStrmBuf, class InternBuf>
class T15_Buf< OutStrmBuf, InternBuf >

This contains all steps levels of this program : Instanciation on different data types, various run-type parameters. 'OutStrmBuf' 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 OutStrmBuf, class InternBuf>
typedef OutStrmBuf::char_type T15_Buf< OutStrmBuf, InternBuf >::char_type [private]

template<class OutStrmBuf, class InternBuf>
typedef rpa::orow_iterator< DataOut, OutStrmBuf > T15_Buf< OutStrmBuf, InternBuf >::OStrItPubT [private]

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

template<class OutStrmBuf, class InternBuf>
typedef InternBuf T15_Buf< OutStrmBuf, InternBuf >::VecIntrnBuf[myNbThr] [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 :


Member Function Documentation

template<class OutStrmBuf, class InternBuf>
void T15_Buf< OutStrmBuf, InternBuf >::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 four at each loop. We can use any kind of iterator as input.

template<class OutStrmBuf, class InternBuf>
template<class IntrnStrmBuf>
void T15_Buf< OutStrmBuf, InternBuf >::main_streambuf ( IntrnStrmBuf *  aStrmBuf  )  [inline]

Creation and opening of temporary files. This is only when testing with row_buffer.

At this stage, the internal buffers are already created. They have the type 'row_buffer' : They can safely be associated with existing file stream buffers.

Plain call, with non-row_buffer, ready-to-use buffers.

It is not necessary to deassociate the row_buffer from the external buffers : This is safely done at destruction time.

template<class OutStrmBuf, class InternBuf>
template<class InputRange, class ThrTree>
void T15_Buf< OutStrmBuf, InternBuf >::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.

Writing through unlimited-size buffers. Instead of allocating the buffers on the stack, the calling program gives a pool of pre-allocated 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, with a set of already allocated buffer (One per thread).

template<class OutStrmBuf, class InternBuf>
template<class InputIter>
void T15_Buf< OutStrmBuf, InternBuf >::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.

template<class OutStrmBuf, class InternBuf>
template<class InputIter, class ThrTree>
void T15_Buf< OutStrmBuf, InternBuf >::tstNbThrs ( InputIter  aBeg,
InputIter  aEnd,
size_t  aNb,
ThrTree  aThrTree 
) [inline, private]

Given an input iterator type, a number of elements, and a thread tree, this tests using 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 very small steps, otherwise bigger steps. Otherwise, the tests would take ages to run.

We skip these tests for the moment because they are not very significant because we have to simulate the atomicity anyway.

Dynamic scheduling with mutex synchronization.

Interleaved scheduling.


Member Data Documentation

template<class OutStrmBuf, class InternBuf>
VecIntrnBuf T15_Buf< OutStrmBuf, InternBuf >::myVecBufStream [private]

This is used as a pool of output buffers. There are not able to open themselves automatically, so we must loop upon them.


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