From 70531b0ff63a768a7249cfd9425f8eff25e2baa2 Mon Sep 17 00:00:00 2001 From: q-posev Date: Thu, 27 May 2021 13:59:45 +0200 Subject: [PATCH] more general group_dset_h5_dtype variable in the templates [hdf5] --- src/templates_hdf5/templator_hdf5.org | 6 +++--- tools/generator_tools.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/templates_hdf5/templator_hdf5.org b/src/templates_hdf5/templator_hdf5.org index 1954539..c0e2c05 100644 --- a/src/templates_hdf5/templator_hdf5.org +++ b/src/templates_hdf5/templator_hdf5.org @@ -335,7 +335,7 @@ trexio_hdf5_read_$group_dset$ (trexio_t* const file, $group_dset_dtype$* const $ /* High-level H5LT API. No need to deal with dataspaces and datatypes */ status = H5LTread_dataset(f->$group$_group, $GROUP_DSET$_NAME, - H5T_NATIVE_$GROUP_DSET_H5_DTYPE$, + H5T_$GROUP_DSET_H5_DTYPE$, $group_dset$); if (status < 0) return TREXIO_FAILURE; @@ -365,7 +365,7 @@ trexio_hdf5_write_$group_dset$ (trexio_t* const file, const $group_dset_dtype$* const herr_t status = H5LTmake_dataset(f->$group$_group, $GROUP_DSET$_NAME, (int) rank, (const hsize_t*) dims, - H5T_NATIVE_$GROUP_DSET_H5_DTYPE$, + H5T_$GROUP_DSET_H5_DTYPE$, $group_dset$); if (status < 0) return TREXIO_FAILURE; @@ -375,7 +375,7 @@ trexio_hdf5_write_$group_dset$ (trexio_t* const file, const $group_dset_dtype$* if (dset_id <= 0) return TREXIO_INVALID_ID; const herr_t status = H5Dwrite(dset_id, - H5T_NATIVE_$GROUP_DSET_H5_DTYPE$, + H5T_$GROUP_DSET_H5_DTYPE$, H5S_ALL, H5S_ALL, H5P_DEFAULT, $group_dset$); diff --git a/tools/generator_tools.py b/tools/generator_tools.py index fcc4401..03adfd9 100644 --- a/tools/generator_tools.py +++ b/tools/generator_tools.py @@ -462,7 +462,7 @@ def split_dset_dict_detailed (datasets: dict) -> tuple: # specify details required to replace templated variables later if v[0] == 'float': datatype = 'double' - group_dset_h5_dtype = 'double' + group_dset_h5_dtype = 'native_double' group_dset_f_dtype_default= 'real(8)' group_dset_f_dtype_double = 'real(8)' group_dset_f_dtype_single = 'real(4)' @@ -474,7 +474,7 @@ def split_dset_dict_detailed (datasets: dict) -> tuple: group_dset_std_dtype_in = 'lf' elif v[0] == 'int': datatype = 'int64_t' - group_dset_h5_dtype = 'int64' + group_dset_h5_dtype = 'native_int64' group_dset_f_dtype_default= 'integer(4)' group_dset_f_dtype_double = 'integer(8)' group_dset_f_dtype_single = 'integer(4)'