Anasazi: mutually exclusive checks
Created by: aprokop
@trilinos/anasazi
Expectations
I'm trying to compute a single eigenpair of a generalized eigensystem using generalized Davidson method. I'm unable to set the parameters to get it done for 2x2 size matrices.
Current Behavior
Anasazi contains the following block of checks:
TEUCHOS_TEST_FOR_EXCEPTION( d_problem->getNEV()+2 > pl.get<int>("Maximum Subspace Dimension"),
std::invalid_argument, "Maximum Subspace Dimension must be strictly greater than NEV");
TEUCHOS_TEST_FOR_EXCEPTION( d_maxSubspaceDim > MVT::GetGlobalLength(*problem->getInitVec()),
std::invalid_argument, "Maximum Subspace Dimension cannot exceed problem size");
First of all, in the parameter list I specify "Maximum Subspace Dimension"
to be 1 or 2, otherwize the last check fails (remember, the matrices are 2x2). However, setting it this way comes into conflict with the first check where I request a single eigenpair which results in (1+2 > 2).
Motivation and Context
The application in question has to solve a bunch of eigensystems of different sizes, including the small ones. What they typically did was to pad the matrices to 30x30 so that the subspace checks pass, however that leads to a bunch of other hacks (like setting nonzero diagonal for RILUK preconditioners to construct, etc). I would like to directly pass the proper eigensystem to Anasazi. I see this as a reasonable use case.
Possible Solution
I would like somebody to take a look at the checks and double check whether they make sense for smaller sized matrices. Specifically, I'm not sure why +2
is necessary in the check. If there are limitations in Anasazi for those situations, it would be nice to have that documented.
Steps to Reproduce
So far, I have a small standalone Fortran example to reproduce. I don't think it's necessary to put it here, though, as the situation should be clear just by looking at the checks.
Additional Information
The issues is in both develop
and 12.12 branch.