OTB  6.7.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
otb::PipelineMemoryPrintCalculator Class Reference

#include <otbPipelineMemoryPrintCalculator.h>

+ Inheritance diagram for otb::PipelineMemoryPrintCalculator:
+ Collaboration diagram for otb::PipelineMemoryPrintCalculator:

Public Types

typedef itk::SmartPointer
< const Self
typedef DataObjectType::Pointer DataObjectPointerType
typedef itk::DataObject DataObjectType
typedef itk::SmartPointer< SelfPointer
typedef std::set< const
ProcessObjectType * > 
typedef ProcessObjectType::Pointer ProcessObjectPointerType
typedef itk::ProcessObject ProcessObjectType
typedef itk::Object Superclass
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
typedef SmartPointer< SelfPointer
typedef Object Self
typedef LightObject Superclass
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
typedef SmartPointer< SelfPointer
typedef LightObject Self

Public Member Functions

void Compute (bool propagate=true)
virtual ::itk::LightObject::Pointer CreateAnother (void) const
MemoryPrintType EvaluateDataObjectPrint (DataObjectType *data)
virtual MemoryPrintType GetMemoryPrint ()
virtual const char * GetNameOfClass () const
virtual void SetDataToWrite (DataObjectType *_arg)
virtual void SetBiasCorrectionFactor (double _arg)
virtual double GetBiasCorrectionFactor ()
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
unsigned long AddObserver (const EventObject &event, Command *) const
virtual void DebugOff () const
virtual void DebugOn () const
CommandGetCommand (unsigned long tag)
bool GetDebug () const
const MetaDataDictionaryGetMetaDataDictionary () const
MetaDataDictionaryGetMetaDataDictionary ()
virtual ModifiedTimeType GetMTime () const
virtual const std::string & GetObjectName () const
virtual const TimeStampGetTimeStamp () const
bool HasObserver (const EventObject &event) const
void InvokeEvent (const EventObject &)
void InvokeEvent (const EventObject &) const
virtual void Modified () const
virtual void Register () const override
void RemoveAllObservers ()
void RemoveObserver (unsigned long tag)
void SetDebug (bool debugFlag) const
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
virtual void SetObjectName (std::string _arg)
virtual void SetReferenceCount (int) override
virtual void UnRegister () const noexceptoverride
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
virtual int GetReferenceCount () const
 itkCloneMacro (Self)
void Print (std::ostream &os, Indent indent=0) const

Static Public Member Functions

static unsigned long EstimateOptimalNumberOfStreamDivisions (MemoryPrintType memoryPrint, MemoryPrintType availableMemory)
static Pointer New ()
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
static void GlobalWarningDisplayOff ()
static void GlobalWarningDisplayOn ()
static Pointer New ()
static void SetGlobalWarningDisplay (bool flag)
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
static Pointer New ()

Static Public Attributes

static const double ByteToMegabyte
static const double MegabyteToByte

Protected Member Functions

MemoryPrintType EvaluateProcessObjectPrintRecursive (ProcessObjectType *process)
 PipelineMemoryPrintCalculator ()
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 ~PipelineMemoryPrintCalculator () override
- Protected Member Functions inherited from itk::Object
 Object ()
bool PrintObservers (std::ostream &os, Indent indent) const
virtual void SetTimeStamp (const TimeStamp &time)
virtual ~Object ()
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 LightObject ()
virtual void PrintHeader (std::ostream &os, Indent indent) const
virtual void PrintTrailer (std::ostream &os, Indent indent) const
virtual ~LightObject ()

Private Member Functions

void operator= (const Self &)=delete
 PipelineMemoryPrintCalculator (const Self &)=delete

Private Attributes

double m_BiasCorrectionFactor
DataObjectPointerType m_DataToWrite
MemoryPrintType m_MemoryPrint
ProcessObjectPointerSetType m_VisitedProcessObjects

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount

Detailed Description

Estimate pipeline memory usage and optimal stream divisions.

This class allows estimating the memory usage of a given pipeline by tracing back pipeline from a given data (in general, this data should be set to the data to write) and examining each filter to determine its memory footprint. To do so, it performs a dry run of the requested region pipeline negotiation.

The SetDataToWrite() method allows setting the data candidate for writing, and for which memory usage estimation should be performed.

Additionally, this class allows computing the optimal number of stream division to write the data. To do so, the available memory can be set via the SetAvailableMemory() method, and an optional bias correction factor can be applied to weight the estimate memory usage in case a bias occurs between estimated and real memory usage. The optimal number of stream divisions can be retrieved using the GetOptimalNumberOfStreamDivisions().

Please note that for now this calculator suffers from the following limitations:

Definition at line 73 of file otbPipelineMemoryPrintCalculator.h.

Member Typedef Documentation

Definition at line 81 of file otbPipelineMemoryPrintCalculator.h.

Definition at line 87 of file otbPipelineMemoryPrintCalculator.h.

Definition at line 86 of file otbPipelineMemoryPrintCalculator.h.

typedef ::itksysFundamentalType_UInt64 otb::PipelineMemoryPrintCalculator::MemoryPrintType

Definition at line 89 of file otbPipelineMemoryPrintCalculator.h.

Definition at line 80 of file otbPipelineMemoryPrintCalculator.h.

Definition at line 93 of file otbPipelineMemoryPrintCalculator.h.

Definition at line 85 of file otbPipelineMemoryPrintCalculator.h.

Useful typedefs

Definition at line 84 of file otbPipelineMemoryPrintCalculator.h.

Standard class typedefs

Definition at line 78 of file otbPipelineMemoryPrintCalculator.h.

Definition at line 79 of file otbPipelineMemoryPrintCalculator.h.

Constructor & Destructor Documentation

otb::PipelineMemoryPrintCalculator::PipelineMemoryPrintCalculator ( )


otb::PipelineMemoryPrintCalculator::~PipelineMemoryPrintCalculator ( )


otb::PipelineMemoryPrintCalculator::PipelineMemoryPrintCalculator ( const Self )

Member Function Documentation

void otb::PipelineMemoryPrintCalculator::Compute ( bool  propagate = true)

Compute pipeline memory print

virtual::itk::LightObject::Pointer otb::PipelineMemoryPrintCalculator::CreateAnother ( void  ) const

Reimplemented from itk::Object.

static unsigned long otb::PipelineMemoryPrintCalculator::EstimateOptimalNumberOfStreamDivisions ( MemoryPrintType  memoryPrint,
MemoryPrintType  availableMemory 

Get the optimal number of stream division

Referenced by otb::StreamingManager< TImage >::EstimateOptimalNumberOfDivisions().

MemoryPrintType otb::PipelineMemoryPrintCalculator::EvaluateDataObjectPrint ( DataObjectType data)

Evaluate the print (in bytes) of a single data object

MemoryPrintType otb::PipelineMemoryPrintCalculator::EvaluateProcessObjectPrintRecursive ( ProcessObjectType process)

Recursive method to evaluate memory print in bytes

virtual double otb::PipelineMemoryPrintCalculator::GetBiasCorrectionFactor ( )

Set/Get the bias correction factor which will weight the estimated memory print (allows compensating bias between estimated and real memory print, default is 1., i.e. no correction)

virtual MemoryPrintType otb::PipelineMemoryPrintCalculator::GetMemoryPrint ( )

Get the total memory print (in bytes)

virtual const char* otb::PipelineMemoryPrintCalculator::GetNameOfClass ( ) const

Run-time type information (and related methods).

Reimplemented from itk::Object.

static Pointer otb::PipelineMemoryPrintCalculator::New ( )

Method for creation through the object factory.

Referenced by otb::StreamingManager< TImage >::EstimateOptimalNumberOfDivisions().

void otb::PipelineMemoryPrintCalculator::operator= ( const Self )
void otb::PipelineMemoryPrintCalculator::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const

PrintSelf method

Reimplemented from itk::Object.

virtual void otb::PipelineMemoryPrintCalculator::SetBiasCorrectionFactor ( double  _arg)

Set/Get the bias correction factor which will weight the estimated memory print (allows compensating bias between estimated and real memory print, default is 1., i.e. no correction)

virtual void otb::PipelineMemoryPrintCalculator::SetDataToWrite ( DataObjectType _arg)

Set last pipeline filter

Member Data Documentation

const double otb::PipelineMemoryPrintCalculator::ByteToMegabyte

Const conversion factor

Definition at line 122 of file otbPipelineMemoryPrintCalculator.h.

Referenced by otb::StreamingManager< TImage >::EstimateOptimalNumberOfDivisions().

double otb::PipelineMemoryPrintCalculator::m_BiasCorrectionFactor

Bias correction factor

Definition at line 152 of file otbPipelineMemoryPrintCalculator.h.

DataObjectPointerType otb::PipelineMemoryPrintCalculator::m_DataToWrite

Pointer to the last pipeline filter

Definition at line 149 of file otbPipelineMemoryPrintCalculator.h.

MemoryPrintType otb::PipelineMemoryPrintCalculator::m_MemoryPrint

The total memory print of the pipeline

Definition at line 146 of file otbPipelineMemoryPrintCalculator.h.

ProcessObjectPointerSetType otb::PipelineMemoryPrintCalculator::m_VisitedProcessObjects

Visited ProcessObject set

Definition at line 155 of file otbPipelineMemoryPrintCalculator.h.

const double otb::PipelineMemoryPrintCalculator::MegabyteToByte

Definition at line 123 of file otbPipelineMemoryPrintCalculator.h.

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