[petsc-users] DMLocalToGlobal PETScSF is BROKEN
Dharmendar Reddy
dharmareddy84 at gmail.com
Thu Jan 23 15:42:50 CST 2014
Hello,
How should i fix the issue mentioned below ?
Sent from my HTC smartphone on the Now Network from Sprint!
----- Reply message -----
From: "Dharmendar Reddy" <dharmareddy84 at gmail.com>
To: "Jed Brown" <jed at jedbrown.org>
Cc: "Barry Smith" <bsmith at mcs.anl.gov>, "PETSc users list" <petsc-users at mcs.anl.gov>
Subject: [petsc-users] DMLocalToGlobal PETScSF is BROKEN
Date: Wed, Jan 22, 2014 5:26 pm
Hello,
I have attached the test case which demonstrates the problem.
The following is the issue:
globalX1=1.0
globalX2=2.0
localX1=-1.0
localX2=-2.0
Begin: localX1 to globalX1
Begin: localX2 to globalX2
End: localX1 to globalX1
End: localX2 to globalX2
i get globalX1 = -2 and globalX2 = -1.0 instead of globalX1 = -1 and
globalX2 = -2.0
When my code crashed, i was doing this to set the ub and lb vectors
for SNES and (now) obviously the code did not progress as the ub and
lb were swaped. Should the snes warn for such case where lb < ub is
not valid, by user error or otherwise as in this case.
On Wed, Jan 22, 2014 at 4:39 PM, Jed Brown <jed at jedbrown.org> wrote:
> Barry Smith <bsmith at mcs.anl.gov> writes:
>> Ok, well the damn code is so convoluted it is hard to see that it
>> is even trying to do things right for multiple independent calls.
>
> How would you change this to make it less convoluted?
>
> static PetscErrorCode PetscSFReduceEnd_Basic(PetscSF sf,MPI_Datatype unit,const void *leafdata,void *rootdata,MPI_Op op)
> {
> void (*UnpackOp)(PetscInt,const PetscInt*,void*,const void*);
> PetscErrorCode ierr;
> PetscSFBasicPack link;
> PetscInt i,nrootranks;
> const PetscInt *rootoffset,*rootloc;
>
> PetscFunctionBegin;
> ierr = PetscSFBasicGetPackInUse(sf,unit,rootdata,PETSC_OWN_POINTER,&link);CHKERRQ(ierr);
> /* This implementation could be changed to unpack as receives arrive, at the cost of non-determinism */
> ierr = PetscSFBasicPackWaitall(sf,link);CHKERRQ(ierr);
> ierr = PetscSFBasicGetRootInfo(sf,&nrootranks,NULL,&rootoffset,&rootloc);CHKERRQ(ierr);
> ierr = PetscSFBasicPackGetUnpackOp(sf,link,op,&UnpackOp);CHKERRQ(ierr);
> for (i=0; i<nrootranks; i++) {
> PetscMPIInt n = rootoffset[i+1] - rootoffset[i];
> const void *packstart = link->root+rootoffset[i]*link->unitbytes;
>
> (*UnpackOp)(n,rootloc+rootoffset[i],rootdata,packstart);
> }
> ierr = PetscSFBasicReclaimPack(sf,&link);CHKERRQ(ierr);
> PetscFunctionReturn(0);
> }
>
>
>> You’ll have to pry out of Dhamendar his test case that fails.
>
> That would be useful.
--
-----------------------------------------------------
Dharmendar Reddy Palle
Graduate Student
Microelectronics Research center,
University of Texas at Austin,
10100 Burnet Road, Bldg. 160
MER 2.608F, TX 78758-4445
e-mail: dharmareddy84 at gmail.com
Phone: +1-512-350-9082
United States of America.
Homepage: https://webspace.utexas.edu/~dpr342
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140123/848b3ed3/attachment.html>
More information about the petsc-users
mailing list