VecGetArray and VecCreateGhostWithArray

Barry Smith bsmith at mcs.anl.gov
Tue Sep 9 23:52:52 CDT 2008


    Looks like this is a bug that got introduced along the way; thanks  
for reporting it. I've fixed it
for you.

    If you do hg pull; hg update; cd src/vec/vec/impls/mpi; make ;  
then the problem should go
away.

    Barry

On Sep 9, 2008, at 10:34 PM, Chris Kees wrote:

> In going from 2.3.3-p12 to petsc-dev, I'm getting a change in  
> behavior that
> I don't understand. With 2.3.3 I could allocate a local ghosted  
> array, build
> a Vec with it, and then be sure of getting the exact same array from
> GetArray. Now I have to use PlaceArray to get that behavior. For  
> example I
> now have to include the commented line below or the assertion fails:
>
> VecCreateGhostWithArray 
> (PETSC_COMM_WORLD,n,N,nghost,&ghosts[0],array,&v);
> //VecPlaceArray(v,array);
> VecGetArray(v,&varray);
> assert(varray==array);
>
> Does this mean VecCreateGhostWithArray is allocating it's own  
> memory? This
> is on mac osx 10.5 built as i386. The code works fine using  
> VecPlaceArray so
> it's not that big of a deal.
>
> Chris
>




More information about the petsc-dev mailing list