Skip to content
Snippets Groups Projects
Commit 23277371 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

linearSystemPETSc<fullMatrix<double> > : some petsc version require to

set the ROW_ORIENTED option after the matrix pre-allocation
parent c6e53ad9
No related branches found
No related tags found
No related merge requests found
...@@ -137,6 +137,8 @@ void linearSystemPETSc<scalar>::preAllocateEntries() ...@@ -137,6 +137,8 @@ void linearSystemPETSc<scalar>::preAllocateEntries()
else else
_try(MatMPIBAIJSetPreallocation(_a, blockSize, 0, &nByRowDiag[0], 0, &nByRowOffDiag[0])); _try(MatMPIBAIJSetPreallocation(_a, blockSize, 0, &nByRowDiag[0], 0, &nByRowOffDiag[0]));
} }
if (blockSize > 1)
_try(MatSetOption(_a, MAT_ROW_ORIENTED, PETSC_FALSE));
_entriesPreAllocated = true; _entriesPreAllocated = true;
} }
...@@ -151,12 +153,11 @@ void linearSystemPETSc<scalar>::allocate(int nbRows) ...@@ -151,12 +153,11 @@ void linearSystemPETSc<scalar>::allocate(int nbRows)
_try(MatSetSizes(_a, blockSize * nbRows, blockSize * nbRows, PETSC_DETERMINE, PETSC_DETERMINE)); _try(MatSetSizes(_a, blockSize * nbRows, blockSize * nbRows, PETSC_DETERMINE, PETSC_DETERMINE));
if (blockSize > 1) { if (blockSize > 1) {
if (commSize > 1) { if (commSize > 1) {
MatSetType(_a, MATMPIBAIJ); _try(MatSetType(_a, MATMPIBAIJ));
} }
else { else {
MatSetType(_a, MATSEQBAIJ); _try(MatSetType(_a, MATSEQBAIJ));
} }
MatSetOption(_a, MAT_ROW_ORIENTED, PETSC_FALSE);
} }
// override the default options with the ones from the option // override the default options with the ones from the option
// database (if any) // database (if any)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment