You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's something I ran into while doing the HDF5/libsrc4 conversion. I also have the easy fix.
In libsrc/nc3internal.c we have:
/**************************************************/
int
nc_delete_mp(const char * path, int basepe)
{
NC *nc;
NC3_INFO* nc3;
int status;
int ncid;
size_t chunk = 512;
status = nc_open(path,NC_NOWRITE,&ncid);
if(status) return status;
status = NC_check_id(ncid,&nc);
if(status) return status;
nc3 = NC3_DATA(nc);
nc3->chunk = chunk;
#if defined(LOCKNUMREC) /* && _CRAYMPP */
if (status = NC_init_pe(nc3, basepe)) {
return status;
}
#else
/*
* !_CRAYMPP, only pe 0 is valid
*/
if(basepe != 0)
return NC_EINVAL;
#endif
(void) nc_close(ncid);
if(unlink(path) == -1) {
return NC_EIO; /* No more specific error code is appropriate */
}
return NC_NOERR;
}
Note that we are applying NC3_DATA macro, and then modifying the "chunk" field within it.
Problem is, this is not a dispatch function. ;-) So it is also called by nc_test when testing netCDF-4 files. The setting of nc3->chunk changes some random part of the netcdf-4 structure, which happens to have no effect (or didn't, until I did the HDF5/libsrc4 conversion, and encountered this error).
The fix is simple - there is no reason to be messing with nc3->chunk, as the file is about to be deleted. I simply removed the two lines of code.
nc3 = NC3_DATA(nc);
nc3->chunk = chunk;
The fix for this will be part of my PR for #856. I wanted to high-light this change since it is in the classic code, outside the libsrc4 directory where all the rest of the #856 changes will be found.
The text was updated successfully, but these errors were encountered:
Here's something I ran into while doing the HDF5/libsrc4 conversion. I also have the easy fix.
In libsrc/nc3internal.c we have:
Note that we are applying NC3_DATA macro, and then modifying the "chunk" field within it.
Problem is, this is not a dispatch function. ;-) So it is also called by nc_test when testing netCDF-4 files. The setting of nc3->chunk changes some random part of the netcdf-4 structure, which happens to have no effect (or didn't, until I did the HDF5/libsrc4 conversion, and encountered this error).
The fix is simple - there is no reason to be messing with nc3->chunk, as the file is about to be deleted. I simply removed the two lines of code.
The fix for this will be part of my PR for #856. I wanted to high-light this change since it is in the classic code, outside the libsrc4 directory where all the rest of the #856 changes will be found.
The text was updated successfully, but these errors were encountered: