now prevent attempt to change to independent access when deflate, shuffle, or fletcher32 filters are in use

This commit is contained in:
Edward Hartnett 2019-12-20 07:16:26 -07:00
parent 8681b0d241
commit 8f8dfac9f6

View File

@ -422,6 +422,13 @@ NC4_var_par_access(int ncid, int varid, int par_access)
if (!var) return NC_ENOTVAR;
assert(var->hdr.id == varid);
/* If zlib, shuffle, or fletcher32 filters are in use, then access
* must be collective. Fail an attempt to set such a variable to
* independent access. */
if ((var->deflate || var->shuffle || var->fletcher32) &&
par_access == NC_INDEPENDENT)
return NC_EINVAL;
if (par_access)
var->parallel_access = NC_COLLECTIVE;
else