MTMCSim  0.5
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
MTMCSim::MTMCScheduler Class Reference

Multithread Monte Carlo Simulator Boss-Worker model scheduler. More...

#include <MTMCScheduler.h>

Public Member Functions

 MTMCScheduler (unsigned int nRunThreads_, unsigned int RNQSize, boost::shared_ptr< MTMCSimBase > simulator)
 
 MTMCScheduler ()
 The default constructor does nothing. More...
 
void genRN ()
 Generates the random number sequences and put into the queue. More...
 
void oneThreadSimu (MCThreadInfo threadInfo)
 Each worker thread call this function to work. More...
 
void start ()
 Start simulation. More...
 
void setSimulator (boost::shared_ptr< MTMCSimBase > simulator_)
 
void setNRunThreads (unsigned int nRunThreads_)
 
void setRNQSize (unsigned int RNQSize_)
 

Detailed Description

Multithread Monte Carlo Simulator Boss-Worker model scheduler.

In general, the Monte Carlo Simulation computes E[Y], Y = f(X), and X is the random sequence driving the simulation. The scheduler runs in the boss worker model, i.e., one thread generates random sequences X and several threads computes f(X) and obtain the samples of Y. Between the boss and the worker, there is a queue as a buffer of the random sequences. The simulator should be derived classes of the abstract calss MTMCSimBase

This model is suitable when the computation of the function f() is high. Usually this is the case in coding theory. In particular, in coding theory, X is the random sequences, f() contains encoding, channel effect if there is any, decoding. Y = 1 if the frame is in error after decoding so E[Y] = probably of error. This is a top level description of Monte Carlo. The X and Y here and X, Y in the multistage LDPC DSC are different.(There, they are source sequences and they corresponds to the X here.

Constructor & Destructor Documentation

MTMCSim::MTMCScheduler::MTMCScheduler ( unsigned int  nRunThreads_,
unsigned int  RNQSize,
boost::shared_ptr< MTMCSimBase simulator 
)
Parameters
nRunThreads_The number of running threads (workers)
RNQSizeThe size of the random number queue
simulatorThe (smart) pointer to the simulator object
MTMCSim::MTMCScheduler::MTMCScheduler ( )
inline

The default constructor does nothing.

Should call setSimulator, setNRunThreads and setRNQSize before calling start().

Member Function Documentation

void MTMCSim::MTMCScheduler::genRN ( )

Generates the random number sequences and put into the queue.

void MTMCSim::MTMCScheduler::oneThreadSimu ( MCThreadInfo  threadInfo)

Each worker thread call this function to work.

void MTMCSim::MTMCScheduler::setNRunThreads ( unsigned int  nRunThreads_)
inline
void MTMCSim::MTMCScheduler::setRNQSize ( unsigned int  RNQSize_)
inline
void MTMCSim::MTMCScheduler::setSimulator ( boost::shared_ptr< MTMCSimBase simulator_)
inline
void MTMCSim::MTMCScheduler::start ( )

Start simulation.


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