trilinos / Trilinos

Primary repository for the Trilinos Project
https://trilinos.org/
Other
1.21k stars 563 forks source link

Amesos2 using "amesos2_cholmod" solver generates wrong results #4133

Closed davoodansari closed 5 years ago

davoodansari commented 5 years ago

Hi everyone Spent some time compiling metis, chomod and on top of that trilinos (amesos2 with cholmod enabled). Then I modified one of the examples to see if the "amesos2_cholmod" solver is actually accessible. To my surpride, the solver generates wrong results, i.e. [-2.88889; 2.25; -5.66667; 3.4; 3.77778; 4.66667] instead of [1 2 3 4 5 6]. Below is the code and the actual output. Any ideas what can be wrong? Any advice is highly appreciated Thanks

output:

Kokkos::OpenMP::initialize WARNING: OMP_PROC_BIND environment variable not set In general, for best performance with OpenMP 4.0 or better set OMP_PROC_BIND=spread and OMP_PLACES=threads For best performance with OpenMP 3.1 set OMP_PROC_BIND=true For unit testing set OMP_PROC_BIND=false Amesos2 using 3P solver: amesos2_cholmod Amesos2 version 0.3d - 07/28/2011

code:

Solution : "Tpetra::MultiVector": Template parameters: Scalar: double LocalOrdinal: int GlobalOrdinal: int Node: Serial/Wrapper Global number of rows: 6 Number of columns: 1 Process 0 of 1: Local number of rows: 6 Column stride: 6 Values: [-2.88889; 2.25; -5.66667; 3.4; 3.77778; 4.66667]

int main(int argc, char argv[]) { Tpetra::ScopeGuard tpetraScope(&argc,&argv); typedef double Scalar; typedef Tpetra::Map<>::local_ordinal_type LO; typedef Tpetra::Map<>::global_ordinal_type GO; typedef Tpetra::CrsMatrix<Scalar,LO,GO> MAT; typedef Tpetra::MultiVector<Scalar,LO,GO> MV; using Tpetra::global_size_t; using Teuchos::tuple; using Teuchos::RCP; using Teuchos::rcp; const int s=9; const char solverNames[10] = {"shylubasker", "basker", "klu2", "superlu_dist", "superlu_mt", "superlu", "pardiso_mkl", "lapack", "mumps", "amesos2_cholmod"};

// Before we do anything, check that SuperLU is enabled if( !Amesos2::query(solverNames[s]) ) { std::cerr << solverNames[s] << " not enabled. Exiting..." << std::endl; return EXIT_SUCCESS; // Otherwise CTest will pick it up as failure, which it isn't really } else std::cout << "Amesos2 using 3P solver: " << solverNames[s] << std::endl;

Teuchos::RCP<const Teuchos::Comm > comm = Tpetra::getDefaultComm(); size_t myRank = comm->getRank(); std::ostream &out = std::cout; out << Amesos2::version() << std::endl << std::endl; const size_t numVectors = 1; // create a Map global_size_t nrows = 6; RCP<Tpetra::Map<LO,GO> > map = rcp( new Tpetra::Map<LO,GO>(nrows,0,comm) ); RCP A = rcp( new MAT(map,3) ); // max of three entries in a row /*

srajama1 commented 5 years ago

@ndellingwood Can you please take a look at this ?

mhoemmen commented 5 years ago

@trilinos/amesos2

davoodansari commented 5 years ago

I think I should take it back. I was so excited about being able to compile Trilinos with chomod enabled that I forgot Cholmod stands for Cholesky. The matrix has to be symmetric. I will verify that and close the issue shortly. Sorry for the rush folks.

davoodansari commented 5 years ago

Hypothesizes verified. Results are correct with a symmetric matrix. Issue closed.

davoodansari commented 5 years ago

Issue #4133 closed