Skip to content
Snippets Groups Projects
Commit 17ab9b01 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix prealloc (make sure it's smaller than matrix size)

parent cc10eb4a
No related branches found
No related tags found
No related merge requests found
......@@ -399,9 +399,9 @@ namespace onelabUtils {
x.setStep((x.getMax() - x.getMin()) / 100.);
}
if(val && isInteger){
x.setMin((int) x.getMin());
x.setMax((int) x.getMax());
x.setStep((int) x.getStep());
x.setMin((int)x.getMin());
x.setMax((int)x.getMax());
x.setStep((int)x.getStep());
}
}
}
......
......@@ -103,9 +103,10 @@ void linearSystemPETSc<scalar>::preAllocateEntries()
int blockSize = _getBlockSizeFromParameters();
std::vector<int> nByRowDiag (_localSize), nByRowOffDiag (_localSize);
if (_sparsity.getNbRows() == 0) {
PetscInt prealloc = std::min(300,_localSize);
PetscInt prealloc = 300;
PetscBool set;
PetscOptionsGetInt(PETSC_NULL, "-petsc_prealloc", &prealloc, &set);
prealloc = std::min(prealloc, _localSize);
nByRowDiag.resize(0);
nByRowDiag.resize(_localSize, prealloc);
} else {
......
ss = Sprintf(" (CPU = %g s, Memory = %g Mb)", Cpu, Memory);
Printf( StrCat(Today, ss) );
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment