diff --git a/src/generator.py b/src/generator.py index c02e7f8..fb16a4e 100644 --- a/src/generator.py +++ b/src/generator.py @@ -151,12 +151,14 @@ for fname in files_funcs_groups: templine2 = templine1.replace('$group$', grname) if params['dtype'] == 'double': - std_dtype = 'lf' + std_dtype_out = '24.16e' + std_dtype_in = 'lf' elif params['dtype'] == 'int64_t': - std_dtype = 'ld' + std_dtype_out = 'ld' + std_dtype_in = 'ld' - templine1 = templine2.replace('$group_dset_std_dtype$', std_dtype) - templine2 = templine1 + templine1 = templine2.replace('$group_dset_std_dtype_out$', std_dtype_out) + templine2 = templine1.replace('$group_dset_std_dtype_in$', std_dtype_in) f_out.write(templine2) elif do_num: diff --git a/src/templates_text/templator_text.org b/src/templates_text/templator_text.org index 963f823..103a330 100644 --- a/src/templates_text/templator_text.org +++ b/src/templates_text/templator_text.org @@ -385,7 +385,7 @@ $group$_t* trexio_text_read_$group$(trexio_text_t* const file) { } for (uint64_t i=0 ; i$group_dset$[i])); + rc = fscanf(f, "%$group_dset_std_dtype_in$", &($group$->$group_dset$[i])); assert(!(rc != 1)); if (rc != 1) { FREE(buffer); @@ -467,7 +467,7 @@ trexio_exit_code trexio_text_flush_$group$(trexio_text_t* const file) { fprintf(f, "$group_dset$\n"); for (uint64_t i=0 ; i$group_dset$[i]); + fprintf(f, "%$group_dset_std_dtype_out$\n", $group$->$group_dset$[i]); } // END REPEAT GROUP_DSET