mixed use of size_t and MPI_Offset
Jonghyun Lee
jlee at mcs.anl.gov
Fri Apr 29 14:00:07 CDT 2005
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.
Thanks,
Jonghyun Lee
More information about the parallel-netcdf
mailing list