diff --git a/org/qmckl_mo.org b/org/qmckl_mo.org index f374e57..baeaef3 100644 --- a/org/qmckl_mo.org +++ b/org/qmckl_mo.org @@ -621,7 +621,6 @@ qmckl_exit_code qmckl_provide_mo_vgl(qmckl_context context) - #+begin_src f90 :comments org :tangle (eval f) :noweb yes integer function qmckl_compute_mo_basis_mo_vgl_doc_f(context, & ao_num, mo_num, point_num, & @@ -761,7 +760,72 @@ qmckl_compute_mo_basis_mo_vgl_hpc (const qmckl_context context, const double* restrict ao_vgl, double* restrict const mo_vgl ) { - return qmckl_compute_mo_basis_mo_vgl_doc (context, ao_num, mo_num, point_num, coef_normalized_t, ao_vgl, mo_vgl); +#ifdef HAVE_OPENMP + #pragma omp parallel for +#endif + for (int64_t ipoint=0 ; ipoint < point_num ; ++ipoint) { + double* restrict const vgl1 = &(mo_vgl[ipoint*5*mo_num]); + const double* restrict avgl1 = &(ao_vgl[ipoint*5*ao_num]); + double* restrict const vgl2 = vgl1 + mo_num; + double* restrict const vgl3 = vgl1 + (mo_num << 1); + double* restrict const vgl4 = vgl1 + (mo_num << 1) + mo_num; + double* restrict const vgl5 = vgl1 + (mo_num << 2); + const double* restrict avgl2 = avgl1 + ao_num; + const double* restrict avgl3 = avgl1 + (ao_num << 1); + const double* restrict avgl4 = avgl1 + (ao_num << 1) + ao_num; + const double* restrict avgl5 = avgl1 + (ao_num << 2); + + for (int64_t i=0 ; i