Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amesos2 MUMPS control over matrix type ( i.e. symmetric, nonsymmetric, ... ) #5819

Closed
davoodansari opened this issue Aug 29, 2019 · 12 comments
Closed
Labels
CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. pkg: Amesos2 type: question

Comments

@davoodansari
Copy link

From Trilinos 12.8, I am using Amesos2 to solver Tpetra based sparse linear problems.
Between the doc and doxygen I was not able to figure out how to inform the solver that the matrix is symmetric so that I can take advantage of filling only one half of the matrix.

The older documentation mentions MatrixType as a general parameter for amesos2 but this option does not seem to be available in the newer versions of Amesos2.

Any advice is highly appreciated.

Davood

@davoodansari
Copy link
Author

davoodansari commented Aug 29, 2019

Not sure if this helps or not. This is just an attempt to directly mess with MUMPS native parameters. I tried to do some reverse engineering. I used these code lines:

        const char* solverNames = "MUMPS";
        if( !Amesos2::query(solverNames) ) std::cerr << solverNames << " not enabled.  Exiting..." << std::endl;
        amesosSolver = Amesos2::create<MT,MV>(solverNames,A);
        amesosParamList = Teuchos::createParameterList("Amesos2");
        Teuchos::ParameterList &MumpsList = amesosParamList->sublist("MUMPS");
        MumpsList.set("ICNTL(1)", "on");
        amesosSolver->setParameters(amesosParamList);

At run-time I get this error:

terminate called after throwing an instance of 'Teuchos::Exceptions::InvalidParameterType'
  what():  Error!  The parameter "ICNTL(1)" exists
in the parameter (sub)list "Amesos2->MUMPS"
but it does not contain any validator needed to extract
an integral value of type "int"!

Throw number = 1

[jhux2: edited for clarity]

@jhux2
Copy link
Member

jhux2 commented Aug 29, 2019

@trilinos/amesos2

@srajama1
Copy link
Contributor

Yes, we do check which parameters get passed. Our support for symmetric problems is not very strong. Is this distributed memory ?

@davoodansari
Copy link
Author

davoodansari commented Aug 29, 2019 via email

@srajama1
Copy link
Contributor

If you are running on one MPI, it could just work if you just add ICNTL(1) as a valid parameter for MUMPS. It might be just a 3 line change, but no guarantees. We do not test this case at all.

@davoodansari
Copy link
Author

davoodansari commented Aug 29, 2019 via email

@srajama1
Copy link
Contributor

See

if(parameterList->isParameter("ICNTL(1)"))

ICNTL(1) is already recognized, you just need to pass an int instead of on. We just past the int to MUMPS.

@davoodansari
Copy link
Author

Thank you Siva
ICNTL(1) has nothing to do with use of symmetric matrices. I was merely trying to pass parameters to MUMPS before getting to deep. And I did try to set it to integer 1:

        amesosParamList = Teuchos::createParameterList("Amesos2");
        Teuchos::ParameterList &MumpsList = amesosParamList->sublist("MUMPS");
        MumpsList.set("ICNTL(1)", 1);

and got this error at runtime:

terminate called after throwing an instance of 'Teuchos::Exceptions::InvalidParameterType'
what(): Error, the parameter {name="ICNTL(1)",type="int",value="1"}
in the parameter (sub)list "Amesos2->MUMPS"
exists in the list of valid parameters but has the wrong type.

The correct type is "string".

It seems to me as there is a bug involved in this.
Now the parameter that controls symmtery is "sym". I don't think we are passing anthing to MUMPS that would control this.

@davoodansari
Copy link
Author

I added the sym parameter by adding these lines to Amesos2_MUMPS_def.hpp
In setParameters_impl :
if(parameterList->isParameter("sym"))
{
mumps_par.sym = getIntegralValue<local_ordinal_type>(*parameterList,"sym");
}
In getValidParameters_impl:
pl->set("sym", 0, "See Manual" );

Now I am getting the error about validator which I am not sure what it implies or how it can be resolved:

terminate called after throwing an instance of 'Teuchos::Exceptions::InvalidParameterType'
what(): Error! The parameter "sym" exists
in the parameter (sub)list "Amesos2->MUMPS"
but it does not contain any validator needed to extract an integral value of type "int"!
Throw number = 1

Any suggestions on how to address this??

@davoodansari
Copy link
Author

OK, upon further research I was able to create a sol called validator and get to change the mumps_par in Amesos2_MUMPS_def.hpp (with some corrections to the code there as well )
This had absolutely no impact on the solver behavior since the mumps_par struct is passed to the solver via mumps_c function and for the symmetry parameter 'sym' to work it must be set at the time of creation of the solver. This happens in Amesos2_MUMPS_def.hpp inside this function

MUMPS<Matrix,Vector>::MUMPS(
Teuchos::RCP A,
Teuchos::RCP X,
Teuchos::RCP B)
: SolverCoreAmesos2::MUMPS,Matrix,Vector(A, X, B)
{
.
.
.
}

Question is, how do I get the knowledge of matrix symmetry (or the lack of) into this function?
When creating an Amesos2 solver what native parameter or member is used to indicate the symmetry property of the underlying operator?

Andy advise is highyl appreciated.

@github-actions
Copy link

This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity.
If you would like to keep this issue open please add a comment and/or remove the MARKED_FOR_CLOSURE label.
If this issue should be kept open even with no activity beyond the time limits you can add the label DO_NOT_AUTOCLOSE.
If it is ok for this issue to be closed, feel free to go ahead and close it. Please do not add any comments or change any labels or otherwise touch this issue unless your intention is to reset the inactivity counter for an additional year.

@github-actions github-actions bot added the MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. label Sep 25, 2021
@github-actions
Copy link

github-actions bot commented Nov 3, 2021

This issue was closed due to inactivity for 395 days.

@github-actions github-actions bot added the CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. label Nov 3, 2021
@github-actions github-actions bot closed this as completed Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. pkg: Amesos2 type: question
Projects
None yet
Development

No branches or pull requests

3 participants