[Trilinos-Users] measuring time taken by preconditioner and solver

Heroux, Mike MHeroux at CSBSJU.EDU
Tue Dec 30 15:26:45 MST 2014


Jae-Seung,

The preconditioners in AztecOO are set up so that the preconditioner is constructed only when first called to do the solve, a kind of lazy construction.  This is why the timers are set up the way you see them.

You can explicitly manage the preconditioner construction yourself using the ConstructPreconditinoer() and DestroyPreconditioner() methods on the AztecOO class, if you like.

http://trilinos.org/docs/dev/packages/aztecoo/doc/html/classAztecOO.html#a5abbb09dc41cffe7f32b365e44184b08

This would permit you to time the setup cost.  In this case, the setup would already be complete prior to performing the call to the solve.

Let me know if this does not answer your questions.

Mike

From: <Yeom>, Jae-Seung <yeom2 at llnl.gov<mailto:yeom2 at llnl.gov>>
Date: Monday, December 29, 2014 at 7:15 PM
To: "trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>" <trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>>
Subject: [Trilinos-Users] measuring time taken by preconditioner and solver

I am trying to measure the time taken by preconditioner and solver separately.
If possible, I am trying to measure the per-iteration time using a high-resolution timer.
As a start, I looked at where AZ_second() is called.
I have some questions and also wish to make sure if my understanding is correct.

The timing value of 'status[AZ_solve_time]' includes the time taken by both preconditioner and solver.
'AZ_precondition()' (or 'Epetra_Aztec_precond()') is called inside of each iteration of an iterative solver as long as a preconditioner is set. One exception is with 'az_gmresr.c', in which 'precond->prec_function()' is called unconditionally. (I am not sure if this is necessary or simply a missing condition check)

In 'AZ_precondition()', the execution time is measured and accumulated to timing[0] of the given 'AZ_PRECOND' structure when 'AZ_recursion_level' is 0.
In addition, each solver measures the time of initial preconditioning and stores it into 'options[AZ_first_precond]' before going into iteration.

My questions are that what is the main reason to measure the first preconditioning separately?
Is there some extra work done for the first call of a preconditioner?
Will 'AZ_recursion_level' be 0 unless I do not use 'AZ_smoother' as the choice of precoditioner and do not call 'recursiveIterate()'?

Thanks,

Jae-Seung Yeom


More information about the Trilinos-Users mailing list