InsertGlobalValues and fill complete in TpetraCrsMatrix
Created by: kvmkrao
I used Tpetra to created a contiguous row map. The map is used to create objects for a sparse matrix of bandwidth 7(A) and vectors (x and b). The non-zero entries in the matrix are inserted via InsertGlobalValues(). for (int i=0; i< numMyElements; i++) { A->insertGlobalValues (gblRow, NumEntries, Values, Indices); } _A-_>fillComplete ();
The CrsMatrix (A) and MultiVectors are used to create the problem (Ax=b). And the problem is solved with BiCGStab (BiCGStabSolMgr) in Belos. I looked at the time spent in filling the matrix, Belos: BiCGStabSolMgr total solve time, Belos: Operation Opx and Belos: Operation Precx and observed that the most of the time is spent in filling the sparse matrix.
I am using Trilinos to solve the system of equations from a finite volume algorithm. The calls to trilinos at each inner iterations indicate the filling the Sparse matrix and vector and solving the system of equations with Belos.
time step 1
inner iteration 1 //calculate the non-zero entries in the matrix and vector
call trilinos // Trilinos solves the system of equations
inner iterations 2 //calculate the non-zero entries in the matrix and vector
call trilionos // Trilinos solves the system of equations
.
time step 2
inner iteration 1 //calculate the non-zero entries in the matrix and vector
call trilinos // Trilinos solves the system of equations
Please let me know the procedure to reduce the time spend in filling the matrix.