casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Protected Types | Protected Member Functions | Private Attributes | List of all members
casa::asyncio::VLAT Class Reference

VLAT is the Visibility LookAhead Thread. This thread advances a visibility iterator and fills the data indicated by the visibility iterator into the VlaData buffer ring. More...

#include <VLAT.h>

Inheritance diagram for casa::asyncio::VLAT:
casa::async::Thread

Classes

class  FillerDictionary
 
class  SweepTerminated
 

Public Member Functions

 VLAT (AsynchronousInterface *)
 
 ~VLAT ()
 
void clearFillTerminationRequest ()
 
void initialize (const ROVisibilityIterator &rovi)
 
void initialize (const casacore::Block< casacore::MeasurementSet > &mss, const casacore::Block< casacore::Int > &sortColumns, casacore::Bool addDefaultSortCols, casacore::Double timeInterval, casacore::Bool writable)
 
casacore::Bool isTerminated () const
 
void setModifiers (RoviaModifiers &modifiers)
 
void setPrefetchColumns (const PrefetchColumns &prefetchColumns)
 
void requestSweepTermination ()
 
void terminate ()
 
- Public Member Functions inherited from casa::async::Thread
 Thread ()
 
virtual ~Thread ()
 
pthread_t getId () const
 
pid_t gettid () const
 
bool isTerminationRequested () const
 
void * join ()
 
void startThread ()
 

Protected Types

typedef std::vector
< VlatFunctor * > 
Fillers
 

Protected Member Functions

void applyModifiers (ROVisibilityIterator *rovi, VisibilityIterator *vi)
 
void alignWriteIterator (SubChunkPair subchunk)
 
void checkFiller (VisBufferComponents::EnumType id)
 
void createFillerDictionary ()
 
void fillDatum (VlaDatum *datum)
 
void fillDatumMiscellanyAfter (VlaDatum *datum)
 
void fillDatumMiscellanyBefore (VlaDatum *datum)
 
void fillLsrInfo (VlaDatum *datum)
 
void flushWrittenData ()
 
void handleWrite ()
 
void * run ()
 
casacore::Bool sweepTerminationRequested () const
 
void sweepVi ()
 
void throwIfSweepTerminated ()
 
casacore::Bool waitForViReset ()
 
void waitUntilFillCanStart ()
 
- Protected Member Functions inherited from casa::async::Thread
bool isStarted () const
 

Private Attributes

const InterfaceController * controller_p
 class NullaryPredicate { public: More...
 
FillerDictionary fillerDictionary_p
 
Fillers fillers_p
 
AsynchronousInterfaceinterface_p
 
casacore::Block
< casacore::MeasurementSet
measurementSets_p
 
SubChunkPair readSubchunk_p
 
RoviaModifiers roviaModifiers_p
 
volatile casacore::Bool sweepTerminationRequested_p
 
casacore::Bool threadTerminated_p
 
ROVisibilityIteratorvisibilityIterator_p
 
VlaDatavlaData_p
 
VisibilityIteratorwriteIterator_p
 
SubChunkPair writeSubchunk_p
 

Additional Inherited Members

- Public Types inherited from casa::async::Thread
typedef void *(* ThreadFunction )(void *)
 
- Static Protected Member Functions inherited from casa::async::Thread
static void * threadFunction (void *)
 

Detailed Description

VLAT is the Visibility LookAhead Thread. This thread advances a visibility iterator and fills the data indicated by the visibility iterator into the VlaData buffer ring.

Intended use:

Internal

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

VLAT is the Visibility LookAhead Thread. It is not related to the more common NRAO acronym VLA.

Synopsis

The VLAT is a thread object that buffers up data from successive visibility iterator positions in a MeasurementSet. It is part of the backend to a ROVisibilityIteratorAsync (ROVIA) object used by the main thread to replace the normal, synchronous ROVisibilityIterator. When the user creates a ROVIA object the information normally used to create a ROVisibilityIterator is passed to the VLAT which uses it to create a ROVisibilityIterator local to itself. The VLAT then uses this ROVisibilityIterator to fill buffers in the VlaData-managed buffer ring (this interaction is described in VlaData). Filling consists of attaching VLAT's ROVisibilityIterator to the VisBufferAsync object associated with a buffer and then calling the fill operations for the data items (e.g., visCube, Ant1, etc.) which the user has requested be prefetched. The fill operations will likely result in synchronous I/O operations being performed by the column access methods related to the casacore::Table system (memory-resident tables, columns, etc., may be able to satisfy a fill operation without performing I/O).

The thread may be terminated by calling the terminate method. This will cause the VLAT to terminate when it notices the termination request. The termination may not be immediate since the VLAT may be engaged in a syncrhonous I/O operation and is uanble to detect the termination request until that I/O has completed.

Normally the VLAT sweeps the VI to the end of the measurement set and then awaits further instructions. The main thread may stop the sweep early by calling VlaData::terminateSweep which will eventually be detected by the VLAT and result in a coordinated reset of the sweep. When the sweep reset is applied the VLAT will also detect visibility iterator modification requests (e.g., setRowBlocking, selectChannel, setInterval, etc.) that were queued up in VlaData; for the set of available VI modification requests supported see ROVisibilityIteratorAsync.

Example

Motivation

Thrown Exceptions

Definition at line 219 of file VLAT.h.

Member Typedef Documentation

typedef std::vector<VlatFunctor *> casa::asyncio::VLAT::Fillers
protected

Definition at line 254 of file VLAT.h.

Constructor & Destructor Documentation

casa::asyncio::VLAT::VLAT ( AsynchronousInterface )
casa::asyncio::VLAT::~VLAT ( )

Member Function Documentation

void casa::asyncio::VLAT::alignWriteIterator ( SubChunkPair  subchunk)
protected
void casa::asyncio::VLAT::applyModifiers ( ROVisibilityIterator rovi,
VisibilityIterator vi 
)
protected
void casa::asyncio::VLAT::checkFiller ( VisBufferComponents::EnumType  id)
protected
void casa::asyncio::VLAT::clearFillTerminationRequest ( )
void casa::asyncio::VLAT::createFillerDictionary ( )
protected
void casa::asyncio::VLAT::fillDatum ( VlaDatum datum)
protected
void casa::asyncio::VLAT::fillDatumMiscellanyAfter ( VlaDatum datum)
protected
void casa::asyncio::VLAT::fillDatumMiscellanyBefore ( VlaDatum datum)
protected
void casa::asyncio::VLAT::fillLsrInfo ( VlaDatum datum)
protected
void casa::asyncio::VLAT::flushWrittenData ( )
protected
void casa::asyncio::VLAT::handleWrite ( )
protected
void casa::asyncio::VLAT::initialize ( const ROVisibilityIterator rovi)
void casa::asyncio::VLAT::initialize ( const casacore::Block< casacore::MeasurementSet > &  mss,
const casacore::Block< casacore::Int > &  sortColumns,
casacore::Bool  addDefaultSortCols,
casacore::Double  timeInterval,
casacore::Bool  writable 
)
casacore::Bool casa::asyncio::VLAT::isTerminated ( ) const
void casa::asyncio::VLAT::requestSweepTermination ( )
void* casa::asyncio::VLAT::run ( )
protectedvirtual

Implements casa::async::Thread.

void casa::asyncio::VLAT::setModifiers ( RoviaModifiers modifiers)
void casa::asyncio::VLAT::setPrefetchColumns ( const PrefetchColumns prefetchColumns)
casacore::Bool casa::asyncio::VLAT::sweepTerminationRequested ( ) const
protected
void casa::asyncio::VLAT::sweepVi ( )
protected
void casa::asyncio::VLAT::terminate ( )
virtual

Reimplemented from casa::async::Thread.

void casa::asyncio::VLAT::throwIfSweepTerminated ( )
protected
casacore::Bool casa::asyncio::VLAT::waitForViReset ( )
protected
void casa::asyncio::VLAT::waitUntilFillCanStart ( )
protected

Member Data Documentation

const InterfaceController* casa::asyncio::VLAT::controller_p
private

class NullaryPredicate { public:

virtual ~NullaryPredicate () {} virtual casacore::Bool operator () () const = 0; };

class FillCanStartOrSweepTermination : public NullaryPredicate {

public:

FillCanStartOrSweepTermination (VlaData * vlaData, AsynchronousInterface * interface) : interface_p (interface), vlaData_p (vlaData) {}

casacore::Bool operator() () const { return vlaData_p->fillCanStart () || interface_p->isSweepTerminationRequested (); }

private:

AsynchronousInterface * interface_p; VlaData * vlaData_p; };

class ViResetOrLookaheadTermination : public NullaryPredicate {

public:

ViResetOrLookaheadTermination (AsynchronousInterface * interface) : interface_p (interface) {}

casacore::Bool operator() () const { casacore::Bool viWasReset_p = interface_p->viResetRequested;

return viWasReset_p || interface_p->isLookaheadTerminationRequested (); }

private:

AsynchronousInterface * interface_p; };

Definition at line 324 of file VLAT.h.

FillerDictionary casa::asyncio::VLAT::fillerDictionary_p
private

Definition at line 325 of file VLAT.h.

Fillers casa::asyncio::VLAT::fillers_p
private

Definition at line 326 of file VLAT.h.

AsynchronousInterface* casa::asyncio::VLAT::interface_p
private

Definition at line 327 of file VLAT.h.

casacore::Block<casacore::MeasurementSet> casa::asyncio::VLAT::measurementSets_p
private

Definition at line 328 of file VLAT.h.

SubChunkPair casa::asyncio::VLAT::readSubchunk_p
private

Definition at line 329 of file VLAT.h.

RoviaModifiers casa::asyncio::VLAT::roviaModifiers_p
private

Definition at line 330 of file VLAT.h.

volatile casacore::Bool casa::asyncio::VLAT::sweepTerminationRequested_p
private

Definition at line 331 of file VLAT.h.

casacore::Bool casa::asyncio::VLAT::threadTerminated_p
private

Definition at line 332 of file VLAT.h.

ROVisibilityIterator* casa::asyncio::VLAT::visibilityIterator_p
private

Definition at line 333 of file VLAT.h.

VlaData* casa::asyncio::VLAT::vlaData_p
private

Definition at line 334 of file VLAT.h.

VisibilityIterator* casa::asyncio::VLAT::writeIterator_p
private

Definition at line 335 of file VLAT.h.

SubChunkPair casa::asyncio::VLAT::writeSubchunk_p
private

Definition at line 336 of file VLAT.h.


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