Commit ecad2cf2 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Merge branch 'add_timing' into 'master'

Add timing to ADIOSAnalysisEndPoint.



See merge request !11
parents f166e724 53fadaba
......@@ -11,6 +11,7 @@
#include <iostream>
#include <sensei/adios/DataAdaptor.h>
#include <sensei/ConfigurableAnalysis.h>
#include <timer/Timer.h>
#include <vtkNew.h>
#include <vtkDataSet.h>
......@@ -53,18 +54,39 @@ int main(int argc, char** argv)
readmethods["dimes"] = ADIOS_READ_METHOD_DIMES;
readmethods["flexpath"] = ADIOS_READ_METHOD_FLEXPATH;
vtkNew<sensei::ConfigurableAnalysis> analysis;
vtkSmartPointer<sensei::ConfigurableAnalysis> analysis =
vtkSmartPointer<sensei::ConfigurableAnalysis>::New();
analysis->Initialize(comm, config_file);
vtkNew<sensei::adios::DataAdaptor> dataAdaptor;
dataAdaptor->Open(comm, readmethods[readmethod], input);
int t_count = 0;
double t = 0.0;
do
{
timer::MarkStartTimeStep(t_count, t);
// request reading of meta-data for this step.
dataAdaptor->ReadStep();
timer::MarkStartEvent("adios::analysis");
analysis->Execute(dataAdaptor.GetPointer());
timer::MarkEndEvent("adios::analysis");
dataAdaptor->ReleaseData();
timer::MarkEndTimeStep();
}
while (dataAdaptor->Advance());
timer::MarkStartEvent("adios::finalize");
analysis = NULL;
timer::MarkEndEvent("adios::finalize");
if (rank == 0)
{
timer::PrintLog(std::cout);
}
return 0;
}
if (ENABLE_ADIOS)
#------------------------------------------------------------------------------
add_executable(ADIOSAnalysisEndPoint ADIOSAnalysisEndPoint.cxx)
target_link_libraries(ADIOSAnalysisEndPoint PRIVATE opts mpi adios sensei)
target_link_libraries(ADIOSAnalysisEndPoint PRIVATE opts mpi adios sensei timer)
endif()
#include "DataAdaptor.h"
#include <timer/Timer.h>
#include <vtkCompositeDataIterator.h>
#include <vtkDataSetAttributes.h>
#include <vtkDoubleArray.h>
......@@ -119,6 +121,8 @@ DataAdaptor::~DataAdaptor()
bool DataAdaptor::Open(MPI_Comm comm,
ADIOS_READ_METHOD method, const std::string& filename)
{
timer::MarkEvent mark("adios::dataadaptor::open");
this->Comm = comm;
adios_read_init_method (method, comm, "verbose=1");
this->File = adios_read_open(filename.c_str(), method, comm, ADIOS_LOCKMODE_ALL, -1);
......@@ -213,6 +217,8 @@ bool DataAdaptor::Advance()
//----------------------------------------------------------------------------
bool DataAdaptor::ReadStep()
{
timer::MarkStartEvent("adios::dataadaptor::read-timestep-metadata");
int tstep = 0; double time = 0;
ADIOS_FILE* f = this->File;
adios_schedule_read(f, NULL, "ntimestep", 0, 1, &tstep);
......@@ -220,6 +226,7 @@ bool DataAdaptor::ReadStep()
adios_perform_reads(f, 1);
this->SetDataTimeStep(tstep);
this->SetDataTime(time);
timer::MarkEndEvent("adios::dataadaptor::read-timestep-metadata");
return true;
}
......@@ -241,6 +248,7 @@ bool DataAdaptor::AddArray(vtkDataObject* mesh, int association, const char* arr
if (iter->second == false)
{
timer::MarkEvent mark("adios::dataadaptor::read-arrays");
if (vtkDataSet* image = vtkDataSet::SafeDownCast(mesh))
{
int rank;
......@@ -294,6 +302,8 @@ const char* DataAdaptor::GetArrayName(int association, unsigned int index)
//----------------------------------------------------------------------------
void DataAdaptor::ReleaseData()
{
timer::MarkEvent mark("adios::dataadaptor::release-data");
for (AssociatedArraysType::iterator iter1 = this->AssociatedArrays.begin();
iter1 != this->AssociatedArrays.end(); ++iter1)
{
......
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