ComputationalRadiationPhysics / libSplash

libSplash - Simple Parallel file output Library for Accumulating Simulation data using Hdf5
GNU Lesser General Public License v3.0
15 stars 15 forks source link

SDC_ATTR_COMPRESSION: New Bool Type #184

Closed ax3l closed 9 years ago

ax3l commented 9 years ago

Follow-up to #153 #198 to use the current format version change: use the new, h5py compatible, types for bools with SDC_ATTR_COMPRESSION instead of H5T_NATIVE_HBOOL that are used right now.

ax3l commented 9 years ago

current type from src/H5public.h:

/*
 * Boolean type.  Successful return values are zero (false) or positive
 * (true). The typical true value is 1 but don't bet on it.  Boolean
 * functions cannot fail.  Functions that return `htri_t' however return zero
 * (false), positive (true), or negative (failure). The proper way to test
 * for truth from a htri_t function is:
 *
 *  if ((retval = H5Tcommitted(type))>0) {
 *      printf("data type is committed\n");
 *  } else if (!retval) {
 *      printf("data type is not committed\n");
 *  } else {
 *      printf("error determining whether data type is committed\n");
 *  }
 */
typedef unsigned int hbool_t;
typedef int htri_t;

Btw tested via h5py "The typical true value is 1 but don't bet on it." -> it's not while reading our var. it's just not 0.

ax3l commented 9 years ago

even if the full representation changes, since this value is only for pure information purposes (data set reads are handled compressed/uncompressed by hdf5 internally) we can go with a minor version update when we change it (a major update is coming for 1.3.0 anyways and this is ok for the adventurous people using dev and the purely informative attribute /header/compression)

ax3l commented 9 years ago

Closed with #199