[svn-r9495] Purpose:

Fix SZIP filter to dynmically detect encoder.

Description:

Solution:
See:
http://hdf.ncsa.uiuc.edu/RFC/SZIP/Szip_dynamic_12_Oct.pdf

Changes to h5dump tests, contingent on detecting SZIP encoder.
This commit is contained in:
Robert E. McGrath 2004-11-02 14:12:18 -05:00
parent 3f0abcc71f
commit 8c0c4f945d
5 changed files with 15 additions and 18 deletions

View File

@ -96,6 +96,7 @@ PUB_DOCS=
PUB_SUBDOCS=
PROGS=
TEST_PROGS=
PRIV_PROGS=
TEST_PROGS_PARA=
TEST_FLAGS=
TEST_SCRIPTS=

View File

@ -94,6 +94,9 @@ H5Z_init_interface (void)
HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter")
#endif /* H5_HAVE_FILTER_FLETCHER32 */
#ifdef H5_HAVE_FILTER_SZIP
H5Z_SZIP->encoder_present = SZ_encoder_enabled();
if (H5Z_SZIP->encoder_present < 0)
HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "szip filter reports bad status")
if (H5Z_register (H5Z_SZIP)<0)
HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter")
#endif /* H5_HAVE_FILTER_SZIP */

View File

@ -43,11 +43,7 @@ static size_t H5Z_filter_szip (unsigned flags, size_t cd_nelmts,
H5Z_class_t H5Z_SZIP[1] = {{
H5Z_CLASS_T_VERS, /* H5Z_class_t version */
H5Z_FILTER_SZIP, /* Filter id number */
#ifdef H5_SZIP_CAN_ENCODE
1, /* Encoder present */
#else
0, /* Encoder disabled */
#endif
1, /* Assume encoder present: check before registering */
1, /* decoder_present flag (set to true) */
"szip", /* Filter name for debugging */
H5Z_can_apply_szip, /* The "can apply" callback */

View File

@ -524,9 +524,6 @@
PTHREAD_SCOPE_SYSTEM) call. */
#undef SYSTEM_SCOPE_THREADS
/* Define if szip encoder is present */
#undef SZIP_CAN_ENCODE
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME

View File

@ -26,10 +26,6 @@
#include "hdf5.h"
#include "H5private.h"
#ifdef H5_HAVE_FILTER_SZIP
#include "szlib.h"
#endif
#define FILE1 "tgroup.h5"
#define FILE2 "tdset.h5"
#define FILE3 "tattr.h5"
@ -4495,10 +4491,10 @@ static void gent_filters(void)
hid_t dcpl; /* dataset creation property list */
hid_t sid; /* dataspace ID */
hid_t tid; /* datatype ID */
#if defined (H5_HAVE_FILTER_SZIP)
#ifdef H5_HAVE_FILTER_SZIP
unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK;
unsigned szip_pixels_per_block=4;
#endif
#endif /* H5_HAVE_FILTER_SZIP */
hsize_t dims1[RANK] = {DIM1,DIM2};
hsize_t chunk_dims[RANK] = {CDIM1,CDIM2};
int buf1[DIM1][DIM2];
@ -4568,7 +4564,8 @@ static void gent_filters(void)
* SZIP
*-------------------------------------------------------------------------
*/
#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
#ifdef H5_HAVE_FILTER_SZIP
if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
/* remove the filters from the dcpl */
ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
assert(ret>=0);
@ -4579,7 +4576,8 @@ static void gent_filters(void)
ret=make_dset(fid,"szip",sid,H5T_NATIVE_INT,dcpl,buf1);
assert(ret>=0);
#endif
}
#endif /* H5_HAVE_FILTER_SZIP */
/*-------------------------------------------------------------------------
* GZIP
@ -4648,12 +4646,14 @@ static void gent_filters(void)
assert(ret>=0);
#endif
#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
#ifdef H5_HAVE_FILTER_SZIP
if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
szip_options_mask=H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK;
/* set szip data */
ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block);
assert(ret>=0);
#endif
}
#endif /* H5_HAVE_FILTER_SZIP */
#if defined (H5_HAVE_FILTER_DEFLATE)
/* set deflate data */