Commit 3d9b52c8 authored by George Zagaris's avatar George Zagaris
Browse files

ENH: Added timerlogs

Added some timelogs for profiling.
parent 3f39e0a8
......@@ -18,7 +18,7 @@
#include "vtkPointData.h"
#include "vtkCellData.h"
#include "vtkUniformGrid.h"
#include "vtkTimerLog.h"
#include <cassert>
......@@ -53,10 +53,12 @@ void vtkAMRDataSetCache::InsertAMRBlock(
{
assert( "pre: AMR block is NULL" && (amrGrid != NULL) );
vtkTimerLog::MarkStartEvent( "AMRCache::InsertBlock" );
if( !this->HasAMRBlock( compositeIdx ) )
{
this->Cache[ compositeIdx ] = amrGrid;
}
vtkTimerLog::MarkEndEvent( "AMRCache::InsertBlock" );
}
//------------------------------------------------------------------------------
......@@ -66,6 +68,8 @@ void vtkAMRDataSetCache::InsertAMRBlockPointData(
assert( "pre: AMR array is NULL" && (dataArray != NULL) );
assert( "pre: AMR block is cached" && ( this->HasAMRBlock( compositeIdx ) ) );
vtkTimerLog::MarkStartEvent( "AMRCache::InsertAMRBlockPointData" );
vtkUniformGrid *amrBlock = this->GetAMRBlock( compositeIdx );
assert( "pre: AMR block should not be NULL" && ( amrBlock != NULL ) );
......@@ -74,6 +78,8 @@ void vtkAMRDataSetCache::InsertAMRBlockPointData(
if( !PD->HasArray( dataArray->GetName() ) )
PD->AddArray( dataArray );
vtkTimerLog::MarkEndEvent( "AMRCache::InsertAMRBlockPointData" );
}
//------------------------------------------------------------------------------
......@@ -83,6 +89,8 @@ void vtkAMRDataSetCache::InsertAMRBlockCellData(
assert( "pre: AMR array is NULL" && (dataArray != NULL) );
assert( "pre: AMR block is cached" && ( this->HasAMRBlock( compositeIdx ) ) );
vtkTimerLog::MarkStartEvent( "AMRCache::InsertAMRBlockCellData" );
vtkUniformGrid *amrBlock = this->GetAMRBlock( compositeIdx );
assert( "pre: AMR block should not be NULL" &&
(this->HasAMRBlock( compositeIdx ) ) );
......@@ -92,6 +100,8 @@ void vtkAMRDataSetCache::InsertAMRBlockCellData(
if( !CD->HasArray( dataArray->GetName() ) )
CD->AddArray( dataArray );
vtkTimerLog::MarkEndEvent( "AMRCache::InsertAMRBlockCellData" );
}
//------------------------------------------------------------------------------
......@@ -193,11 +203,20 @@ bool vtkAMRDataSetCache::HasAMRBlockPointData(
//------------------------------------------------------------------------------
bool vtkAMRDataSetCache::HasAMRBlock(int compositeIdx )
{
vtkTimerLog::MarkStartEvent( "AMRCache::CheckIfBlockExists" );
if( this->Cache.empty( ) )
return false;
{
vtkTimerLog::MarkEndEvent( "AMRCache::CheckIfBlockExists" );
return false;
}
if( this->Cache.find( compositeIdx ) != this->Cache.end() )
return true;
{
vtkTimerLog::MarkEndEvent( "AMRCache::CheckIfBlockExists" );
return true;
}
vtkTimerLog::MarkEndEvent( "AMRCache::CheckIfBlockExists" );
return false;
}
......@@ -32,6 +32,8 @@
#include "vtkMultiProcessController.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkTimerLog.h"
#include <cassert>
#include <algorithm>
......@@ -124,6 +126,10 @@ void vtkAMRSliceFilter::InitializeOffSet(
//------------------------------------------------------------------------------
vtkPlane* vtkAMRSliceFilter::GetCutPlane( vtkHierarchicalBoxDataSet *inp )
{
assert( "pre: AMR dataset should not be NULL" && (inp != NULL) );
vtkTimerLog::MarkStartEvent( "AMRSlice::GetCutPlane" );
vtkPlane *pl = vtkPlane::New();
// Get global bounds
......@@ -162,6 +168,8 @@ vtkPlane* vtkAMRSliceFilter::GetCutPlane( vtkHierarchicalBoxDataSet *inp )
vtkErrorMacro( "Undefined plane normal" );
}
pl->SetOrigin( porigin );
vtkTimerLog::MarkEndEvent( "AMRSlice::GetCutPlane" );
return( pl );
}
......@@ -173,6 +181,8 @@ vtkUniformGrid* vtkAMRSliceFilter::GetSlice(
assert( "pre: input grid is NULL" && (grid != NULL) );
assert( "pre: input grid must be a 3-D grid"&&(grid->GetDataDimension()==3));
vtkTimerLog::MarkStartEvent( "AMRSlice::GetSlice" );
vtkUniformGrid *slice = vtkUniformGrid::New();
// Get the 3-D Grid dimensions
......@@ -234,6 +244,8 @@ vtkUniformGrid* vtkAMRSliceFilter::GetSlice(
vtkErrorMacro( "Undefined normal" );
}
vtkTimerLog::MarkEndEvent( "AMRSlice::GetSlice" );
return( slice );
}
......@@ -275,6 +287,8 @@ void vtkAMRSliceFilter::ComputeAMRBlocksToLoad(
assert( "pre: plane object is NULL" && (p != NULL) );
assert( "pre: metadata object is NULL" && (metadata != NULL) );
vtkTimerLog::MarkStartEvent( "AMRSlice::ComputeAMRBlocksToLoad" );
// Store A,B,C,D from the plane equation
double plane[4];
plane[0] = p->GetNormal()[0];
......@@ -313,6 +327,7 @@ void vtkAMRSliceFilter::ComputeAMRBlocksToLoad(
std::sort( this->blocksToLoad.begin(), this->blocksToLoad.end() );
vtkTimerLog::MarkEndEvent( "AMRSlice::ComputeAMRBlocksToLoad" );
}
//------------------------------------------------------------------------------
......@@ -324,6 +339,8 @@ void vtkAMRSliceFilter::GetAMRSliceInPlane(
assert( "pre: output AMR dataset is NULL" && (out != NULL) );
assert( "pre: cut plane is NULL" && (p != NULL) );
vtkTimerLog::MarkStartEvent( "AMRSlice::GetAMRSliceInPlane" );
// Store A,B,C,D from the plane equation
double plane[4];
plane[0] = p->GetNormal()[0];
......@@ -372,10 +389,15 @@ void vtkAMRSliceFilter::GetAMRSliceInPlane(
} // END for all data
} // END for all levels
vtkTimerLog::MarkEndEvent( "AMRSlice::GetAMRSliceInPlane" );
vtkTimerLog::MarkStartEvent( "AMRSlice::GenerateMetaData" );
vtkAMRUtilities::GenerateMetaData( out, this->Controller );
vtkTimerLog::MarkEndEvent( "AMRSlice::GenerateMetaData");
vtkTimerLog::MarkStartEvent( "AMRSlice::GenerateVisibility" );
out->GenerateVisibilityArrays();
vtkTimerLog::MarkEndEvent( "AMRSlice::GenerateVisibility" );
}
//------------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment