[petsc-users] MatSetValues problem

Ramsey, James J CIV (US) james.j.ramsey14.civ at mail.mil
Tue Mar 12 07:32:35 CDT 2013


________________________________________

I am having a problem with MatSetValues.  I have a two processor run
that spits the following error:

[0]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in
/Users/sg/petsc-3.3-p5/src/mat/impls/aij/mpi/mpiaij.c New nonzero at
(1,1) caused a malloc
[1]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in
/Users/sg/petsc-3.3-p5/src/mat/impls/aij/mpi/mpiaij.c New nonzero at
(18,-1) caused a malloc
________________________________________

The "New nonzero at <fill in the blank> caused a malloc" error looks like what happens if the preallocation is not exact. What happens if you add

call MatSetOption(Kglobal, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE, ierr)

after your call to your preallocation subroutine?


More information about the petsc-users mailing list