Fennel: ExecStreamScheduler Class Reference (original) (raw)

ExecStreamScheduler defines an abstract base for controlling the scheduling of execution streams. More...

#include <[ExecStreamScheduler.h](ExecStreamScheduler%5F8h-source.html)>

Inheritance diagram for ExecStreamScheduler:

List of all members.

Public Member Functions
virtual ~ExecStreamScheduler ()
virtual void traceStreamBufferContents (ExecStream &stream, ExecStreamBufAccessor &bufAccessor, TraceLevel traceLevel)
Traces the contents of a stream buffer.
virtual void addGraph (SharedExecStreamGraph pGraph)
Adds a graph to be scheduled.
virtual void removeGraph (SharedExecStreamGraph pGraph)
Removes a graph currently being scheduled.
virtual void start ()=0
Starts this scheduler, preparing it to execute streams.
void makeRunnable (ExecStream &stream)
Requests that a specific stream be considered for execution.
virtual void setRunnable (ExecStream &stream, bool runnable)=0
Sets whether that a specific stream should be considered for execution.
virtual void abort (ExecStreamGraph &graph)=0
Asynchronously aborts execution of any scheduled streams contained by a particular graph and prevents further scheduling.
virtual void checkAbort () const
Checks whether there is an abort request for this scheduler, and if so, throws an AbortExcn.
virtual void stop ()=0
Shuts down this scheduler, preventing any further streams from being scheduled.
virtual SharedExecStreamBufAccessor newBufAccessor ()
Creates a new ExecStreamBufAccessor suitable for use with this scheduler.
virtual void createBufferProvisionAdapter (ExecStreamEmbryo &embryo)
Creates a new adapter stream capable of buffering the output of a stream with BUFPROV_CONSUMER for use as input to a stream with BUFPROV_PRODUCER.
virtual void createCopyProvisionAdapter (ExecStreamEmbryo &embryo)
Creates a new adapter stream capable of copying the output of a stream with BUFPROV_PRODUCER into the input of a stream with BUFPROV_CONSUMER.
virtual ExecStreamBufAccessor & readStream (ExecStream &stream)=0
Reads data from a stream, first performing any scheduling necessary to make output available.
virtual uint getDegreeOfParallelism ()
**Returns:**the degree of parallelism implemented by this scheduler, or 1 for a non-parallel scheduler
virtual void initTraceSource (SharedTraceTarget pTraceTarget, std::string name)
For use when initialization has to be deferred until after construction.
void trace (TraceLevel level, std::string message) const
Records a trace message.
bool isTracing () const
**Returns:**true iff tracing is enabled for this source
bool isTracingLevel (TraceLevel level) const
Determines whether a particular level is being traced.
TraceTarget & getTraceTarget () const
**Returns:**the TraceTarget for this source
SharedTraceTarget getSharedTraceTarget () const
**Returns:**the SharedTraceTarget for this source
std::string getTraceSourceName () const
Gets the name of this source.
void setTraceSourceName (std::string const &n)
Sets the name of this source.
TraceLevel getMinimumTraceLevel () const
void disableTracing ()
Protected Member Functions
ExecStreamScheduler (SharedTraceTarget pTraceTarget, std::string name)
Constructs a new ExecStreamScheduler.
ExecStreamResult executeStream (ExecStream &stream, ExecStreamQuantum const &quantum)
Executes one stream, performing tracing if enabled.
virtual void tracePreExecution (ExecStream &stream, ExecStreamQuantum const &quantum)
Traces before execution of a stream.
virtual void tracePostExecution (ExecStream &stream, ExecStreamResult rc)
Traces after execution of a stream.
virtual void traceStreamBuffers (ExecStream &stream, TraceLevel inputTupleTraceLevel, TraceLevel outputTupleTraceLevel)
Traces the states of the input and output buffers adjacent to a stream.
Protected Attributes
bool tracingFine

Detailed Description

ExecStreamScheduler defines an abstract base for controlling the scheduling of execution streams.

A scheduler determines which execution streams to run and in what order. For more information, see SchedulerDesign.

Version:

Id

//open/dev/fennel/exec/ExecStreamScheduler.h#17

Definition at line 42 of file ExecStreamScheduler.h.


Constructor & Destructor Documentation

ExecStreamScheduler::ExecStreamScheduler ( SharedTraceTarget pTraceTarget,
std::string name
) [explicit, protected]

| ExecStreamScheduler::~ExecStreamScheduler | ( | | ) | [virtual] | | ------------------------------------------ | - | | - | ----------- |


Member Function Documentation

void ExecStreamScheduler::traceStreamBuffers ( ExecStream & stream,
TraceLevel inputTupleTraceLevel,
TraceLevel outputTupleTraceLevel
) [protected, virtual]

Traces the states of the input and output buffers adjacent to a stream.

Parameters:

stream stream whose buffers are to be traced
inputTupleTraceLevel trace level at which tuple contents of input buffers are to be traced
outputTupleTraceLevel trace level at which tuple contents of output buffers are to be traced

Definition at line 140 of file ExecStreamScheduler.cpp.

References ExecStreamBufState_names, ExecStreamGraphImpl::getBufAccessorFromEdge(), ExecStreamBufAccessor::getConsumptionAvailable(), ExecStream::getGraph(), ExecStreamGraphImpl::getGraphRep(), ExecStreamBufAccessor::getProductionAvailable(), ExecStreamBufAccessor::getState(), ExecStream::getStreamId(), ExecStreamBufAccessor::hasPendingEOS(), TraceSource::isTracingLevel(), TRACE_FINER, and traceStreamBufferContents().

Referenced by tracePostExecution(), and tracePreExecution().

00144 { 00145 ExecStreamGraphImpl &graphImpl = 00146 dynamic_cast<ExecStreamGraphImpl&>(stream.getGraph()); 00147 ExecStreamGraphImpl::GraphRep const &graphRep = graphImpl.getGraphRep(); 00148 00149 ExecStreamGraphImpl::InEdgeIterPair inEdges = 00150 boost::in_edges(stream.getStreamId(),graphRep); 00151 for (uint i = 0; inEdges.first != inEdges.second; 00152 ++(inEdges.first), ++i) 00153 { 00154 ExecStreamGraphImpl::Edge edge = *(inEdges.first); 00155 ExecStreamBufAccessor &bufAccessor = 00156 graphImpl.getBufAccessorFromEdge(edge); 00157 FENNEL_TRACE( 00158 TRACE_FINER, 00159 "input buffer " << i << ": " 00160 << ExecStreamBufState_names[bufAccessor.getState()] 00161 << (bufAccessor.hasPendingEOS() ? ", EOS pending" : "") 00162 << ", consumption available = " 00163 << bufAccessor.getConsumptionAvailable()); 00164 if (stream.isTracingLevel(inputTupleTraceLevel)) { 00165 traceStreamBufferContents( 00166 stream, bufAccessor, inputTupleTraceLevel); 00167 } 00168 } 00169 00170 ExecStreamGraphImpl::OutEdgeIterPair outEdges = 00171 boost::out_edges(stream.getStreamId(),graphRep); 00172 for (uint i = 0; outEdges.first != outEdges.second; 00173 ++(outEdges.first), ++i) { 00174 ExecStreamGraphImpl::Edge edge = *(outEdges.first); 00175 ExecStreamBufAccessor &bufAccessor = 00176 graphImpl.getBufAccessorFromEdge(edge); 00177 FENNEL_TRACE( 00178 TRACE_FINER, 00179 "output buffer " << i << ": " 00180 << ExecStreamBufState_names[bufAccessor.getState()] 00181 << (bufAccessor.hasPendingEOS() ? ", EOS pending" : "") 00182 << ", consumption available = " 00183 << bufAccessor.getConsumptionAvailable() 00184 << ", production available = " 00185 << bufAccessor.getProductionAvailable()); 00186 if (stream.isTracingLevel(outputTupleTraceLevel)) { 00187 traceStreamBufferContents( 00188 stream, bufAccessor, outputTupleTraceLevel); 00189 } 00190 } 00191 }

| virtual void ExecStreamScheduler::start | ( | | ) | [pure virtual] | | --------------------------------------- | - | | - | ---------------- |

void ExecStreamScheduler::makeRunnable ( ExecStream & stream ) [inline]
virtual void ExecStreamScheduler::setRunnable ( ExecStream & stream,
bool runnable
) [pure virtual]
virtual void ExecStreamScheduler::abort ( ExecStreamGraph & graph ) [pure virtual]

Asynchronously aborts execution of any scheduled streams contained by a particular graph and prevents further scheduling.

Returns immediately, not waiting for abort request to be fully processed.

Parameters:

graph graph to abort; must be one of the graphs associated with this scheduler

Implemented in DfsTreeExecStreamScheduler, and ParallelExecStreamScheduler.

| void ExecStreamScheduler::checkAbort | ( | | ) | const [virtual] | | ------------------------------------ | - | | - | ----------------- |

| virtual void ExecStreamScheduler::stop | ( | | ) | [pure virtual] | | -------------------------------------- | - | | - | ---------------- |

void ExecStreamScheduler::createBufferProvisionAdapter ( ExecStreamEmbryo & embryo ) [virtual]
void ExecStreamScheduler::createCopyProvisionAdapter ( ExecStreamEmbryo & embryo ) [virtual]

Creates a new adapter stream capable of copying the output of a stream with BUFPROV_PRODUCER into the input of a stream with BUFPROV_CONSUMER.

Default implementation is CopyExecStream. Caller is responsible for filling in generic ExecStreamParams after return.

Parameters:

embryo receives new adapter stream

Definition at line 92 of file ExecStreamScheduler.cpp.

References ExecStreamEmbryo::init().

| uint ExecStreamScheduler::getDegreeOfParallelism | ( | | ) | [virtual] | | ------------------------------------------------------------------------------------------------------------- | - | | - | ----------- |

void TraceSource::initTraceSource ( SharedTraceTarget pTraceTarget,
std::string name
) [virtual, inherited]
void TraceSource::trace ( TraceLevel level,
std::string message
) const [inherited]

| bool TraceSource::isTracing | ( | | ) | const [inline, inherited] | | --------------------------- | - | | - | --------------------------- |

bool TraceSource::isTracingLevel ( TraceLevel level ) const [inline, inherited]

| TraceTarget& TraceSource::getTraceTarget | ( | | ) | const [inline, inherited] | | ----------------------------------------------------------------- | - | | - | --------------------------- |

| std::string TraceSource::getTraceSourceName | ( | | ) | const [inline, inherited] | | ------------------------------------------- | - | | - | --------------------------- |

void TraceSource::setTraceSourceName ( std::string const & n ) [inline, inherited]

Sets the name of this source.

Useful to construct dynamic names for fine-grained filtering.

Definition at line 136 of file TraceSource.h.

00137 { 00138 name = n; 00139 }

| TraceLevel TraceSource::getMinimumTraceLevel | ( | | ) | const [inline, inherited] | | ------------------------------------------------------------------------------------------------------ | - | | - | --------------------------- |

| void TraceSource::disableTracing | ( | | ) | [inherited] | | -------------------------------- | - | | - | ------------- |


Member Data Documentation


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


Generated on Mon Jun 22 04:00:30 2009 for Fennel by doxygen 1.5.1