Comments (4)
Hi Robert.
The trick is in two special lines in the matrix header:
%%MatrixMarket matrix coordinate real general
%%AMGX 1 1 sorted rhs solution
For MatrixMarket header we can read 'coordinate', 'general', 'symmetric', 'skew-symmetric', 'real', 'complex' matrices.
For AMGX header we use similar keywords features:
- Two integers - blocksizes.
- 'sorted' means nonzero elements are sorted (by-row, by-column).
- 'diagonal' means that diagonal is stored separately from matrix. N values from input file right after nonzeros will be considered as diagonal and special flag for matrix will be set that diagonal is not stored in CSR structure.
- 'rhs' means that right hand side is present in this file and N values from input file after matrix will be read as RHS
- 'solution' means that initial solution present in the file and N values from input file after matrix and (optional) rhs will be read as initial solution to system.
Typically diagonal entries are specified among the rest of nonzeros so it's likely that you should not use 'diagonal' keyword. Note that usually RHS stored is MatrixMarket format, but if you just want to 'cat' it to the main matrix - you should use RHS values only.
Example of matrix with RHS:
%%MatrixMarket matrix coordinate real general
%%AMGX 1 1 sorted rhs
2 2 4
1 1 2.0
1 2 0.5
2 1 0.5
2 2 2.0
0.3
1.5
Here 0.3 and 1.5 are RHS values for row 0 and 1 respectively. Also notice there is no 'diagonal' keyword in the header.
I hope that helps. Please let me know if something is not entirely clear.
Thanks!
from amgx.
Got it. I just converted the downloaded matrices and I think it worked. Yes, so I missed entirely the specification for %%AMGX
header. I think I just mixed up what's actual header and what's a comment. The example made it clear.
I have two quick questions. I am not sure if I understand block size. When do I use block size other than 1, 1? Also, it seems that block_dimx=1
is the only one supported according to the docs for distributed read. Should I just keep it 1, 1 for all matrices I download or generate?
from amgx.
I just converted the downloaded matrices and I think it worked.
Easiest way to check - see initial residual and compare it with some ground truth, for example by calculating it in matlab.
When do I use block size other than 1, 1?
Typically it can be used when you solve different equations on the same grid - thus equations are coupled and matrix has the block structure (i.e. pressure-velocity equations in CFD). It save memory for CSR storage and computational time when working on CSR structure (i.e. aggregation, coloring).
it seems that block_dimx=1 is the only one supported according to the docs for distributed read.
There are few routines for distributed data read/upload, some of them does work with blocksize=1x1 only.
Should I just keep it 1, 1 for all matrices I download or generate?
It's safe to always use 1x1. If you have some additional information about the problem - you might try block solvers.
from amgx.
Great. Thanks for a reply. It all makes sense to me now.
from amgx.
Related Issues (20)
- Last AmgX commit build issue with older nvcc version HOT 2
- Build issue with OMP requirement HOT 1
- AMGX 2.3.0 still indicates 2.2.0.132-opensource HOT 1
- Mixed precision modes not currently supported for CUDA 10.1 or later? HOT 2
- CMAKE [Build] error HOT 1
- [Build] v2.4.0 with Cuda 11.0 HOT 4
- Benchmarking HOT 1
- [Build] HOT 3
- Is there a way to reduce solve setup time? HOT 1
- [Build] Build Error with MVAPICH2-GDR HOT 5
- Seeking Advice on Configuring AMGX for Solving a Poorly-Conditioned Matrix Equation
- Seeking Advice on Configuring AMGX for Solving a Poorly-Conditioned Matrix Equation HOT 2
- [Issue] Recovering from out of memory error
- [Build] OKay to ENABLE NvToolsExt for Windows? HOT 2
- [Build] CMake Error in Windows with GCC HOT 2
- [Build] _NV_IF__NV_TARGET_BOOL_NV_PROVIDES_SM_90 is undefined HOT 1
- Error trying to build an app that uses AmgX HOT 6
- AMGX Fails to Converge to the Correct Solution
- Seeking advice for setting up solver for finite element
- [Issue]solution depends on the number of levels of AMG grid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amgx.