[mpich-discuss] Reduction with MPI_CHAR

Jeff Hammond jeff.science at gmail.com
Sat Apr 6 21:47:41 CDT 2019


I’d create a GitHub issue for this.

Checking for incorrect usage is a quality-of-implementation issue but I’m
sure the devs want to fix this. It’s easy enough.

Jeff

On Fri, Apr 5, 2019 at 8:21 AM Zhang, Junchao via discuss <discuss at mpich.org>
wrote:

> MPI 3.1 Chapter 5.9.3 reads "MPI_CHAR, MPI_WCHAR, and MPI_CHARACTER (which
> represent printable characters) cannot be used in reduction operations".
> But the following code with MPICH does not abort.
>
> #include <mpi.h>
> #include <stdlib.h>
> int main(int argc, char* argv[])
> {
>   char a ='A',b;
>   MPI_Init(&argc,&argv);
>   if(MPI_Allreduce(&a,&b,1,MPI_CHAR,MPI_SUM,MPI_COMM_WORLD)) abort();
>   MPI_Finalize();
> }
> --Junchao Zhang
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
>
-- 
Jeff Hammond
jeff.science at gmail.com
http://jeffhammond.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20190406/0982e5a8/attachment.html>


More information about the discuss mailing list