<div dir="ltr">I've pushed fixes for the PetscBool and PetscEnum instances. Please use MPIU_BOOL and MPIU_ENUM in new code. The Complex cases still produce warnings. Let me know if you object to my ripping out those special cases.<div>
<br></div><div><a href="https://bitbucket.org/petsc/petsc-dev/commits/659ebb827654e17cd01d6fb5cf1a54155f4e77a7">https://bitbucket.org/petsc/petsc-dev/commits/659ebb827654e17cd01d6fb5cf1a54155f4e77a7</a><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Dec 30, 2012 at 10:48 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I just fixed a bunch of dangerous type mismatches. Presumably a number of things were broken with 64-bit integers, at least in cases with overflow.<br><br><a href="https://bitbucket.org/petsc/petsc-dev/commits/146d1df88e306d69e6ce797932b1c3352fd7851c" target="_blank">https://bitbucket.org/petsc/petsc-dev/commits/146d1df88e306d69e6ce797932b1c3352fd7851c</a><br>

<br>These were warnings with clang-3.2. A year ago when people were working on this feature, I downplayed its importance, claiming that it's just not a mistake that I tend to make. Based on the sheer number of these mistakes in PETSc, I now believe it's a fantastic feature.<div>

<br></div><div>There are still a lot of warnings, though I believe the remaining ones are benign. (The most common is sending PetscBool as MPI_INT.) Since people will use clang-3.2 and we want to see the real mistakes, we have to silence these benign warnings. I'm working through annotation of these.<br>

<br>Another problem case is using a Real reduction of twice the size to sum Complex, e.g., in vscat.c. I suspect this code predates definition of MPIU_SUM working with complex, and can thus be removed. Is that the case, or is there some reason we need to keep both around?</div>

<div><br></div><div><div>#if defined(PETSC_USE_COMPLEX)</div><div>        ierr = MPI_Reduce(xv,xvt,2*xx_n,MPIU_REAL,MPIU_SUM,0,((PetscObject)ctx)->comm);CHKERRQ(ierr);</div><div>#else</div><div>        ierr = MPI_Reduce(xv,xvt,xx_n,MPIU_SCALAR,MPI_SUM,0,((PetscObject)ctx)->comm);CHKERRQ(ierr);</div>

<div>#endif</div></div><div><br></div></div>
</blockquote></div><br></div>