[Trilinos-Users] anasazi: uncorverged eigs

hkthorn hkthorn at sandia.gov
Mon Feb 20 14:46:44 MST 2006


Hi Simone,

For the current behavior of the LOBPCG solver, the approach you proposed is
reasonable.  As you have noticed, the LOBPCG solver doesn't store
unconverged eigenpairs in the eigenproblem.  However, it should be noted
that a clean exit (Anasazi::Ok) from an Anasazi solver means that ALL of the
M_nev eigenvalues you requested converged to the tolerance
(localTol).  This means, that the eigenproblem may still have the first
few converged eigenpairs upon exit, but not all M_nev.  Upon review of the
code, I don't see a clean way to return the unconverged eigenpairs based on
this previous statement.  I do see the necessity of such information being
returned to the user and I hope to address this need in future releases of
Anasazi.

I apologize for any inconvenience this behavior has had on your work and
appreciate your interest!

Thanks,
Heidi


On 2/16/06 12:28 PM, "Simone Deparis" <deparis at MIT.EDU> wrote:

> Hi Heidi,
> 
> Actually none is converged. As a rough patch, I have introduced a loop
> outside Anasazi where at each loop I ask for a better precision until
> the solver breaks:
> something like
> 
>   double localTol(1.), globalTol;
>   int returnCode(Anasazi::Ok);
>   globalTol = MyPL.get("Tol", 1.0e-6);
>   while (returnCode == Anasazi::Ok) {
> 
>     cout << "Anasazi::LOBPCG::solve() with Tol = " << localTol << endl;
> 
>     MyPL.set( "Tol", localTol );
> 
>     // Initialize the Block Arnoldi solver
>     Anasazi::LOBPCG<double, MV, OP> MySolver(MyProblem, MySort, MyOM, MyPL);
> 
>     // Solve the problem to the specified tolerances or length
>     returnCode = MySolver.solve();
> 
>     // Check that the solver returned OK,
>     if (returnCode != Anasazi::Ok) {
>       cout << "Anasazi::LOBPCG::solve() returned with code : "<< returnCode
>   << endl;
>       break;
>     }
>     // Retrieve eigenvalues
>     Teuchos::RefCountPtr<std::vector<double> > evals =
> MyProblem->GetEvals();
>     for (i=0 ; i < M_nev; i++)
>       (*eigvals)(i) = (*evals)[i];
> 
> 
>     // Retrieve eigenvectors
> 
>     *evecs = *(MyProblem->GetEvecs());
> 
>     if (localTol == globalTol) break;
>     else {
>       localTol = localTol/10;
>       if (localTol < globalTol) localTol = globalTol;
>     }
>   }
> 
> I agree this is not optimal, but its cost is minimal. Moreover between
> one loop and the other, the Eigenvectors are kept, such that the old
> iterations are not "lost".
> 
> This is maybe enough for my purposes. What do you thing about this approach?
> 
> Thank you
> Simone
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>> 
>> 
>> On 2/15/06 12:13 PM, "Simone Deparis" <deparis at MIT.EDU> wrote:
>> 
>> 
>>> Hello,
>>> 
>>> I would like to tell Anasazi::LOBPCG to return also the Eigenvectors and
>>> eigenvalues that did not converge (Even if I know that this could be
>>> dangerous; actually I will run a Newton starting from the founded
>>> eigenvalues).
>>> I am trying to see where to change the code, but I fear I would add some
>>> bug ... Somebody already did this? or, somebody have a small patch for this?
>>> 
>>> Thank you
>>> Simone
>>> 
>>> 
>> 
>> 
>> 



More information about the Trilinos-Users mailing list