Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • I INMOST
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Terekhov
  • INMOST
  • Wiki
  • 1590 MatSolve Example

1590 MatSolve Example · Changes

Page history
MatSolve changed authored Nov 29, 2016 by Dmitry Bagaev's avatar Dmitry Bagaev
Hide whitespace changes
Inline Side-by-side
1590-MatSolve-Example.md
View page @ d9a509a1
# Solve the Matrix stored in mtx format # Solve the Matrix stored in mtx format
The code for this example is located in `examples/MatSolve` The code for this example is located in `Examples/MatSolve`
## Brief ## Brief
...@@ -13,26 +13,24 @@ The code loads the matrix and right-hand side from files. If right-hand side is ...@@ -13,26 +13,24 @@ The code loads the matrix and right-hand side from files. If right-hand side is
## Arguments ## Arguments
``` ```
Usage: ./MatSolve method_number<0:INNER_ILU2,1:INNER_MLILUC,2:PETSc,3:Trilinos_Aztec,4:Trilinos_Belos,5:Trilinos_Ifpack,6:Trilinos_ML,7:ANI> matrix.mtx [right_hand_side.rhs] [solver_options.txt] Usage: ./MatSolve -m "matrix.mtx" [arguments]
``` ```
- First parameter is the Solver type:
+ 0 – `INNER_ILU2`, inner Solver based on BiCGStab(L) solver with second order ILU factorization as preconditioner; - Available arguments
+ 1 – `INNER_MLILUC`, inner Solver based on BiCGStab(L) solver with second order Crout-ILU with inversed-based condition estimation and unsymmetric reordering for diagonal dominance as preconditioner; * Required
+ 2 – `PETSc`, external Solver AztecOO from Trilinos package; + -m, --matrix, specifies path to the matrix file, e.g. "/tmp/A.mtx"
+ 3 – `Trilinos_Aztec`, external Solver Belos from Trilinos package, currently without preconditioner; * Optional
+ 4 – `Trilinos_Belos`, external Solver AztecOO with ML preconditioner; + -b, --bvector, specifies path to the rhs file, e.g. "/tmp/b.rhs"
+ 5 – `Trilinos_Ifpack`, external Solver AztecOO with Ifpack preconditioner; + -x, --xvector, specifies path to the solution
+ 6 – `Trilinos_ML`, external Solver PETSc; + -p, --parameters, specifies path to the database file, see `Examples/MatSolve/database.xml` as example;
+ 7 – `ANI`, external Solver from ANI3D based on ILU2 (sequential Fortran version). + -t, --type, specifies solver type, "inner_ilu2" by default
- Second parameter is the file with matrix in mtx format. + -h, --help, prints help message
- Third optional parameter is the file with right-hand side in mtx format.
- Fourth optional parameter is the file with solver parameters, see `examples/MatSolve/database.txt` as example.
## Running example ## Running example
You can generate matrices using [[FVDiscr|1710-FVDiscr-Example]] example. The following line uses matrix `/tmp/A.mtx` and right-hand side `/tmp/b.rhs` from [[FVDiscr example|1710-FVDiscr-Example#running-example]]. You can generate matrices using [[FVDiscr|1710-FVDiscr-Example]] example. The following line uses matrix `/tmp/A.mtx` and right-hand side `/tmp/b.rhs` from [[FVDiscr example|1710-FVDiscr-Example#running-example]].
``` ```
$ cd examples/MatSolve $ cd Examples/MatSolve
$ mpirun -np 4 ./MatSolve 0 /tmp/A.mtx /tmp/b.rhs $ mpirun -np 4 ./MatSolve -m /tmp/A.mtx -b /tmp/b.rhs
load matrix: 0.346156 load matrix: 0.346156
load vector: 0.0542159 load vector: 0.0542159
preconditioner: 0.516358 preconditioner: 0.516358
...@@ -43,4 +41,3 @@ norms: 0.00276518 ...@@ -43,4 +41,3 @@ norms: 0.00276518
reason: converged due to relative tolerance reason: converged due to relative tolerance
``` ```
Clone repository
  • 0100 Compilation
  • 0200 Compilation Windows
  • 0201 Obtain MSVC
  • 0202 Obtain MSMPI
  • 0203 Compilation INMOST Windows
  • 0204 Compilation ParMETIS Windows
  • 0205 Compilation Zoltan Windows
  • 0206 Compilation PETSc Windows
  • 0207 Compilation Trilinos Windows
  • 0400 Compilation Linux
  • 0401 Install MPI
  • 0402 Compilation INMOST Linux
  • 0403 Compilation PETSc Linux
  • 0404 Compilation Trilinos Linux
  • 0405 Compilation ParMETIS Linux
View All Pages