NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Cedric Roux wrote:
This is speculation of course, and it will be hard for me to reproduce the error, so if on
Well not that hard after all. On the test machine I have, stat() says the disk's blocksize is 4096. Using 'strace' I see the writes done by netcdf go by blocks of size 8192. (This might be important to reproduce the problem.) Doing an 'ulimit -f 13' and running my program gives the error. -f takes the number of blocks the program is allowed to write. Here comes the error's message, just in case someone digs the web for it... -----posixio.c:251: px_pgin: Assertion `*posp == ((off_t)(-1)) || *posp == lseek(nciop->fd, 0, 1)' failed.
----- You might be able to reproduce the problem. Just check your disk's blocksize and use strace to get the size of the writes done by netcdf (for if they match maybe the problem won't pop up). Best regards, Cédric. PS: the program below (not my usual coding style) exhibits the problem. I do an 'ulimit -f 2' and runs the program which then shows:a.out: posixio.c:207: px_pgout: Assertion `*posp == ((off_t)(-1)) || *posp == lseek(nciop->fd, 0, 1)' failed.
(so this time it's in px_pgout, not px_pgin) ----- #include <netcdf.h> int main(void) { int ncid; int dimid; int id; double d[256]; nc_create("test.nc", 0, &ncid); nc_def_dim(ncid, "d", 256, &dimid); nc_def_var(ncid, "v", NC_DOUBLE, 1, &dimid, &id); nc_enddef(ncid); nc_put_var_double(ncid, id, d); nc_close(ncid); return 0; } -----
netcdfgroup
archives: