[petsc-dev] Zero sized VecSetValues

Barry Smith bsmith at mcs.anl.gov
Fri Dec 12 22:50:59 CST 2014


  Pierre,

   Please find attached a patch to fix this; after applying the patch do 

make gnumake

in the root PETSc directory and relink your code.

   Thanks for reporting the problem

  Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: allow-null-vecsetvalues.patch
Type: application/octet-stream
Size: 1081 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20141212/73bf1e5c/attachment.obj>
-------------- next part --------------

> On Dec 12, 2014, at 7:16 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
> 
>  Pierre,
> 
>    There is no rational, we will fix it. 
> 
>  Barry
> 
> 
>> On Dec 12, 2014, at 11:47 AM, Pierre Jolivet <jolivet at ann.jussieu.fr> wrote:
>> 
>> Hello,
>> Taking http://www.mcs.anl.gov/petsc/petsc-current/src/vec/vec/examples/tutorials/ex2.c.html and changing its 56th line from
>> VecSetValues(x,1,&i,&one,ADD_VALUES);
>> to
>> VecSetValues(x,0,NULL,NULL,ADD_VALUES);
>> yield the following error (at least --with-debug=1):
>> [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
>> [0]PETSC ERROR: Invalid pointer
>> [0]PETSC ERROR: Null Pointer: Parameter # 3
>> 
>> What is the rationale behind first checking the pointers, then doing the work or lack thereof, instead of, first checking if there is some work to do, and only then check the pointers (? la MPI) ?
>> 
>> Thank you for your help,
>> Pierre
> 



More information about the petsc-dev mailing list