[petsc-users] Segmentation fault in MatAssembly

Barry Smith bsmith at mcs.anl.gov
Sat Jan 30 19:15:06 CST 2016


   The most likely cause is due to integer overflow. For such large problems you should make a new PETSC_ARCH say arch-large and configure with the additional option --with-64-bit-indices then PetscInt will become a 64 bit integer which will never overflow. Make sure that your code always uses PetscInt for integers passed to PETSc and not int or Fortran integer.  If you do get crashes you can run in the debugger and likely you will find that somewhere you still have an int around instead of a PetscInt


> On Jan 30, 2016, at 6:56 PM, Bikash Kanungo <bikash at umich.edu> wrote:
> Hi,
> I'm getting segmentation fault while assembling large matrices (~4000000 X 4000000) across 480 processors. The error usually shows up randomly only in large problems (i.e, when I exceed matrix size of ~2000000x200000). There are few rows in my matrix for which non-local contributions are added from all other processors. So I believe the buffer size during MatSetValues gets larger with matrix size which in some way signals a segmentation fault. So is there a smart way of avoiding such error?
> Regards,
> Bikash  
> -- 
> Bikash S. Kanungo
> PhD Student
> Computational Materials Physics Group
> Mechanical Engineering 
> University of Michigan

More information about the petsc-users mailing list