Problem with VecPlaceArray_MPI & VecResetArray

Barry Smith bsmith at mcs.anl.gov
Fri Aug 8 21:16:27 CDT 2008


    I've pushed the fix. If you recompile in src/vec/vec/impls/mpi it  
should go through.

    Please let us know if you still have problems,

    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