From 17ea14f6483d263a5dbb414fdd3850b5bc22a2b2 Mon Sep 17 00:00:00 2001 From: q-posev Date: Fri, 15 Apr 2022 11:42:27 +0200 Subject: [PATCH] Test I/O of coefficients for two states --- tests/io_determinant_hdf5.c | 87 ++++++++++++++++++++++++++++++++++++- tests/io_determinant_text.c | 39 +++++++++++++++++ 2 files changed, 124 insertions(+), 2 deletions(-) diff --git a/tests/io_determinant_hdf5.c b/tests/io_determinant_hdf5.c index e6ced6e..0879106 100644 --- a/tests/io_determinant_hdf5.c +++ b/tests/io_determinant_hdf5.c @@ -26,10 +26,12 @@ static int test_write_determinant (const char* file_name, const back_end_t backe // parameters to be written int64_t* det_list; + double* det_coef; int mo_num = 150; det_list = (int64_t*) calloc(2*3*SIZE, sizeof(int64_t)); + det_coef = (double*) calloc(SIZE, sizeof(double)); for(int i=0; i size_max) offset_file_read = 97L; offset_data_read = 1; @@ -143,12 +208,13 @@ static int test_read_determinant (const char* file_name, const back_end_t backen if (offset != 0L) offset_file_read += offset; + chunk_read = read_size_check; // read one chunk that will reach EOF and return TREXIO_END code rc = trexio_read_determinant_list(file, offset_file_read, &chunk_read, &det_list_read[6*offset_data_read]); /* printf("%s\n", trexio_string_of_error(rc)); for (int i=0; i size_max) offset_file_read = 97L; offset_data_read = 1; @@ -215,6 +253,7 @@ static int test_read_determinant (const char* file_name, const back_end_t backen // free the memory free(det_list_read); free(det_coef_read); + free(det_coef_s2_read); /*================= END OF TEST ==================*/