[petsc-dev] What is this even supposed to do?
Matthew Knepley
knepley at gmail.com
Wed Sep 8 08:52:39 CDT 2010
On Wed, Sep 8, 2010 at 3:26 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> On Sep 8, 2010, at 4:14 AM, Jed Brown wrote:
>
> > "to" is uninitialized here, it can't possibly work.
> >
> > PetscErrorCode PETSCMAP1(VecScatterBegin)(VecScatter ctx,Vec xin,Vec
> yin,InsertMode addv,ScatterMode mode)
> > {
> > VecScatter_MPI_General *to,*from;
> > PetscScalar *xv,*yv,*svalues;
> > MPI_Request *rwaits,*swaits;
> > PetscErrorCode ierr;
> > PetscInt i,*indices,*sstarts,nrecvs,nsends,bs;
> >
> > PetscFunctionBegin;
> > #if defined(PETSC_HAVE_CUDA)
> > if (xin->valid_GPU_array == PETSC_CUDA_GPU) {
> > if (!ctx->spptr) {
> > PetscInt *indices,n = to->n;
> > ierr = PetscMalloc(n*sizeof(PetscInt),&indices);CHKERRQ(ierr);
> > ierr =
> PetscMemcpy(indices,to->indices,n*sizeof(PetscInt));CHKERRQ(ierr);
> > ierr = PetscSortRemoveDupsInt(&n,indices);CHKERRQ(ierr);
> >
> > ierr = PetscIntView(n,indices,0);CHKERRQ(ierr);
> >
> > ierr = PetscFree(indices);CHKERRQ(ierr);
> > }
> > } else {
> > ierr = VecGetArrayRead(xin,(const PetscScalar**)&xv);CHKERRQ(ierr);
> > }
> > #else
> > ierr = VecGetArrayRead(xin,(const PetscScalar**)&xv);CHKERRQ(ierr);
> > #endif
> >
> >
> >
> > The PETSC_HAVE_CUDA block was added by
> >
> > changeset: 16792:571800d0bf67
> > parent: 16784:e7052ddd3def
> > user: Barry Smith bsmith at mcs.anl.gov
> > date: Mon Aug 23 18:37:40 2010 -0500
> > summary: better message in check of positive definite shift for ILU
> >
> > With commit messages like these...
>
> Sorry, my fault. It is because I don't have a decent hg commit tool that
> tells me what I changed so I can comment on it.
>
Mac Hg! It rocks. Did you have an installation problem?
Matt
> Yes that code is currently broken, I started in and then got distracted
> and didn't finish it. You can just stick it inside a #if defined(foo) for
> now.
>
> Barry
>
> >
> >
> > This can probably just get relocated to later in the function (after
> > "to" is resolved), but I hear that CUDA works (I'm fighting with a
> > broken CUDA environment at the moment), in which case this branch must
> > never be taken, so it should just be deleted.
> >
> > Jed
>
>
--
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20100908/2e6c8850/attachment.html>
More information about the petsc-dev
mailing list