Merge branch 'patch-1' of https://github.com/gsjaardema/netcdf-c into par-hang-fix

This commit is contained in:
Ward Fisher 2017-10-16 11:01:24 -06:00
commit 98c169aa9a

View File

@ -241,12 +241,19 @@ NCDEFAULT_put_vars(int ncid, int varid, const size_t * start,
if(mystride[i] != 1) isstride1 = 0;
nels *= myedges[i];
}
if(nels == 0)
return NC_NOERR; /* cannot write anything */
if(isstride1) {
return NC_put_vara(ncid, varid, mystart, myedges, value, memtype);
}
if(nels == 0) {
/* This should be here instead of before NC_put_vara call to
* avoid hang in parallel write for single stride.
* Still issue with parallel hang if stride > 1
*/
return NC_NOERR; /* cannot write anything */
}
/* Initial version uses and odometer to walk the variable
and read each value one at a time. This can later be optimized
to read larger chunks at a time.