[Trilinos-Users] Help with Teuchos::TimeMonitor

Duncan Karnitz dlk at thermoanalytics.com
Tue Apr 3 12:02:02 EDT 2018


Hi.

I'm trying to use the Teuchos timing tools to monitor performance
in various methods in a library I'm creating. I can't seem to get
the times to report correctly in a number of circumstances.

Source compiled unit-tests (with GTest):
 All timers reported correctly when calling TimeMonitor::summarize()

Library integration test, small test that links my library:
 My own timers are not reported, but I do see two Epetra_Multiply
 timers reported.

Application integration, larger application that links my library:
 My own timers are not reported, but I do see two Epetra_Multiply
 timers reported.

An example of my usage:

 solve.cpp

 static auto timeSolve = Teuchos::TimeMonitor::getNewCounter( "Solve::solve()" );

 void Solve::solve()
 {
   auto local(*timeSolve);

   local.start();

   // Solve using Epetra/AztecOO/ML

   local.stop();
 }

 driver.cpp

 void Driver::drive()
 {
   solver.solve();

   Teuchos::TimeMonitor::summarize();
 }

It does not seem to matter if I instead use the TEUCHOS_FUNC_TIME_MONITOR() 
macros or make static source file timers.

Any help is appreciated, thank you.
-Duncan Karnitz


More information about the Trilinos-Users mailing list