mixed use of size_t and MPI_Offset
Jianwei Li
jianwei at ece.northwestern.edu
Sat Apr 30 15:20:57 CDT 2005
Hi, Jonghyun,
"ncmpii_put_att()" is deprecated and not called, so
that should not be the problem.
All length parameters in the interface were changed
from int/size_t to MPI_Offset to enable 64-bit size
support in the future, as well as to avoid some
problems we had with size_t on certain platforms...
Are you using the ncmpi FLASH I/O benchmark written
by Brad (http://flash.uchicago.edu/~jbgallag/io_bench/)?
It worked fine for me with all the length parameters
updated to MPI_Offset. And for single-valued length
parameters including constant "1" in the ncmpi_put_att_*
functions, they worked fine for me without any typecast
from "int" to "MPI_Offset", as expected.
Are you using correct pointer types for all the array
parameters where MPI_Offset is expected?
Maybe that's the problem...
Jianwei
On Sat, 30 Apr 2005, Robert Latham wrote:
>> On Fri, Apr 29, 2005 at 02:00:07PM -0500, Jonghyun Lee wrote:
>> Hello.
>>
>> I have downloaded PnetCDF 1.0 prerelease, and tried to use it with Flash
>> I/O benchmark. However, I have encountered numerous problems, and one
>> of the reasons seems to be that the PnetCDF code mixes "size_t" and
>> "MPI_Offset" in its API when passing number of elements (e.g.,
>> size_t for nelems in ncmpii_put_att, MPI_Offset for nelems in
>> ncmpi_put_att_int)
>>
>> The Flash I/O benchmark code passes int variables or constants to these
>> functions, and this causes problems. For example, the benchmark calls
>>
>> ncmpi_put_att_int(ncid, NC_GLOBAL, "total_blocks", NC_INT, 1,
>> total_blocks);
>>
>> In ncmpi_put_att_int, the fifth parameter (nelems) is declared as
>> MPI_Offset. When it is actually called, nelems is passed 8 byte worth
>> of data, and the next variable is passed NULL. This could be avoided
>> when I passed (MPI_Offset)1, instead of 1 for the fifth parameter.
>>
>> Any specific reason for this mixed use? I didn't have this problem with
>> the previous version, and I think this is causing confusions. I don't know
>> if this has already been discussed.
>
> Hi Jonghyun
> We already talked about this in person, but for the sake of the
> mailing list archives...
>
> we changed our api in 0.9.4 so that all ncmpi_ routines take
> MPI_Offset instead of size_t. Codes ported to parallel-netcdf prior
> to 0.9.4 (such as the flash io benchmark) will have to be updated.
> The good news is that's our last api change (we've made additional api
> extensions).
>
> Did you find places where parallel-netcdf was still using size_t? It
> sounds to me like only flash IO was using size_t, but just wanted to
> make sure.
>
> ==rob
>
> --
> Rob Latham
> Mathematics and Computer Science Division A215 0178 EA2D B059 8CDF
> Argonne National Labs, IL USA B29D F333 664A 4280 315B
>
More information about the parallel-netcdf
mailing list