[Trilinos-Users] Memory usage when calling ComputePreconditioner()
Eric Marttila
eric.marttila at thermoanalytics.com
Wed Jan 9 06:24:34 MST 2013
Hello,
I'm solving a linear system multiple times, with the A matrix values changing
each time. Psuedocode is:
//----------------------------------------------
// create AztecOO solver and ML preconditioner
// Set AztecOO options
solver.SetPrecOperator(MLPrec);
solver.SetAztecOption(AZ_solver, AZ_cg);
solver.SetAztecOption(AZ_output, 1);
while (time < endTime) {
// Modify the A matrix values.
// Compute the preconditioner, now that A matrix valures are updated.
MLPrec->ComputePreconditioner(true);
// Solve the linear system.
solver.Iterate(nIterations, 1e-10);
time += timeStep;
}
//----------------------------------------------
I noticed a significant growth in memory usage upon each call to the
ComputePreconditioner() function, and eventually my code would run out of
memory. I looked at the documentation of this ML function and saw that it
recommends setting "reuse: enable" == true
I did this, and now the memory usage looks reasonable (i.e. it grows
initially, then remains relatively constant throughout the remainder of my
solve process).
My question is this: Is there any downside to setting "reuse: enable" to
true? (i.e. is this doing any sort of speed/memory tradeoff?) For my test
case I get about the same total solution time with and without this setting.
One thing that has me wondering is that when I have "reuse: enable" set to
true, I get additional output like this:
Time to check convergence rate = 7.11312 (s)
Thanks.
--Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20130109/87521f27/attachment.html
More information about the Trilinos-Users
mailing list