mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-03-04 06:10:23 +01:00
Merge branch 'master' into rust
This commit is contained in:
commit
8156a738fb
@ -169,7 +169,7 @@ static int test_read_determinant (const char* file_name, const back_end_t backen
|
||||
int64_t* det_list_read;
|
||||
double* det_coef_read;
|
||||
double check_diff;
|
||||
uint64_t size_r = 40L;
|
||||
uint64_t size_r = SIZE;
|
||||
|
||||
det_list_read = (int64_t*) calloc(2*int_num*size_r,sizeof(int64_t));
|
||||
det_coef_read = (double*) calloc(size_r,sizeof(double));
|
||||
@ -259,7 +259,26 @@ static int test_read_determinant (const char* file_name, const back_end_t backen
|
||||
int32_t* orb_list_dn = (int32_t*) calloc(size_list, sizeof(int32_t));
|
||||
int32_t occ_num_up, occ_num_dn;
|
||||
|
||||
rc = trexio_read_determinant_list(file, 0L, &chunk_read, &det_list_read[0L]);
|
||||
// rc = trexio_read_determinant_list(file, 0L, &chunk_read, &det_list_read[0L]);
|
||||
// read n_chunks times using read_sparse
|
||||
uint64_t chunk_size = (uint64_t) (SIZE-1)/N_CHUNKS+1;
|
||||
uint64_t offset_f = 0UL;
|
||||
uint64_t offset_d = 0UL;
|
||||
for(int i=0; i<N_CHUNKS; ++i){
|
||||
if (i*chunk_size + chunk_size > SIZE) {
|
||||
chunk_size = SIZE % chunk_size;
|
||||
}
|
||||
printf("chunk_size: %ld | %ld\n", chunk_size, offset_f+chunk_size);
|
||||
rc = trexio_read_determinant_list(file, offset_f, &chunk_size, &det_list_read[2*int_num*offset_d]);
|
||||
assert(rc == TREXIO_SUCCESS);
|
||||
|
||||
rc = trexio_read_determinant_coefficient(file, offset_f, &chunk_size, &det_coef_read[offset_d]);
|
||||
assert(rc == TREXIO_SUCCESS);
|
||||
|
||||
offset_d += chunk_size;
|
||||
offset_f += chunk_size;
|
||||
}
|
||||
|
||||
assert (rc == TREXIO_SUCCESS);
|
||||
|
||||
rc = trexio_to_orbital_list_up_dn (int_num, &det_list_read[0], orb_list_up, orb_list_dn, &occ_num_up, &occ_num_dn);
|
||||
|
Loading…
x
Reference in New Issue
Block a user