Done.<br><br>Tatiana<br><br><div class="gmail_quote">2013/3/29 Rajeev Thakur <span dir="ltr"><<a href="mailto:thakur@mcs.anl.gov" target="_blank">thakur@mcs.anl.gov</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Another reminder that you should call it MPIX_Pattern instead of MPI_Pattern.<br>
<span class="HOEnZb"><font color="#888888"><br>
Rajeev<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Mar 29, 2013, at 3:11 PM, Tatiana V. Martsinkevich wrote:<br>
<br>
> Hello,<br>
><br>
> Thanks again for your help Dave.<br>
><br>
> So we went the other way around and changed the type of MPI_Pattern from void* to integer and now fortran interfaces are being generated correctly. However, now the question is how to register the new type MPI_Pattern so that we could use it in fortran programs. This also doesn't seem to be trivial...<br>
><br>
> In buildface there are this kind of code sections:<br>
><br>
> # Datatypes<br>
> # These are determined and set at configure time<br>
> foreach $key (COMPLEX, DOUBLE_COMPLEX, LOGICAL, REAL, DOUBLE_PRECISION, INTEGER, '2INTEGER', '2DOUBLE_PRECISION', '2REAL', CHARACTER) {<br>
> print MPIFFD " INTEGER MPI_$key\n";<br>
> print MPIFFD " PARAMETER (MPI_$key=\@MPI_$key\@)\n";<br>
> }<br>
><br>
> this looks like where I should start digging but apparently, simply adding PATTERN to the key set doesn't work:<br>
><br>
> Included at src/binding/f90/mpi_constants.f90:6:<br>
><br>
> PARAMETER (MPI_PATTERN=@MPI_PATTERN@)<br>
> 1<br>
> Error: Expected expression at (1) in PARAMETER statement<br>
><br>
> Also, could someone please explain what does this notion - @MPI_COMPLEX@ - in <a href="http://mpi.h.in" target="_blank">mpi.h.in</a> mean<br>
><br>
> /* Fortran types */<br>
> #define MPI_COMPLEX ((MPI_Datatype)@MPI_COMPLEX@)<br>
><br>
><br>
> regards,<br>
> Tatiana<br>
><br>
><br>
> 2013/3/28 Dave Goodell <<a href="mailto:goodell@mcs.anl.gov">goodell@mcs.anl.gov</a>><br>
> You almost certainly will also need some modifications in "src/binding/f77/buildiface". Whenever I need to modify this script I have to stare at it for a while before I'm sure where the modifications need to go.<br>
><br>
> I don't think we have any existing types which map to pointers under the hood. So there isn't a good example for you to use here. The "MPI_Fint *" changes in particular do not seem correct to me in general. They *might* work in a pinch on a platform with where INTEGER and (void*) are the same size. They might also work on little endian platforms like x86/x86_64, but it will be purely by luck if they do.<br>
><br>
> You may be better writing your own Fortran bindings by hand in the short term.<br>
><br>
> Bill may have something to add on this subject, since he's the primary maintainer for these scripts.<br>
><br>
> -Dave<br>
><br>
> On Mar 28, 2013, at 3:04 PM CDT, Tatiana V. Martsinkevich <<a href="mailto:tanya.manekineko@gmail.com">tanya.manekineko@gmail.com</a>> wrote:<br>
><br>
> > Thanks for reply.<br>
> ><br>
> > Yes, unfortunately we need fortran interfaces because most of the<br>
> > applications that we use for testing are written in fortran.<br>
> > Will it be enough if I just add a conversion rule to %parmc2f in<br>
> > ./src/binding/f90/buildface? Something like:<br>
> ><br>
> > 'MPI_Pattern' => 'INTEGER(KIND=MPI_ADDRESS_KIND)',<br>
> > 'MPI_Pattern*' => 'INTEGER(KIND=MPI_ADDRESS_KIND)',<br>
> ><br>
> > And for f77 it will be:<br>
> ><br>
> > 'MPI_Pattern' => 'MPI_Fint *'<br>
> > 'MPI_Pattern*' => 'MPI_Fint *'<br>
> ><br>
> ><br>
> >> Also, as a side note, please use "MPIX_" for nonstandard MPI extensions. It makes nonstandard interfaces very obvious to users and will help prevent potential issues with standardization in the future.<br>
> ><br>
> > Duly noted.<br>
> ><br>
> > Tatiana<br>
> ><br>
> > 2013/3/28 Dave Goodell <<a href="mailto:goodell@mcs.anl.gov">goodell@mcs.anl.gov</a>>:<br>
> >> On Mar 28, 2013, at 2:16 PM CDT, Tatiana V. Martsinkevich <<a href="mailto:tanya.manekineko@gmail.com">tanya.manekineko@gmail.com</a>> wrote:<br>
> >><br>
> >>> We are implementing some fault tolerance related functionality in<br>
> >>> MPICH-3.0.2. We define a new MPI type in<br>
> >>> ~/mpich-3.0.2/src/include/<a href="http://mpi.h.in" target="_blank">mpi.h.in</a> as:<br>
> >>><br>
> >>> typedef void* MPI_Pattern;<br>
> >>><br>
> >>> then in the same file we define:<br>
> >>><br>
> >>> int MPI_Pattern_declare(char* name, MPI_Pattern* handler);<br>
> >>><br>
> >>> However, when I run autogen.sh and fortran binding script executes it<br>
> >>> gives out:<br>
> >>><br>
> >>> Pattern_declare: No parm type for MPI_Pattern* (MPI_Pattern*)<br>
> >>> Use of uninitialized value $fparm in pattern match (m//) at<br>
> >>> ./buildiface line 1289, <FD> line 1710.<br>
> >><br>
> >> Do you want Fortran interfaces at this time or would you be just as happy to have C-only bindings right now? The former will require hacking on one or more of the "buildiface" scripts in the "src/binding/LANGUAGE" directories. The latter can be accomplished by moving your prototypes and types near the end of <a href="http://mpi.h.in" target="_blank">mpi.h.in</a>, near the prototypes for "MPIX_Mutex_unlock" and "PMPIX_Mutex_unlock".<br>
> >><br>
> >> Also, as a side note, please use "MPIX_" for nonstandard MPI extensions. It makes nonstandard interfaces very obvious to users and will help prevent potential issues with standardization in the future.<br>
> >><br>
> >> -Dave<br>
> >><br>
><br>
><br>
<br>
</div></div></blockquote></div><br>