<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">There is a challenge here because there is no standard type in C corresponding to REAL*16. Either the reduction operation needs to be written in Fortran or MPICH needs to figure out the compiler-dependent equivalent of REAL*16 that works in C. While GCC __float128 and Intel _Quad might be equivalent, this is not a rigorous assumption.<div><br></div><div>I recommend that you write your own user-defined reduction for REAL*16 with the reduction operation callback in Fortran.<br><div><br></div><div>Jeff</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 9, 2018 at 2:31 AM, Jiancang Zhuang <span dir="ltr"><<a href="mailto:zhuangjc@ism.ac.jp" target="_blank">zhuangjc@ism.ac.jp</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"><div>I have found that the fortran version mpi_reduce does not work for real*18. This can be shown by the following program. I have not test the C version of mpi_reduce. <br></div><div><br></div><div><br></div><div>c-----------------------<wbr>Fortran code begins -----------------------------<br></div><div><div> implicit real*8 (a-h, o-z)<br> include 'mpif.h'<br> real*16 h1, h<br><br><br> call mpi_init(ierr)<br> call mpi_comm_size(mpi_comm_world, nprocs, ierr)<br> call mpi_comm_rank(mpi_comm_world, myrank, ierr)<br><br><br> h1 = (myrank+4) *2.00000000000000<br> write(*,'(''before reduce --'', i4,2f12.8)')myrank, h1,h<br><br><br> call mpi_reduce(h1,h,1,mpi_long_<wbr>double,mpi_sum,0,<br> & mpi_comm_world,ierr)<br> write(*,'(''after reduce --'',i4,2f12.8)')myrank, h1,h<br><br> call mpi_bcast(h,1,mpi_long_double,<wbr>0,<br> & mpi_comm_world,ierr)<br><br> write(*,'(''bcastvalue -- '',i4,2f12.8)')myrank, h1,h<br><br> call mpi_finalize(ierr)<br> end<br><br>
<div>c-----------------------<wbr>Fortran code begins -----------------------------</div><div><br></div><div><br></div><div>$ mpif77 a.f -o a.out<br>$ mpirun -np 3 ./a.out<br>before reduce -- 1 10.00000000 0.00000000<br>after reduce -- 1 10.00000000 0.00000000<br>before reduce -- 2 12.00000000 0.00000000<br>before reduce -- 0 8.00000000 0.00000000<br>after reduce -- 2 12.00000000 0.00000000<br>after reduce -- 0 8.00000000 8.00000000<br>bcastvalue -- 0 8.00000000 8.00000000<br>bcastvalue -- 1 10.00000000 8.00000000<br>bcastvalue -- 2 12.00000000 8.00000000<br><br><br></div>
</div></div></div>
<br>______________________________<wbr>_________________<br>
discuss mailing list <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" rel="noreferrer" target="_blank">https://lists.mpich.org/<wbr>mailman/listinfo/discuss</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div>
</div>