OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | 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 SelfConstPointer
 
typedef DataObjectType::Pointer DataObjectPointerType
 
typedef itk::DataObject DataObjectType
 
typedef ::itksysFundamentalType_UInt64 MemoryPrintType
 
typedef itk::SmartPointer< SelfPointer
 
typedef std::set< const ProcessObjectType * > ProcessObjectPointerSetType
 
typedef ProcessObjectType::Pointer ProcessObjectPointerType
 
typedef itk::ProcessObject ProcessObjectType
 
typedef PipelineMemoryPrintCalculator Self
 
typedef itk::Object Superclass
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual MemoryPrintType GetMemoryPrint ()
 
virtual const char * GetNameOfClass () const
 

Static Public Member Functions

static Pointer New ()
 
static const double ByteToMegabyte
 
static const double MegabyteToByte
 
MemoryPrintType m_MemoryPrint
 
DataObjectPointerType m_DataToWrite
 
double m_BiasCorrectionFactor
 
ProcessObjectPointerSetType m_VisitedProcessObjects
 
virtual void SetBiasCorrectionFactor (double _arg)
 
virtual double GetBiasCorrectionFactor ()
 
virtual void SetDataToWrite (DataObjectType *_arg)
 
void Compute (bool propagate=true)
 
MemoryPrintType EvaluateDataObjectPrint (DataObjectType *data)
 
static unsigned long EstimateOptimalNumberOfStreamDivisions (MemoryPrintType memoryPrint, MemoryPrintType availableMemory)
 
 PipelineMemoryPrintCalculator ()
 
 ~PipelineMemoryPrintCalculator () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
MemoryPrintType EvaluateProcessObjectPrintRecursive (ProcessObjectType *process)
 
 PipelineMemoryPrintCalculator (const Self &)=delete
 
void operator= (const Self &)=delete
 

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

◆ ConstPointer

typedef itk::SmartPointer<const Self> otb::PipelineMemoryPrintCalculator::ConstPointer

Definition at line 80 of file otbPipelineMemoryPrintCalculator.h.

◆ DataObjectPointerType

Definition at line 86 of file otbPipelineMemoryPrintCalculator.h.

◆ DataObjectType

Definition at line 85 of file otbPipelineMemoryPrintCalculator.h.

◆ MemoryPrintType

typedef ::itksysFundamentalType_UInt64 otb::PipelineMemoryPrintCalculator::MemoryPrintType

Definition at line 88 of file otbPipelineMemoryPrintCalculator.h.

◆ Pointer

Definition at line 79 of file otbPipelineMemoryPrintCalculator.h.

◆ ProcessObjectPointerSetType

Definition at line 92 of file otbPipelineMemoryPrintCalculator.h.

◆ ProcessObjectPointerType

Definition at line 84 of file otbPipelineMemoryPrintCalculator.h.

◆ ProcessObjectType

Useful typedefs

Definition at line 83 of file otbPipelineMemoryPrintCalculator.h.

◆ Self

Standard class typedefs

Definition at line 77 of file otbPipelineMemoryPrintCalculator.h.

◆ Superclass

Definition at line 78 of file otbPipelineMemoryPrintCalculator.h.

Constructor & Destructor Documentation

◆ PipelineMemoryPrintCalculator() [1/2]

otb::PipelineMemoryPrintCalculator::PipelineMemoryPrintCalculator ( )
protected

Constructor

◆ ~PipelineMemoryPrintCalculator()

otb::PipelineMemoryPrintCalculator::~PipelineMemoryPrintCalculator ( )
overrideprotected

Destructor

◆ PipelineMemoryPrintCalculator() [2/2]

otb::PipelineMemoryPrintCalculator::PipelineMemoryPrintCalculator ( const Self )
privatedelete

Const conversion factor

Member Function Documentation

◆ Compute()

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

Compute pipeline memory print

◆ CreateAnother()

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

◆ EstimateOptimalNumberOfStreamDivisions()

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

Get the optimal number of stream division

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

◆ EvaluateDataObjectPrint()

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

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

◆ EvaluateProcessObjectPrintRecursive()

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

Recursive method to evaluate memory print in bytes

◆ GetBiasCorrectionFactor()

virtual double otb::PipelineMemoryPrintCalculator::GetBiasCorrectionFactor ( )
virtual

Const conversion factor

◆ GetMemoryPrint()

virtual MemoryPrintType otb::PipelineMemoryPrintCalculator::GetMemoryPrint ( )
virtual

Get the total memory print (in bytes)

◆ GetNameOfClass()

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

Run-time type information (and related methods).

◆ New()

static Pointer otb::PipelineMemoryPrintCalculator::New ( )
static

Method for creation through the object factory.

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

◆ operator=()

void otb::PipelineMemoryPrintCalculator::operator= ( const Self )
privatedelete

Const conversion factor

◆ PrintSelf()

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

PrintSelf method

◆ SetBiasCorrectionFactor()

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

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)

◆ SetDataToWrite()

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

Set last pipeline filter

Member Data Documentation

◆ ByteToMegabyte

const double otb::PipelineMemoryPrintCalculator::ByteToMegabyte
static

◆ m_BiasCorrectionFactor

double otb::PipelineMemoryPrintCalculator::m_BiasCorrectionFactor
private

Bias correction factor

Definition at line 150 of file otbPipelineMemoryPrintCalculator.h.

◆ m_DataToWrite

DataObjectPointerType otb::PipelineMemoryPrintCalculator::m_DataToWrite
private

Pointer to the last pipeline filter

Definition at line 147 of file otbPipelineMemoryPrintCalculator.h.

◆ m_MemoryPrint

MemoryPrintType otb::PipelineMemoryPrintCalculator::m_MemoryPrint
private

The total memory print of the pipeline

Definition at line 144 of file otbPipelineMemoryPrintCalculator.h.

◆ m_VisitedProcessObjects

ProcessObjectPointerSetType otb::PipelineMemoryPrintCalculator::m_VisitedProcessObjects
private

Visited ProcessObject set

Definition at line 153 of file otbPipelineMemoryPrintCalculator.h.

◆ MegabyteToByte

const double otb::PipelineMemoryPrintCalculator::MegabyteToByte
static

Const conversion factor

Definition at line 121 of file otbPipelineMemoryPrintCalculator.h.


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