[petsc-users] Check Array and String Bounds in PETSc

Barry Smith bsmith at mcs.anl.gov
Mon Oct 20 13:00:10 CDT 2014


> On Oct 20, 2014, at 11:56 AM, Danyang Su <danyang.su at gmail.com> wrote:
> 
> On 19/10/2014 5:06 PM, Barry Smith wrote:
>>   Use ISLocalToGlobalMappingGetIndicesF90()
> Hi Barry,
> 
> Would you please give my a brief introduction or example on the parameters for this function? I didn't find it in the PETSc manual page.
> The following codes will cause stack overflow. Maybe the idx data type is wrong here. Would you please let me know what data type should be used here?
> 
> PetscInt, pointer :: idx(:)
> call DMGetLocalToGlobalMapping(dmda_flow%da,ltogm,ierr)
> call ISLocalToGlobalMappingGetIndicesF90(ltogm,idx,ierr)

   Your code above looks ok. You’ll have to be more specific as to what goes wrong. Can you reproduce it in a small example that demonstrates the problem?

  Barry

> 
> Thanks,
> 
> Danyang
>> 
>> 
>>> On Oct 19, 2014, at 6:38 PM, Danyang Su <danyang.su at gmail.com> wrote:
>>> 
>>> Hi All,
>>> 
>>> How can I avoid "array bounds" error when using PETSc. I have to debug my codes so I compiled the codes with option "Check Array and String Bounds". But  this results into array bounds error when I need to use ltog, as shown below.
>>>        call DMGetLocalToGlobalMapping(dmda_flow%da,ltogm,ierr)
>>>        call ISLocalToGlobalMappingGetIndices(ltogm,ltog,idltog,ierr)
>>> Exactly the aforementioned two lines work fine and the bug is in somewhere else. But the debug process just stops at the codes when ltog is used. How can avoid this?
>>> 
>>> Thanks,
>>> 
>>> Danyang
> 



More information about the petsc-users mailing list