Problem with VecPlaceArray_MPI & VecResetArray

Barry Smith bsmith at mcs.anl.gov
Fri Aug 8 16:41:35 CDT 2008


    This is an error on our part. We've never used the VecPlaceArray()  
when working with vectors
with local representations. I will let you know when I have pushed  
fixed code.

    BTW: be careful when using the VecPlaceArray() in this case, you  
should make sure that the
array is long enough for the ghost points at the end.

    Barry



On Aug 8, 2008, at 4:03 PM, Eric Chamberland wrote:

> Hi,
>
> I try to use the VecPlaceArray/VecResetArray functions.
>
> Unfortunately, the call to VecPlaceArray only work the firsdt time I  
> do it, even if I call VecResetArray before the next call...
>
> the code looks like this:
>
> VecPlaceArray(vec, myvec);
> ...
> VecResetArray(vec);
> VecPlaceArray(vec, myvec2);  /* PETSCERROR ON THIS LINE*/
>
> The error I get is the following (from src/vec/vec/impls/seq/dvec2.c: 
> 975):
>
>  if (v->unplacedarray)  
> SETERRQ(PETSC_ERR_ARG_WRONGSTATE,"VecPlaceArray() was already called  
> on this vector, without a call to VecResetArray()");
>
>
> After looking at the code, I found that MPI vectors where defining a  
> VecPlaceArray_MPI which call VecPlaceArray on the "child" v- 
> >localrep (ref: src/vec/vec/impls/mpi/pbvec.c:79), but I haven't  
> found an "overload" of VecResetArray that would do the same work.   
> Is that the problem?
>
> I am using PETSc 2.3.3-p6.
>
> Thanks,
>
> Eric
>




More information about the petsc-dev mailing list