From 1b02b49f51b772f9452e48d3d0e5d674904c77a1 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 11 Oct 2022 17:46:30 +0200 Subject: [PATCH] Sparse AO contraction coefficients --- org/qmckl_ao.org | 143 +++++++++++++++++------------------------------ 1 file changed, 52 insertions(+), 91 deletions(-) diff --git a/org/qmckl_ao.org b/org/qmckl_ao.org index f9c716f..8be2a86 100644 --- a/org/qmckl_ao.org +++ b/org/qmckl_ao.org @@ -5718,12 +5718,20 @@ qmckl_compute_ao_value_hpc_gaussian (const qmckl_context context, double exp_mat[prim_max] __attribute__((aligned(64))); double ce_mat[shell_max] __attribute__((aligned(64))); - double coef_mat[nucl_num][shell_max][prim_max]; + int coef_mat_sparse_idx[nucl_num][shell_max][prim_max+1]; + double coef_mat_sparse [nucl_num][shell_max][prim_max+1]; for (int i=0 ; i= nidx) break; + ce_mat[i] += v[l] * exp_mat[k]; } } @@ -6264,6 +6276,7 @@ printf(" ao_value ao_value[26][223] %25.15e\n", ao_value[26][223]); printf(" ao_value ao_value[26][224] %25.15e\n", ao_value[26][224]); printf("\n"); +printf("%e %e\n", ao_value[26][219], 1.020298798341620e-08); assert( fabs(ao_value[26][219] - ( 1.020298798341620e-08)) < 1.e-14 ); assert( fabs(ao_value[26][220] - ( 1.516643537739178e-08)) < 1.e-14 ); assert( fabs(ao_value[26][221] - ( -4.686370882518819e-09)) < 1.e-14 ); @@ -6482,7 +6495,7 @@ qmckl_compute_ao_vgl_hpc_gaussian ( const qmckl_tensor coef_per_nucleus, double* restrict const ao_vgl ) { - <> + <> #ifdef HAVE_OPENMP #pragma omp parallel @@ -6495,26 +6508,34 @@ qmckl_compute_ao_vgl_hpc_gaussian ( double exp_mat[prim_max][8] __attribute__((aligned(64))) ; double ce_mat[shell_max][8] __attribute__((aligned(64))) ; - double coef_mat[nucl_num][shell_max][prim_max] __attribute__((aligned(64))); + double coef_mat_sparse[nucl_num][shell_max][prim_max+1]; + int coef_mat_sparse_idx[nucl_num][shell_max][prim_max+1]; for (int i=0 ; i= nidx) break; #ifdef HAVE_OPENMP #pragma omp simd #endif for (int j=0 ; j<8 ; ++j) { - ce_mat[i][j] = 0.; + ce_mat[i][j] += v[l] * exp_mat[k][j]; } - for (int k=0 ; k