[petsc-users] No warning or error message of segmentation violation

Li, Zhisong (lizs) lizs at mail.uc.edu
Fri Nov 5 16:22:28 CDT 2010


 Hi, Petsc Team,

I use DA object to create structured data array based on global vectors. Recently, I checked my code and found an array with index out of range. But the code can run without any warning or segmentation violation message. At first I thought this might be a cache problem. But later I ran a simpler test code on another machine and it gave no error either. I did not use any periodic boundary setting.

This never took place in the past from my experience, as Petsc could always detect any segmentation violation. So what's wrong with it this time? The following is the main part of my sequential test code:

  DACreate3d(PETSC_COMM_WORLD,DA_NONPERIODIC,DA_STENCIL_BOX,m,n,q,PETSC_DECIDE,PETSC_DECIDE,PETSC_DECIDE,1,1,PETSC_NULL,PETSC_NULL,PETSC_NULL,&da);
  DACreateGlobalVector(da, &elev);
  VecSet(elev, 3.14159265);
  DAVecGetArray(da, elev, &ele);
  PetscPrintf(PETSC_COMM_WORLD, "ele[3][3][%D] is %4.3e\n", m+120, ele[3][3][m+120]);
  DAVecRestoreArray(da, elev, &ele);
  VecDestroy(elev);
  DADestroy(daw);


Thank you very much.


Zhisong Li
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101105/fe49974a/attachment.htm>


More information about the petsc-users mailing list