Commit d4a0213a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Port the i/o modifications to the serial and parallel reads as well.

parent 4085f742
...@@ -95,11 +95,11 @@ void readArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N, ...@@ -95,11 +95,11 @@ void readArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N,
/* Check data type */ /* Check data type */
h_type = H5Dget_type(h_data); h_type = H5Dget_type(h_data);
if (h_type < 0) error("Unable to retrieve data type from the file"); if (h_type < 0) error("Unable to retrieve data type from the file");
if (!H5Tequal(h_type, hdf5Type(type))) /* if (!H5Tequal(h_type, hdf5Type(type))) */
error("Non-matching types between the code and the file"); /* error("Non-matching types between the code and the file"); */
/* Allocate temporary buffer */ /* Allocate temporary buffer */
temp = malloc(N * dim * sizeOfType(type)); temp = malloc(N * dim * typeSize);
if (temp == NULL) error("Unable to allocate memory for temporary buffer"); if (temp == NULL) error("Unable to allocate memory for temporary buffer");
/* Prepare information for hyperslab */ /* Prepare information for hyperslab */
...@@ -131,7 +131,7 @@ void readArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N, ...@@ -131,7 +131,7 @@ void readArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N,
/* Read HDF5 dataspace in temporary buffer */ /* Read HDF5 dataspace in temporary buffer */
/* Dirty version that happens to work for vectors but should be improved */ /* Dirty version that happens to work for vectors but should be improved */
/* Using HDF5 dataspaces would be better */ /* Using HDF5 dataspaces would be better */
h_err = H5Dread(h_data, h_type, h_memspace, h_filespace, h_plist_id, temp); h_err = H5Dread(h_data, hdf5Type(type), h_memspace, h_filespace, h_plist_id, temp);
if (h_err < 0) { if (h_err < 0) {
error("Error while reading data array '%s'.", name); error("Error while reading data array '%s'.", name);
} }
......
...@@ -102,11 +102,11 @@ void readArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N, ...@@ -102,11 +102,11 @@ void readArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N,
/* Check data type */ /* Check data type */
h_type = H5Dget_type(h_data); h_type = H5Dget_type(h_data);
if (h_type < 0) error("Unable to retrieve data type from the file"); if (h_type < 0) error("Unable to retrieve data type from the file");
if (!H5Tequal(h_type, hdf5Type(type))) /* if (!H5Tequal(h_type, hdf5Type(type))) */
error("Non-matching types between the code and the file"); /* error("Non-matching types between the code and the file"); */
/* Allocate temporary buffer */ /* Allocate temporary buffer */
temp = malloc(N * dim * sizeOfType(type)); temp = malloc(N * dim * typeSize);
if (temp == NULL) error("Unable to allocate memory for temporary buffer"); if (temp == NULL) error("Unable to allocate memory for temporary buffer");
/* Prepare information for hyperslab */ /* Prepare information for hyperslab */
...@@ -134,7 +134,7 @@ void readArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N, ...@@ -134,7 +134,7 @@ void readArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N,
/* Read HDF5 dataspace in temporary buffer */ /* Read HDF5 dataspace in temporary buffer */
/* Dirty version that happens to work for vectors but should be improved */ /* Dirty version that happens to work for vectors but should be improved */
/* Using HDF5 dataspaces would be better */ /* Using HDF5 dataspaces would be better */
h_err = H5Dread(h_data, h_type, h_memspace, h_filespace, H5P_DEFAULT, temp); h_err = H5Dread(h_data, hdf5Type(type), h_memspace, h_filespace, H5P_DEFAULT, temp);
if (h_err < 0) { if (h_err < 0) {
error("Error while reading data array '%s'.", name); error("Error while reading data array '%s'.", name);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment