Again I solve this problem through alternatively typing the variable:<br><br>#ifdef PNETCDF<br> use parallel_mod, only : nfsizekind=>mpi_offset_kind<br>#else<br> use kinds, only : nfsizekind=>int_kind<br>#endif<br>
<br> integer(kind=nfsizekind),parameter :: unlim_dim=nf_unlimited<br><br><br><div><span class="gmail_quote">On 10/25/06, <b class="gmail_sendername">John Michalakes</b> <<a href="mailto:john@michalakes.us">john@michalakes.us
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">That would be helpful. But I think putting 32 in the name would be<br>
misleading, since this is only an issue on 64 bit compiles. (On 32 bit<br>compiles, MPI_Offset is the same length as a Fortran INTEGER).<br><br>John<br><br>> -----Original Message-----<br>> From: William Gropp [mailto:
<a href="mailto:gropp@mcs.anl.gov">gropp@mcs.anl.gov</a>]<br>> Sent: Wednesday, October 25, 2006 9:51 AM<br>> To: <a href="mailto:john@michalakes.us">john@michalakes.us</a><br>> Cc: <a href="mailto:parallel-netcdf@mcs.anl.gov">
parallel-netcdf@mcs.anl.gov</a><br>> Subject: Re: Issue with "integer" arguments in Fortran API for PNetCDF<br>><br>><br>> As the Fortran interfaces are generated with a script, we could<br>> create an alternate version that was closer to the serial NetCDF
<br>> interface, using a different prefix to avoid confusion (e.g., maybe<br>> nf32mpi_xxx). Would that help? What do others think of that approach?<br>><br>> Bill<br>><br>> On Oct 25, 2006, at 2:06 AM, John Michalakes wrote:
<br>><br>> > PS... There is a problem with the pnetcdf.inc file itself. This file<br>> > defines INTEGER parameters such as NF_UNLIMITED which may be used as<br>> > arguments to NFMPI_* routines that are defined as
<br>> > INTEGER(KIND=MPI_OFFSET_KIND). An example is the 3rd argument of:<br>> ><br>> > FORTRAN_API int FORT_CALL nfmpi_def_dim_ ( int *v1, char *v2<br>> > FORT_MIXED_LEN(d2), MPI_Offset *v3, MPI_Fint *v4 FORT_END_LEN(d2) )
<br>> ><br>> > Since MPI_Offset can be 64-bits if compiled with OBJECT_MODE 64 on<br>> > the IBM,<br>> > passing NF_UNLIMITED (32-bits) as the third argument is incorrect.<br>> ><br>> > John
<br>> ><br>> >> -----Original Message-----<br>> >> From: <a href="mailto:owner-parallel-netcdf@mcs.anl.gov">owner-parallel-netcdf@mcs.anl.gov</a><br>> >> [mailto:<a href="mailto:owner-parallel-netcdf@mcs.anl.gov">
owner-parallel-netcdf@mcs.anl.gov</a>]On Behalf Of John<br>> >> Michalakes<br>> >> Sent: Tuesday, October 24, 2006 3:30 PM<br>> >> To: <a href="mailto:parallel-netcdf@mcs.anl.gov">parallel-netcdf@mcs.anl.gov
</a><br>> >> Subject: Issue with "integer" arguments in Fortran API for PNetCDF<br>> >><br>> >><br>> >> I'm having a problem adapting parallel NetCDF as an option in the WRF<br>
> >> (Weather Research and Forecast) model I/O API. WRF currently supports<br>> >> non-parallel NetCDF, and we're now trying to extend the model to<br>> >> use the new<br>> >> parallel NetCDF code. Have run into a problem with some of the
<br>> >> arguments in<br>> >> the API for parallel-NetCDF:<br>> >><br>> >> The original NetCDF Fortran API defines lengths, starts, and<br>> >> other arguments<br>> >> as INTEGER. PnetCDF recasts some (but not all) of these arguments as
<br>> >> MPI_Offset. We compile WRF with OBJECT_MODE 64 on the IBMs where<br>> >> KIND=MPI_OFFSET_KIND works out to 8 bytes. Thus, the calls in WRF<br>> >> that pass<br>> >> these arguments as 32-bit INTEGERs from Fortran are causing
<br>> >> PNetCDF to see<br>> >> garbage in the high four bytes of the dummy argument. For example,<br>> >> the<br>> >> length argument to NFMPI_DEF_DIM ends up being 73 + a very-large-<br>
> >> garbage<br>> >> value instead of 73.<br>> >><br>> >> I was hoping for a relatively quick drop-in of PnetCDF into WRF<br>> >> I/O API but<br>> >> this now seems unlikely. There is a large amount of NetCDF
<br>> >> interface code in<br>> >> WRF that will need to be gone through. Or I can write a wrapper<br>> >> lib for all<br>> >> these routines.<br>> >><br>> >> Has anyone done this already? What's needed is for the wrapper
<br>> >> routine to<br>> >> accept INTEGER arguments and copy them to INTEGER<br>> >> (KIND=MPI_OFFSET_KIND) to<br>> >> be used as arguments to the actual NFMPI_* routines in PNetCDF and
<br>> >> (in the<br>> >> case of return values) copy them back to INTEGER again.<br>> >><br>> >> Not arguing, but curious: since PNetCDF is supposed to be a parallel<br>> >> implementation of the NetCDF API, why was the API altered this way
<br>> >> to use<br>> >> arguments of type MPI_Offset instead of INTEGER? At least for what<br>> >> I'm<br>> >> trying to do, it is a significant impediment.<br>> >><br>> >> I really appreciate that parallel NetCDF is being developed. It
<br>> >> is very much<br>> >> needed, especially now as we try moving to Petascale. Kudos to the<br>> >> developers.<br>> >><br>> >> John<br>> >><br>> >> -----------------------------------------------------------
<br>> >> John Michalakes, Software Engineer <a href="mailto:michalak@ucar.edu">michalak@ucar.edu</a><br>> >> NCAR, MMM Division voice: +1 303 497 8199<br>> >> 3450 Mitchell Lane fax: +1 303 497 8181
<br>> >> Boulder, Colorado 80301 U.S.A. cell: +1 720 209 2320<br>> >> <a href="http://www.mmm.ucar.edu/individual/michalakes">http://www.mmm.ucar.edu/individual/michalakes</a><br>> >> -----------------------------------------------------------
<br>> >><br>> ><br>><br><br></blockquote></div><br>