On Wed, Sep 8, 2010 at 3:26 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
On Sep 8, 2010, at 4:14 AM, Jed Brown wrote:<br>
<br>
> "to" is uninitialized here, it can't possibly work.<br>
><br>
> PetscErrorCode PETSCMAP1(VecScatterBegin)(VecScatter ctx,Vec xin,Vec yin,InsertMode addv,ScatterMode mode)<br>
> {<br>
> VecScatter_MPI_General *to,*from;<br>
> PetscScalar *xv,*yv,*svalues;<br>
> MPI_Request *rwaits,*swaits;<br>
> PetscErrorCode ierr;<br>
> PetscInt i,*indices,*sstarts,nrecvs,nsends,bs;<br>
><br>
> PetscFunctionBegin;<br>
> #if defined(PETSC_HAVE_CUDA)<br>
> if (xin->valid_GPU_array == PETSC_CUDA_GPU) {<br>
> if (!ctx->spptr) {<br>
> PetscInt *indices,n = to->n;<br>
> ierr = PetscMalloc(n*sizeof(PetscInt),&indices);CHKERRQ(ierr);<br>
> ierr = PetscMemcpy(indices,to->indices,n*sizeof(PetscInt));CHKERRQ(ierr);<br>
> ierr = PetscSortRemoveDupsInt(&n,indices);CHKERRQ(ierr);<br>
><br>
> ierr = PetscIntView(n,indices,0);CHKERRQ(ierr);<br>
><br>
> ierr = PetscFree(indices);CHKERRQ(ierr);<br>
> }<br>
> } else {<br>
> ierr = VecGetArrayRead(xin,(const PetscScalar**)&xv);CHKERRQ(ierr);<br>
> }<br>
> #else<br>
> ierr = VecGetArrayRead(xin,(const PetscScalar**)&xv);CHKERRQ(ierr);<br>
> #endif<br>
><br>
><br>
><br>
> The PETSC_HAVE_CUDA block was added by<br>
><br>
> changeset: 16792:571800d0bf67<br>
> parent: 16784:e7052ddd3def<br>
> user: Barry Smith <a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a><br>
> date: Mon Aug 23 18:37:40 2010 -0500<br>
> summary: better message in check of positive definite shift for ILU<br>
><br>
> With commit messages like these...<br>
<br>
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.<br></blockquote><div><br></div><div>Mac Hg! It rocks. Did you have an installation problem?</div>
<div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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.<br>
<br>
Barry<br>
<br>
><br>
><br>
> This can probably just get relocated to later in the function (after<br>
> "to" is resolved), but I hear that CUDA works (I'm fighting with a<br>
> broken CUDA environment at the moment), in which case this branch must<br>
> never be taken, so it should just be deleted.<br>
><br>
> Jed<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>