[petsc-users] PetscSFReduceBegin can not handle MPI_CHAR?

Jed Brown jed at jedbrown.org
Thu Apr 4 10:30:27 CDT 2019

"Zhang, Junchao via petsc-users" <petsc-users at mcs.anl.gov> writes:

> MPI standard chapter 5.9.3, says "MPI_CHAR, MPI_WCHAR, and MPI_CHARACTER (which represent printable characters) cannot be used in reduction operations"
> So Fande's code and Jed's branch have problems. To fix that, we have to add support for signed char, unsigned char, and char in PetscSF.  The first two types support add, mult, logical and bitwise operations. The last is a dumb type, only supports pack/unpack. With this fix, PetscSF/MPI would raise error on Fande's code. I can come up with a fix tomorrow.

FWIW, my patch did not define arithmetic or comparison operations.  It
only added moving bytes for sizes smaller than MPI_INT.  Perhaps it
should, but that would require identifying more types, as you say.

More information about the petsc-users mailing list