<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Pedro Ricardo,
<div class=""><br class="">
</div>
<div class="">Thanks for reporting the issue. I have opened a GitHub issue, <a href="https://github.com/pmodels/mpich/issues/4170" class="">https://github.com/pmodels/mpich/issues/4170</a>, for better tracking.</div>
<div class=""><br class="">
</div>
<div class="">`mpi_f08` tries to use the iso-c-binding as much as it can and it has not been receiving as much test as `use mpi`. One of the reason is the compiler support has been sporadic. May I ask which compiler (include version) were you using?</div>
<div class=""><br class="">
</div>
<div class="">Anyway, we’ll look into it and hopefully get it fixed shortly.</div>
<div class=""><br class="">
<div class="">
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
— </div>
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
Hui Zhou</div>
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
Principal Software Development Specialist</div>
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
MCS | ANL</div>
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<br class="">
</div>
</div>
<br class="Apple-interchange-newline">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Nov 13, 2019, at 1:59 PM, Pedro Ricardo Souza via discuss <<a href="mailto:discuss@mpich.org" class="">discuss@mpich.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Hi
there, My name is Pedro Ricardo and I'm currently a researcher at a Fluid Dynamics Laboratory in Brazil.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">We
have a CFD software with 12 continuous years of development mostly in Fortran, and we've been using Mpich and Openmpi since the very beginning.</span>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br class="">
<div class="">Recently we started to refactor the code and write it using Fortran2008 standard and this includes the usage of the the newest MPI module for Fortran "<font face="monospace" class=""><b class="">mpi_f08</b></font>".<br class="">
</div>
</div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br class="">
</div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
So far no errors were present in Openmpi implementations and everything worked like a charm, but when we started compiling with Mpich lots of errors happened during execution.</div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br class="">
</div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
I was able so isolate and reproduce the error in a simpler code. Whenever<span style="font-family: arial, sans-serif;" class=""> "</span><font face="monospace" class=""><b class="">use mpi_f08</b></font><span style="font-family: arial, sans-serif;" class="">"
is present, the arrays passed to a MPI subroutine return with<span class="Apple-converted-space"> </span><b class="">C</b>-like indexes. If I allocate an standard array in Fortran (that starts with index<span class="Apple-converted-space"> </span><b class="">1</b>),
after the call of some MPI routine this array come back starting with index<span class="Apple-converted-space"> </span><b class="">0</b>. </span></div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<font face="arial, sans-serif" class="">And you can imagine that all access to this array will be wrong after that.</font></div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<font face="arial, sans-serif" class="">It is a funny behavior because if you put </font><span style="font-family: arial, sans-serif;" class="">"</span><font face="monospace" class=""><b class="">use mpi</b></font><span style="font-family: arial, sans-serif;" class="">"
instead of </span><span style="font-family: arial, sans-serif;" class="">"</span><font face="monospace" class=""><b class="">use mpi_f08</b></font><span style="font-family: arial, sans-serif;" class="">", the indexes do not change.</span></div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<font face="arial, sans-serif" class=""><br class="">
</font></div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<font face="arial, sans-serif" class="">The test is simple, allocate and array, print it's bound indexes, calls a </font><b class=""><font face="monospace" class="">MPI_Reduce</font></b><font face="arial, sans-serif" class=""> routine and print the array bounds
again. I've also tested other routines like<span class="Apple-converted-space"> </span></font><b class=""><font face="monospace" class="">MPI_ISend</font></b><font face="arial, sans-serif" class=""><span class="Apple-converted-space"> </span>and the error
also happens.</font></div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<font face="arial, sans-serif" class=""><br class="">
</font></div>
<blockquote style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; margin: 0px 0px 0px 40px; border: none; padding: 0px;" class="">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<font face="monospace" class="">program check_bounds</font><font face="monospace" class=""><br class="">
</font><font face="monospace" class=""> !Check Works<br class="">
</font><font face="monospace" class=""> ! use mpi</font><font face="monospace" class=""><br class="">
</font><font face="monospace" class=""> !Check Fails<br class="">
</font><font face="monospace" class=""> use mpi_f08<br class="">
</font><font face="monospace" class=""> <br class="">
</font><font face="monospace" class=""> implicit none<br class="">
</font><font face="monospace" class=""> integer:: mpi_ierr, proc_id, n_proc<br class="">
</font><font face="monospace" class=""> real, allocatable, dimension(:):: t1, t1_0</font> </blockquote>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<font face="monospace" class=""><br class="">
</font><font face="monospace" class=""> call MPI_Init(mpi_ierr) <br class="">
</font><font face="monospace" class=""> call MPI_Comm_rank(MPI_COMM_WORLD, proc_id, mpi_ierr)<br class="">
</font><font face="monospace" class=""> call MPI_Comm_size(MPI_COMM_WORLD, n_proc, mpi_ierr)</font> </blockquote>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<font face="monospace" class=""><br class="">
</font><font face="monospace" class=""> allocate(t1(5), t1_0(5))<br class="">
</font><font face="monospace" class=""> t1 = 1.0; t1_0 = 1.0</font> </blockquote>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<font face="monospace" class=""><br class="">
</font><font face="monospace" class=""> if (proc_id==0) then<br class="">
</font><font face="monospace" class=""> write(*,*)'Array Configuration Before:'<br class="">
</font><font face="monospace" class=""> write(*,'(a6,2(1x,i2))')'Low:',lbound(t1),lbound(t1_0)<br class="">
</font><font face="monospace" class=""> write(*,'(a6,2(1x,i2))')'Upper:',ubound(t1),ubound(t1_0)<br class="">
</font><font face="monospace" class=""> end if</font> </blockquote>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<font face="monospace" class=""><br class="">
</font><font face="monospace" class=""> CALL MPI_REDUCE(t1, t1_0, 5, MPI_REAL, MPI_SUM, 0, MPI_COMM_WORLD, mpi_ierr)</font> </blockquote>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<font face="monospace" class=""><br class="">
</font><font face="monospace" class=""> if (proc_id==0) then<br class="">
</font><font face="monospace" class=""> write(*,*)'Array Configuration After:'<br class="">
</font><font face="monospace" class=""> write(*,'(a6,2(1x,i2))')'Low:',lbound(t1),lbound(t1_0)<br class="">
</font><font face="monospace" class=""> write(*,'(a6,2(1x,i2))')'Upper:',ubound(t1),ubound(t1_0)<br class="">
</font><font face="monospace" class=""> end if</font> </blockquote>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<font face="monospace" class=""><br class="">
</font><font face="monospace" class=""> deallocate(t1, t1_0)</font><font face="monospace" class=""><br class="">
</font><font face="monospace" class=""> call MPI_Finalize(mpi_ierr)</font> </blockquote>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<font face="monospace" class=""><br class="">
</font><font face="monospace" class="">end program check_bounds</font></blockquote>
<div class=""><br class="">
</div>
</blockquote>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br class="">
</div>
<span style="caret-color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: arial, sans-serif;" class="">Thanks
for the attention,</span></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>