Chung-Kan Huang <[email protected]> writes: > [0]PETSC ERROR: Argument out of range! > > [0]PETSC ERROR: New nonzero at (79800,79800) caused a malloc!
This means allocation was incorrect. You should reproduce the problem with a smaller mesh so that you can debug why it does not work. > The problem went away after I did > PetscInt d_nz = max(d_nnz); > MatSeqAIJSetPreallocation<http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMPIAIJSetPreallocation.html#MatMPIAIJSetPreallocation>(A, > d_nz, > d_nnz); I do not believe this because the first argument (d_nz) is not used when d_nnz is non-NULL. > But like I mentioned the size of nnz varied and it can be very different > from row to row and it ran out memory pretty quick if the problem is large. > > I have checked my d_nnz array and it is correct and I wonder someone can > point out anything I missed. Run a smaller problem size in a debugger to find out why you have set more entries than you expected in that row.
pgpgFE_0zQQgA.pgp
Description: PGP signature
