[svn-r19982] I changed the previous commit from DOUBLE to FLOAT because the bug (2131) happens to FLOAT only. I updated the

data files, too.

Tested on linew and jam.
This commit is contained in:
Raymond Lu 2011-01-24 14:17:14 -05:00
parent 831427aeb8
commit 720ce5fb9b
5 changed files with 15 additions and 15 deletions

Binary file not shown.

View File

@ -32,7 +32,7 @@ const char *FILENAME[] = {
};
#define DATASETNAME "Array"
#define DATASETNAME2 "Scale_offset_double_data"
#define DATASETNAME2 "Scale_offset_float_data"
#define DATASETNAME3 "Scale_offset_int_data"
#define NX 6
#define NY 6
@ -59,8 +59,8 @@ static int read_data(char *fname)
hid_t file, dataset; /* handles */
hid_t datatype;
hid_t dt;
double data_in[NX][NY]; /* input buffer */
double data_out[NX][NY]; /* output buffer */
float data_in[NX][NY]; /* input buffer */
float data_out[NX][NY]; /* output buffer */
int int_data_in[NX][NY]; /* input buffer */
int int_data_out[NX][NY]; /* output buffer */
int i, j;
@ -145,7 +145,7 @@ static int read_data(char *fname)
PASSED();
TESTING(" dataset of DOUBLE with scale-offset filter");
TESTING(" dataset of FLOAT with scale-offset filter");
#ifdef TMP
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/*
@ -159,7 +159,7 @@ static int read_data(char *fname)
*/
for (j = 0; j < NX; j++) {
for (i = 0; i < NY; i++) {
data_in[j][i] = ((double)(i + j + 1))/3;
data_in[j][i] = ((float)(i + j + 1))/3;
data_out[j][i] = 0;
}
}

View File

@ -28,7 +28,7 @@
#define H5FILE_NAME "data.h5"
#define DATASETNAME "Array"
#define DATASETNAME2 "Scale_offset_double_data"
#define DATASETNAME2 "Scale_offset_float_data"
#define DATASETNAME3 "Scale_offset_int_data"
#define NX 6
#define NY 6
@ -37,14 +37,14 @@
#define CHUNK1 3
int create_normal_dset(hid_t fid, hid_t sid);
int create_scale_offset_dset_double(hid_t fid, hid_t sid);
int create_scale_offset_dset_float(hid_t fid, hid_t sid);
int create_scale_offset_dset_int(hid_t fid, hid_t sid);
/*-------------------------------------------------------------------------
* Function: create_normal_dset
*
* Purpose: Create a regular dataset of DOUBLE datatype.
* Purpose: Create a regular dataset of FLOAT datatype.
*
* Return: Success: 0
* Failure: -1
@ -84,7 +84,7 @@ create_normal_dset(hid_t fid, hid_t sid)
* Create a new dataset within the file using defined dataspace and
* datatype and default dataset creation properties.
*/
dataset = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_DOUBLE, sid,
dataset = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_FLOAT, sid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
@ -103,9 +103,9 @@ create_normal_dset(hid_t fid, hid_t sid)
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dset_double
* Function: create_scale_offset_dset_float
*
* Purpose: Create a dataset of DOUBLE datatype with scale-offset filter
* Purpose: Create a dataset of FLOAT datatype with scale-offset filter
*
* Return: Success: 0
* Failure: -1
@ -118,7 +118,7 @@ create_normal_dset(hid_t fid, hid_t sid)
*-------------------------------------------------------------------------
*/
int
create_scale_offset_dset_double(hid_t fid, hid_t sid)
create_scale_offset_dset_float(hid_t fid, hid_t sid)
{
#ifdef H5_HAVE_FILTER_SCALEOFFSET
hid_t dataset; /* dataset handles */
@ -148,7 +148,7 @@ create_scale_offset_dset_double(hid_t fid, hid_t sid)
* Create a new dataset within the file using defined dataspace and
* datatype and default dataset creation properties.
*/
dataset = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_DOUBLE, sid,
dataset = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_FLOAT, sid,
H5P_DEFAULT, dcpl, H5P_DEFAULT);
/*
@ -290,8 +290,8 @@ main (void)
/* Create a regular dataset */
create_normal_dset(file, dataspace);
/* Create a dataset of DOUBLE with scale-offset filter */
create_scale_offset_dset_double(file, dataspace);
/* Create a dataset of FLOAT with scale-offset filter */
create_scale_offset_dset_float(file, dataspace);
/* Create a dataset of INT with scale-offset filter */
create_scale_offset_dset_int(file, dataspace);

Binary file not shown.

Binary file not shown.