[petsc-dev] MPI type mismatches

Jed Brown jedbrown at mcs.anl.gov
Sun Dec 30 22:48:00 CST 2012


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.

https://bitbucket.org/petsc/petsc-dev/commits/146d1df88e306d69e6ce797932b1c3352fd7851c

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.

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.

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?

#if defined(PETSC_USE_COMPLEX)
        ierr =
MPI_Reduce(xv,xvt,2*xx_n,MPIU_REAL,MPIU_SUM,0,((PetscObject)ctx)->comm);CHKERRQ(ierr);
#else
        ierr =
MPI_Reduce(xv,xvt,xx_n,MPIU_SCALAR,MPI_SUM,0,((PetscObject)ctx)->comm);CHKERRQ(ierr);
#endif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20121230/50ec4dc2/attachment.html>


More information about the petsc-dev mailing list