Wiki
Clone wikiGHOST / IO
Input data (i.e., matrices and vectors) for GHOST have to be present in special binary data formats.
Sparse matrices
Sparse matrices are stored in CRS format. The binary file is assembled as follows:
-
4 bytes: Indicator whether data is stored in little or big endian format.
- 0: little endian
- else: big endian
All the following data will be assumed to have this endianess.
-
4 bytes: Indicator for version of data format. (this version: 1)
-
4 bytes: Indicator for base of indices (row pointers and column indices).
- 0: indices are 0-based (as in C)
- 1: indices are 1-based (as in Fortran)
Any other base except 0 and 1 is not supported at this time.
-
4 bytes: Symmetry information bit field; multiple may be combined.
- 1: general
- 2: symmetric
- 4: skew-symmetric
- 8: hermitian
Example: Matrix is hermitian and skew-symmetric: 12
-
4 bytes: Data type bit field; multiple may be combined.
- 1: float
- 2: double
- 4: real
- 8: complex
Example: Matrix has complex float values: 9
-
8 bytes: An integer telling the number of rows (N) of the matrix
-
8 bytes: An integer telling the number of columns (M) of the matrix
-
8 bytes: An integer telling the number of nonzero entries (E) of the matrix
-
(N+1)*8 bytes: The row pointers (integer) of the CRS matrix
-
E*8 bytes: The columns indices of the matrix entries
-
E*sizeof(datatype) bytes: The values of the matrix entries
NOTE: In the case of any set symmetry flag except general, only the right part of the matrix is to be stored. The number of entries and row pointers always relate to the stored matrix and not to the full one (if symmetric). Due to this constraint, the stored matrix is always a valid one.
Dense matrices/vectors
Dense matrices, vectors and multi-vectors (groups of vectors) are represented by the same data structure.
-
4 bytes: Indicator whether data is stored in little or big endian format.
- 0: little endian
- else: big endian
All the following data will be assumed to have this endianess.
-
4 bytes: Indicator for version of data format. (this version: 1)
-
4 bytes: Indicator for the storage order of the values.
- 0: column-major
- 1: row-major
For one-dimensional vectors, this indicator has no influence.
-
4 bytes: Data type bit field; multiple may be combined.
- 1: float
- 2: double
- 4: real
- 8: complex
Example: Matrix has complex float values: 9
-
8 bytes: An integer telling the number of rows (N) of the vector/matrix
-
8 bytes: An integer telling the number of columns (M) of the vector/matrix
-
NMsizeof(datatype) bytes: The vector/matrix entries
Updated