[petsc-users] VecDuplicate throwing error messages

Hui Zhang mike.hui.zhang at hotmail.com
Sat Feb 16 05:55:06 CST 2013


Yes! Thank you!
On Feb 16, 2013, at 12:46 PM, Matthew Knepley wrote:

> On Sat, Feb 16, 2013 at 5:46 AM, Hui Zhang <mike.hui.zhang at hotmail.com> wrote:
> I updated petsc-dev just now with the last changeset:   26190:c5c1560f6126
> 
> I reconfigure and rebuild petsc.  I modified src/sys/threadcomm/examples/tutorials/ex4.c to include a VecDuplicate like the following ediff file (see behind, ! indicating the modifications).
> 
> Then I got error messages (using mpiexec -np 1)
> 
> [0]PETSC ERROR: PetscCommGetThreadComm() line 111 in /Users/huizhang/Software/petsc-dev/src/sys/threadcomm/interface/threadcomm.c
> [0]PETSC ERROR: PetscThreadCommRunKernel0() line 792 in /Users/huizhang/Software/petsc-dev/src/sys/threadcomm/interface/threadcomm.c
> [0]PETSC ERROR: PetscThreadCommStackDestroy() line 197 in /Users/huizhang/Software/petsc-dev/src/sys/threadcomm/interface/threadcomm.c
> [0]PETSC ERROR: PetscThreadCommDestroy() line 242 in /Users/huizhang/Software/petsc-dev/src/sys/threadcomm/interface/threadcomm.c
> [0]PETSC ERROR: Petsc_DelThreadComm() line 71 in /Users/huizhang/Software/petsc-dev/src/sys/threadcomm/interface/dlregisthreadcomm.c
> [0]PETSC ERROR: PetscFinalize() line 1269 in /Users/huizhang/Software/petsc-dev/src/sys/objects/pinit.c
> 
> You failed to VecDestroy the vector.
> 
>    Matt
>  
> Using more processes gives such error messages for each process (or thread?).  I use scalar-tye complex number.
> 
> I also got the same error messages from my application programs (still with scalar-type complex), in which I do not include petscthreadcomm.h.
> 
> 
> *** 12,18 ****
>   {
>     PetscErrorCode ierr;
>     PetscScalar    dot=0.0,v;
> !   Vec            x,y;
>     PetscInt       N  =8;
>     PetscScalar    one=1.0,two=2.0,alpha=2.0;
> 
> --- 12,18 ----
>   {
>     PetscErrorCode ierr;
>     PetscScalar    dot=0.0,v;
> !   Vec            x,y,z;
>     PetscInt       N  =8;
>     PetscScalar    one=1.0,two=2.0,alpha=2.0;
> 
> *** 26,32 ****
>     ierr = VecSetFromOptions(x);CHKERRQ(ierr);
>     ierr = VecSet(x,one);CHKERRQ(ierr);
>     ierr = PetscPrintf(PETSC_COMM_WORLD,"x = %lf\n",PetscRealPart(one));CHKERRQ(ierr);
> !
>     ierr = VecCreate(PETSC_COMM_WORLD,&y);CHKERRQ(ierr);
>     ierr = VecSetSizes(y,PETSC_DECIDE,N);CHKERRQ(ierr);
>     ierr = VecSetFromOptions(y);CHKERRQ(ierr);
> --- 26,32 ----
>     ierr = VecSetFromOptions(x);CHKERRQ(ierr);
>     ierr = VecSet(x,one);CHKERRQ(ierr);
>     ierr = PetscPrintf(PETSC_COMM_WORLD,"x = %lf\n",PetscRealPart(one));CHKERRQ(ierr);
> !   ierr = VecDuplicate(x,&z); CHKERRQ(z);
>     ierr = VecCreate(PETSC_COMM_WORLD,&y);CHKERRQ(ierr);
>     ierr = VecSetSizes(y,PETSC_DECIDE,N);CHKERRQ(ierr);
>     ierr = VecSetFromOptions(y);CHKERRQ(ierr);
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener



More information about the petsc-users mailing list