1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-07-03 18:06:07 +02:00

Renamed function prefixes.

This commit is contained in:
Francois Coppens 2023-02-20 18:51:20 +01:00
parent 5e5c15a09d
commit 8ba882675e

View File

@ -34,9 +34,9 @@ range(2, 3)
* Naïve Sherman-Morrison * Naïve Sherman-Morrison
** ~qmckl_sherman_morrison_naive~ ** ~qmckl_sm_naive~
:PROPERTIES: :PROPERTIES:
:Name: qmckl_sherman_morrison_naive :Name: qmckl_sm_naive
:CRetType: qmckl_exit_code :CRetType: qmckl_exit_code
:FRetType: qmckl_exit_code :FRetType: qmckl_exit_code
:END: :END:
@ -75,7 +75,7 @@ If the determinant of the Slater-matrix is passed, it will be updated to the det
from applying the updates to the original matrix. from applying the updates to the original matrix.
*** API *** API
#+NAME: qmckl_sherman_morrison_naive_args #+NAME: qmckl_sm_naive_args
| Variable | Type | In/Out | Description | | Variable | Type | In/Out | Description |
|-----------------+-------------------------+--------+------------------------------------------------------| |-----------------+-------------------------+--------+------------------------------------------------------|
| ~context~ | ~qmckl_context~ | in | Global state | | ~context~ | ~qmckl_context~ | in | Global state |
@ -150,7 +150,7 @@ end subroutine copy_back
#+end_src #+end_src
#+begin_src f90 :tangle (eval f) #+begin_src f90 :tangle (eval f)
integer function qmckl_sherman_morrison_naive_doc_f(context, & integer function qmckl_sm_naive_doc_f(context, &
lds, dim, & lds, dim, &
nupdates, & nupdates, &
upds, & upds, &
@ -230,20 +230,20 @@ integer function qmckl_sherman_morrison_naive_doc_f(context, &
info = QMCKL_SUCCESS info = QMCKL_SUCCESS
end function qmckl_sherman_morrison_naive_doc_f end function qmckl_sm_naive_doc_f
#+end_src #+end_src
**** C interface to the pedagogical kernel (not directly exposed) **** C interface to the pedagogical kernel (not directly exposed)
The following Fortran function ~qmckl_sherman_morrison_naive_doc~ makes sure The following Fortran function ~qmckl_sm_naive_doc~ makes sure
that the pedagogical kernel ~qmckl_sherman_morrison_naive_doc_f~, written in that the pedagogical kernel ~qmckl_sm_naive_doc_f~, written in
Fortran, can be called from C using the ~ISO_C_BINDING~. The Fortran function ~qmckl_sherman_morrison_naive_doc~ will be exposed in the header file 'qmckl.h' Fortran, can be called from C using the ~ISO_C_BINDING~. The Fortran function ~qmckl_sm_naive_doc~ will be exposed in the header file 'qmckl.h'
for C users and in the module file 'qmckl_f.F90' for Fortran users. for C users and in the module file 'qmckl_f.F90' for Fortran users.
#+CALL: generate_c_interface(table=qmckl_sherman_morrison_naive_args,rettyp=get_value("CRetType"),fname="qmckl_sherman_morrison_naive_doc") #+CALL: generate_c_interface(table=qmckl_sm_naive_args,rettyp=get_value("CRetType"),fname="qmckl_sm_naive_doc")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval f) :comments org :exports none #+begin_src f90 :tangle (eval f) :comments org :exports none
integer(c_int32_t) function qmckl_sherman_morrison_naive_doc & integer(c_int32_t) function qmckl_sm_naive_doc &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) & (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) &
bind(C) result(info) bind(C) result(info)
@ -260,20 +260,20 @@ integer(c_int32_t) function qmckl_sherman_morrison_naive_doc &
real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS) real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS)
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
integer(c_int32_t), external :: qmckl_sherman_morrison_naive_doc_f integer(c_int32_t), external :: qmckl_sm_naive_doc_f
info = qmckl_sherman_morrison_naive_doc_f & info = qmckl_sm_naive_doc_f &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant)
end function qmckl_sherman_morrison_naive_doc end function qmckl_sm_naive_doc
#+end_src #+end_src
*** C headers (exposed in qmckl.h) *** C headers (exposed in qmckl.h)
#+CALL: generate_c_header(table=qmckl_sherman_morrison_naive_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+CALL: generate_c_header(table=qmckl_sm_naive_args,rettyp=get_value("CRetType"),fname=get_value("Name"))
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_func) : comments org #+begin_src c :tangle (eval h_func) : comments org
qmckl_exit_code qmckl_sherman_morrison_naive ( qmckl_exit_code qmckl_sm_naive (
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -285,11 +285,11 @@ qmckl_exit_code qmckl_sherman_morrison_naive (
double* determinant ); double* determinant );
#+end_src #+end_src
#+CALL: generate_c_header(table=qmckl_sherman_morrison_naive_args,rettyp=get_value("CRetType"),fname="qmckl_sherman_morrison_naive_hpc") #+CALL: generate_c_header(table=qmckl_sm_naive_args,rettyp=get_value("CRetType"),fname="qmckl_sm_naive_hpc")
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_private_func) :comments org #+begin_src c :tangle (eval h_private_func) :comments org
qmckl_exit_code qmckl_sherman_morrison_naive_hpc ( qmckl_exit_code qmckl_sm_naive_hpc (
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -301,11 +301,11 @@ qmckl_exit_code qmckl_sherman_morrison_naive_hpc (
double* determinant ); double* determinant );
#+end_src #+end_src
#+CALL: generate_c_header(table=qmckl_sherman_morrison_naive_args,rettyp=get_value("CRetType"),fname="qmckl_sherman_morrison_naive_doc") #+CALL: generate_c_header(table=qmckl_sm_naive_args,rettyp=get_value("CRetType"),fname="qmckl_sm_naive_doc")
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_func) :comments org #+begin_src c :tangle (eval h_func) :comments org
qmckl_exit_code qmckl_sherman_morrison_naive_doc ( qmckl_exit_code qmckl_sm_naive_doc (
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -344,8 +344,8 @@ Common includes and macros used by all the Sherman-Morrison-Woodbury kernels.
#endif #endif
#+end_src #+end_src
~qmckl_sherman_morrison_naive_hpc~ is a high performance variation of ~qmckl_sm_naive_hpc~ is a high performance variation of
~qmckl_sherman_morrison_naive~ written in C. It is used in cases when ~Dim~ is ~qmckl_sm_naive~ written in C. It is used in cases when ~Dim~ is
smaller than the leading dimension ~LDS~, irrespective of whetether ~LDS~ smaller than the leading dimension ~LDS~, irrespective of whetether ~LDS~
includes zero padding to benefit from SIMD instructions or not. Cases like this includes zero padding to benefit from SIMD instructions or not. Cases like this
include situations where one wants to apply updates to a square submatrix of the include situations where one wants to apply updates to a square submatrix of the
@ -354,7 +354,7 @@ It takes advantage of memory aligned data and assumes no data dependencies
inside the loops. The loops are fully vectorised whenever ~Dim~ is an integer inside the loops. The loops are fully vectorised whenever ~Dim~ is an integer
multiple of ~SIMD_LEGTH~. multiple of ~SIMD_LEGTH~.
#+begin_src c :tangle (eval c) :comments org #+begin_src c :tangle (eval c) :comments org
qmckl_exit_code qmckl_sherman_morrison_naive_hpc( qmckl_exit_code qmckl_sm_naive_hpc(
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -368,7 +368,7 @@ qmckl_exit_code qmckl_sherman_morrison_naive_hpc(
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_NULL_CONTEXT, QMCKL_NULL_CONTEXT,
"qmckl_sherman_morrison_naive_hpc", "qmckl_sm_naive_hpc",
NULL); NULL);
} }
@ -423,10 +423,10 @@ qmckl_exit_code qmckl_sherman_morrison_naive_hpc(
} }
#+end_src #+end_src
~qmckl_exit_code qmckl_sherman_morrison_naive_{Dim}~ is a C function-template that is used to genereate instances of C fucntions based on the range given above. The advantage of this method is that for each of these instances all the dimensions and loop-bounds are known at compile time, allowing the compiler to optimize more aggressively. ~qmckl_exit_code qmckl_sm_naive_{Dim}~ is a C function-template that is used to genereate instances of C fucntions based on the range given above. The advantage of this method is that for each of these instances all the dimensions and loop-bounds are known at compile time, allowing the compiler to optimize more aggressively.
#+NAME:naive_template_code #+NAME:naive_template_code
#+begin_src c #+begin_src c
static inline qmckl_exit_code qmckl_sherman_morrison_naive_{Dim}( static inline qmckl_exit_code qmckl_sm_naive_{Dim}(
const qmckl_context context, const qmckl_context context,
const uint64_t N_updates, const uint64_t N_updates,
const double* __restrict Updates, const double* __restrict Updates,
@ -438,7 +438,7 @@ qmckl_exit_code qmckl_sherman_morrison_naive_hpc(
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return qmckl_failwith(context, return qmckl_failwith(context,
QMCKL_NULL_CONTEXT, QMCKL_NULL_CONTEXT,
"qmckl_sherman_morrison_naive_{Dim}", "qmckl_sm_naive_{Dim}",
NULL); NULL);
} }
@ -516,7 +516,7 @@ Python script that generated C switch cases that call individual kernel instance
#+begin_src python :noweb yes #+begin_src python :noweb yes
text=""" text="""
case {Dim}: case {Dim}:
return qmckl_sherman_morrison_naive_{Dim}(context, return qmckl_sm_naive_{Dim}(context,
N_updates, N_updates,
Updates, Updates,
Updates_index, Updates_index,
@ -536,9 +536,9 @@ return '\n'.join(result)
<<naive_kernel_generator()>> <<naive_kernel_generator()>>
#+end_src #+end_src
~qmckl_sherman_morrison_naive~ is a generic function that contains decision making logic that calls the proper kernel based on the used library configuration (~--enable-doc~ and ~--enable-hpc~) and the passed array dimensions ~LDS~ and ~Dim~. ~qmckl_sm_naive~ is a generic function that contains decision making logic that calls the proper kernel based on the used library configuration (~--enable-doc~ and ~--enable-hpc~) and the passed array dimensions ~LDS~ and ~Dim~.
#+begin_src c :tangle (eval c) :comments org :noweb yes #+begin_src c :tangle (eval c) :comments org :noweb yes
qmckl_exit_code qmckl_sherman_morrison_naive(const qmckl_context context, qmckl_exit_code qmckl_sm_naive(const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
const uint64_t N_updates, const uint64_t N_updates,
@ -551,7 +551,7 @@ qmckl_exit_code qmckl_sherman_morrison_naive(const qmckl_context context,
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return qmckl_failwith(context, return qmckl_failwith(context,
QMCKL_NULL_CONTEXT, QMCKL_NULL_CONTEXT,
"qmckl_sherman_morrison_naive", "qmckl_sm_naive",
NULL); NULL);
} }
@ -562,7 +562,7 @@ qmckl_exit_code qmckl_sherman_morrison_naive(const qmckl_context context,
} }
} }
else { // Updating smaller sub-matrix else { // Updating smaller sub-matrix
return qmckl_sherman_morrison_naive_hpc(context, return qmckl_sm_naive_hpc(context,
LDS, LDS,
Dim, Dim,
N_updates, N_updates,
@ -573,7 +573,7 @@ qmckl_exit_code qmckl_sherman_morrison_naive(const qmckl_context context,
determinant); determinant);
} }
#else #else
return qmckl_sherman_morrison_naive_doc(context, return qmckl_sm_naive_doc(context,
LDS, LDS,
Dim, Dim,
N_updates, N_updates,
@ -590,17 +590,17 @@ qmckl_exit_code qmckl_sherman_morrison_naive(const qmckl_context context,
*** Fortran interfaces (exposed in qmckl_f.F90) *** Fortran interfaces (exposed in qmckl_f.F90)
:PROPERTIES: :PROPERTIES:
:Name: qmckl_sherman_morrison_naive :Name: qmckl_sm_naive
:CRetType: qmckl_exit_code :CRetType: qmckl_exit_code
:FRetType: qmckl_exit_code :FRetType: qmckl_exit_code
:END: :END:
#+CALL: generate_f_interface(table=qmckl_sherman_morrison_naive_args,rettyp=get_value("FRetType"),fname="qmckl_sherman_morrison_naive_hpc") #+CALL: generate_f_interface(table=qmckl_sm_naive_args,rettyp=get_value("FRetType"),fname="qmckl_sm_naive_hpc")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none #+begin_src f90 :tangle (eval fh_func) :comments org :exports none
interface interface
integer(c_int32_t) function qmckl_sherman_morrison_naive_hpc & integer(c_int32_t) function qmckl_sm_naive_hpc &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) & (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) &
bind(C) bind(C)
use, intrinsic :: iso_c_binding use, intrinsic :: iso_c_binding
@ -617,16 +617,16 @@ interface
real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS) real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS)
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
end function qmckl_sherman_morrison_naive_hpc end function qmckl_sm_naive_hpc
end interface end interface
#+end_src #+end_src
#+CALL: generate_f_interface(table=qmckl_sherman_morrison_naive_args,rettyp=get_value("FRetType"),fname="qmckl_sherman_morrison_naive_doc") #+CALL: generate_f_interface(table=qmckl_sm_naive_args,rettyp=get_value("FRetType"),fname="qmckl_sm_naive_doc")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none #+begin_src f90 :tangle (eval fh_func) :comments org :exports none
interface interface
integer(c_int32_t) function qmckl_sherman_morrison_naive_doc & integer(c_int32_t) function qmckl_sm_naive_doc &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) & (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) &
bind(C) bind(C)
use, intrinsic :: iso_c_binding use, intrinsic :: iso_c_binding
@ -643,16 +643,16 @@ interface
real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS) real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS)
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
end function qmckl_sherman_morrison_naive_doc end function qmckl_sm_naive_doc
end interface end interface
#+end_src #+end_src
#+CALL: generate_f_interface(table=qmckl_sherman_morrison_naive_args,rettyp=get_value("FRetType"),fname="qmckl_sherman_morrison_naive") #+CALL: generate_f_interface(table=qmckl_sm_naive_args,rettyp=get_value("FRetType"),fname="qmckl_sm_naive")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none #+begin_src f90 :tangle (eval fh_func) :comments org :exports none
interface interface
integer(c_int32_t) function qmckl_sherman_morrison_naive & integer(c_int32_t) function qmckl_sm_naive &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) & (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) &
bind(C) bind(C)
use, intrinsic :: iso_c_binding use, intrinsic :: iso_c_binding
@ -669,7 +669,7 @@ interface
real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS) real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS)
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
end function qmckl_sherman_morrison_naive end function qmckl_sm_naive
end interface end interface
#+end_src #+end_src
@ -701,7 +701,7 @@ assert(Slater_inv1 != NULL);
// original determinant of Slater1 (before applying updates) // original determinant of Slater1 (before applying updates)
double det = 3.407025646103221e-10; double det = 3.407025646103221e-10;
rc = qmckl_sherman_morrison_naive(context, rc = qmckl_sm_naive(context,
LDS, LDS,
Dim, Dim,
N_updates1, N_updates1,
@ -738,15 +738,15 @@ assert(rc == QMCKL_SUCCESS);
* Sherman-Morrison with Slagel Splitting (core) * Sherman-Morrison with Slagel Splitting (core)
** ~qmckl_slagel_splitting~ ** ~qmckl_sm_splitting_core~
:PROPERTIES: :PROPERTIES:
:Name: qmckl_slagel_splitting :Name: qmckl_sm_splitting_core
:CRetType: qmckl_exit_code :CRetType: qmckl_exit_code
:FRetType: qmckl_exit_code :FRetType: qmckl_exit_code
:END: :END:
*** Introduction *** Introduction
~qmckl_slagel_splitting~ is the inner core part of 'Sherman-Morrison with update splitting' in the next section. ~qmckl_sm_splitting_core~ is the inner core part of 'Sherman-Morrison with update splitting' in the next section.
It is not normally used by itself but it is possible to use it nonetheless. It is not normally used by itself but it is possible to use it nonetheless.
It has three extra parameters in its API: It has three extra parameters in its API:
@ -754,14 +754,14 @@ It has three extra parameters in its API:
- ~later_index~ initially empty array that will contain the row/column numbers of the updates that were split during execution - ~later_index~ initially empty array that will contain the row/column numbers of the updates that were split during execution
- ~later~ initially zero integer that records the number of updates that were split during exection. - ~later~ initially zero integer that records the number of updates that were split during exection.
It is up to the user to decide what to do with these updates once the kernel returns. Normally ~qmckl_slagel_splitting~ is It is up to the user to decide what to do with these updates once the kernel returns. Normally ~qmckl_sm_splitting_core~ is
used as the core part of a recursive function, as is done in ~qmckl_sherman_morrison_splitting~ or as part of a more complex used as the core part of a recursive function, as is done in ~qmckl_sm_splitting~ or as part of a more complex
kernel like ~qmckl_sherman_morrison_smw32s~. kernel like ~qmckl_sherman_morrison_smw32s~.
If the determinant is passed it will only be partially updated if there were any update splits. If the determinant is passed it will only be partially updated if there were any update splits.
*** API *** API
#+NAME: qmckl_slagel_splitting_args #+NAME: qmckl_sm_splitting_core_args
| Variable | Type | In/Out | Description | | Variable | Type | In/Out | Description |
|-----------------+-------------------------+--------+---------------------------------------------------------------| |-----------------+-------------------------+--------+---------------------------------------------------------------|
| ~context~ | ~qmckl_context~ | in | Global state | | ~context~ | ~qmckl_context~ | in | Global state |
@ -795,7 +795,7 @@ able to do numerically correct computations, it does not do it in the most effic
not be used in real workloads. not be used in real workloads.
#+begin_src f90 :tangle (eval f) #+begin_src f90 :tangle (eval f)
integer function qmckl_slagel_splitting_doc_f( & integer function qmckl_sm_splitting_core_doc_f( &
context, & context, &
lds, dim, & lds, dim, &
nupdates, & nupdates, &
@ -843,21 +843,21 @@ integer function qmckl_slagel_splitting_doc_f( &
info = QMCKL_SUCCESS info = QMCKL_SUCCESS
end function qmckl_slagel_splitting_doc_f end function qmckl_sm_splitting_core_doc_f
#+end_src #+end_src
**** C interface to the pedagogical kernel (not directly exposed) **** C interface to the pedagogical kernel (not directly exposed)
The following Fortran function ~qmckl_slagel_splitting_doc~ makes sure The following Fortran function ~qmckl_sm_splitting_core_doc~ makes sure
that the pedagogical kernel ~qmckl_slagel_splitting_doc_f~, written in that the pedagogical kernel ~qmckl_sm_splitting_core_doc_f~, written in
Fortran, can be called from C using the ~ISO_C_BINDING~. The Fortran function Fortran, can be called from C using the ~ISO_C_BINDING~. The Fortran function
~qmckl_slagel_splitting_doc~ will be exposed in the header file 'qmckl.h' ~qmckl_sm_splitting_core_doc~ will be exposed in the header file 'qmckl.h'
for C users and in the module file 'qmckl_f.F90' for Fortran users. for C users and in the module file 'qmckl_f.F90' for Fortran users.
#+CALL: generate_c_interface(table=qmckl_slagel_splitting_args,rettyp=get_value("CRetType"),fname="qmckl_slagel_splitting_doc") #+CALL: generate_c_interface(table=qmckl_sm_splitting_core_args,rettyp=get_value("CRetType"),fname="qmckl_sm_splitting_core_doc")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval f) :comments org :exports none #+begin_src f90 :tangle (eval f) :comments org :exports none
integer(c_int32_t) function qmckl_slagel_splitting_doc & integer(c_int32_t) function qmckl_sm_splitting_core_doc &
(context, & (context, &
LDS, & LDS, &
Dim, & Dim, &
@ -888,8 +888,8 @@ integer(c_int32_t) function qmckl_slagel_splitting_doc &
integer (c_int64_t) , intent(inout) :: later integer (c_int64_t) , intent(inout) :: later
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
integer(c_int32_t), external :: qmckl_slagel_splitting_doc_f integer(c_int32_t), external :: qmckl_sm_splitting_core_doc_f
info = qmckl_slagel_splitting_doc_f & info = qmckl_sm_splitting_core_doc_f &
(context, & (context, &
LDS, & LDS, &
Dim, & Dim, &
@ -903,15 +903,15 @@ integer(c_int32_t) function qmckl_slagel_splitting_doc &
later, & later, &
determinant) determinant)
end function qmckl_slagel_splitting_doc end function qmckl_sm_splitting_core_doc
#+end_src #+end_src
*** C headers (exposed in qmckl.h) *** C headers (exposed in qmckl.h)
#+CALL: generate_c_header(table=qmckl_slagel_splitting_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+CALL: generate_c_header(table=qmckl_sm_splitting_core_args,rettyp=get_value("CRetType"),fname=get_value("Name"))
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_func) :comments org #+begin_src c :tangle (eval h_func) :comments org
qmckl_exit_code qmckl_slagel_splitting ( qmckl_exit_code qmckl_sm_splitting_core (
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -926,11 +926,11 @@ qmckl_exit_code qmckl_slagel_splitting (
double* determinant ); double* determinant );
#+end_src #+end_src
#+CALL: generate_c_header(table=qmckl_slagel_splitting_args,rettyp=get_value("CRetType"),fname="qmckl_slagel_splitting_doc") #+CALL: generate_c_header(table=qmckl_sm_splitting_core_args,rettyp=get_value("CRetType"),fname="qmckl_sm_splitting_core_doc")
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_func) :comments org #+begin_src c :tangle (eval h_func) :comments org
qmckl_exit_code qmckl_slagel_splitting_doc ( qmckl_exit_code qmckl_sm_splitting_core_doc (
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -947,7 +947,7 @@ qmckl_exit_code qmckl_slagel_splitting_doc (
*** C sources *** C sources
#+begin_src c :tangle (eval c) :comments org #+begin_src c :tangle (eval c) :comments org
qmckl_exit_code qmckl_slagel_splitting_hpc( qmckl_exit_code qmckl_sm_splitting_core_hpc(
const qmckl_context context, const qmckl_context context,
uint64_t LDS, uint64_t LDS,
uint64_t Dim, uint64_t Dim,
@ -965,7 +965,7 @@ qmckl_exit_code qmckl_slagel_splitting_hpc(
return qmckl_failwith( return qmckl_failwith(
context, context,
QMCKL_NULL_CONTEXT, QMCKL_NULL_CONTEXT,
"qmckl_slagel_splitting_hpc", "qmckl_sm_splitting_core_hpc",
NULL); NULL);
} }
@ -1033,7 +1033,7 @@ qmckl_exit_code qmckl_slagel_splitting_hpc(
#+NAME:slagel_splitting_template_code #+NAME:slagel_splitting_template_code
#+begin_src c #+begin_src c
static inline qmckl_exit_code qmckl_slagel_splitting_{Dim}( static inline qmckl_exit_code qmckl_sm_splitting_core_{Dim}(
const qmckl_context context, const qmckl_context context,
uint64_t N_updates, uint64_t N_updates,
const double* __restrict Updates, const double* __restrict Updates,
@ -1049,7 +1049,7 @@ static inline qmckl_exit_code qmckl_slagel_splitting_{Dim}(
return qmckl_failwith( return qmckl_failwith(
context, context,
QMCKL_NULL_CONTEXT, QMCKL_NULL_CONTEXT,
"qmckl_slagel_splitting_{Dim}", "qmckl_sm_splitting_core_{Dim}",
NULL); NULL);
} }
@ -1132,7 +1132,7 @@ return '\n'.join(result)
#+begin_src python :noweb yes #+begin_src python :noweb yes
text=""" text="""
case {Dim}: { case {Dim}: {
return qmckl_slagel_splitting_{Dim}( return qmckl_sm_splitting_core_{Dim}(
context, context,
N_updates, N_updates,
Updates, Updates,
@ -1159,7 +1159,7 @@ return '\n'.join(result)
#+end_src #+end_src
#+begin_src c :tangle (eval c) :comments org :noweb yes #+begin_src c :tangle (eval c) :comments org :noweb yes
qmckl_exit_code qmckl_slagel_splitting( qmckl_exit_code qmckl_sm_splitting_core(
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -1184,7 +1184,7 @@ qmckl_exit_code qmckl_slagel_splitting(
} }
} }
else { // Updating smaller sub-matrix else { // Updating smaller sub-matrix
return qmckl_slagel_splitting_hpc( return qmckl_sm_splitting_core_hpc(
context, context,
LDS, LDS,
Dim, Dim,
@ -1199,7 +1199,7 @@ qmckl_exit_code qmckl_slagel_splitting(
determinant); determinant);
} }
#else #else
// return qmckl_slagel_splitting_doc( // return qmckl_sm_splitting_core_doc(
// context, // context,
// LDS, // LDS,
// Dim, // Dim,
@ -1212,7 +1212,7 @@ qmckl_exit_code qmckl_slagel_splitting(
// later_index, // later_index,
// later, // later,
// determinant); // determinant);
return qmckl_slagel_splitting_hpc( return qmckl_sm_splitting_core_hpc(
context, context,
LDS, LDS,
Dim, Dim,
@ -1233,17 +1233,17 @@ qmckl_exit_code qmckl_slagel_splitting(
*** Fortran interfaces (exposed in qmckl_f.F90) *** Fortran interfaces (exposed in qmckl_f.F90)
:PROPERTIES: :PROPERTIES:
:Name: qmckl_slagel_splitting :Name: qmckl_sm_splitting_core
:CRetType: qmckl_exit_code :CRetType: qmckl_exit_code
:FRetType: qmckl_exit_code :FRetType: qmckl_exit_code
:END: :END:
#+CALL: generate_f_interface(table=qmckl_slagel_splitting_args,rettyp=get_value("FRetType"),fname="qmckl_slagel_splitting_hpc") #+CALL: generate_f_interface(table=qmckl_sm_splitting_core_args,rettyp=get_value("FRetType"),fname="qmckl_sm_splitting_core_hpc")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none #+begin_src f90 :tangle (eval fh_func) :comments org :exports none
interface interface
integer(c_int32_t) function qmckl_slagel_splitting_hpc & integer(c_int32_t) function qmckl_sm_splitting_core_hpc &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, & (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, &
Slater_inv, later_updates, later_index, later, determinant) & Slater_inv, later_updates, later_index, later, determinant) &
bind(C) bind(C)
@ -1264,16 +1264,16 @@ interface
integer (c_int64_t) , intent(inout) :: later integer (c_int64_t) , intent(inout) :: later
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
end function qmckl_slagel_splitting_hpc end function qmckl_sm_splitting_core_hpc
end interface end interface
#+end_src #+end_src
#+CALL: generate_f_interface(table=qmckl_slagel_splitting_args,rettyp=get_value("FRetType"),fname="qmckl_slagel_splitting_doc") #+CALL: generate_f_interface(table=qmckl_sm_splitting_core_args,rettyp=get_value("FRetType"),fname="qmckl_sm_splitting_core_doc")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none #+begin_src f90 :tangle (eval fh_func) :comments org :exports none
interface interface
integer(c_int32_t) function qmckl_slagel_splitting_doc & integer(c_int32_t) function qmckl_sm_splitting_core_doc &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, & (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, &
Slater_inv, later_updates, later_index, later, determinant) & Slater_inv, later_updates, later_index, later, determinant) &
bind(C) bind(C)
@ -1294,16 +1294,16 @@ interface
integer (c_int64_t) , intent(inout) :: later integer (c_int64_t) , intent(inout) :: later
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
end function qmckl_slagel_splitting_doc end function qmckl_sm_splitting_core_doc
end interface end interface
#+end_src #+end_src
#+CALL: generate_f_interface(table=qmckl_slagel_splitting_args,rettyp=get_value("FRetType"),fname="qmckl_slagel_splitting") #+CALL: generate_f_interface(table=qmckl_sm_splitting_core_args,rettyp=get_value("FRetType"),fname="qmckl_sm_splitting_core")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none #+begin_src f90 :tangle (eval fh_func) :comments org :exports none
interface interface
integer(c_int32_t) function qmckl_slagel_splitting & integer(c_int32_t) function qmckl_sm_splitting_core &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, & (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, &
Slater_inv, later_updates, later_index, later, determinant) & Slater_inv, later_updates, later_index, later, determinant) &
bind(C) bind(C)
@ -1324,7 +1324,7 @@ interface
integer (c_int64_t) , intent(inout) :: later integer (c_int64_t) , intent(inout) :: later
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
end function qmckl_slagel_splitting end function qmckl_sm_splitting_core
end interface end interface
#+end_src #+end_src
@ -1334,9 +1334,9 @@ with Sherman-Morrison and update splitting. Please look at the performance recco
* Sherman-Morrison with Slagel Splitting * Sherman-Morrison with Slagel Splitting
** ~qmckl_sherman_morrison_splitting~ ** ~qmckl_sm_splitting~
:PROPERTIES: :PROPERTIES:
:Name: qmckl_sherman_morrison_splitting :Name: qmckl_sm_splitting
:CRetType: qmckl_exit_code :CRetType: qmckl_exit_code
:FRetType: qmckl_exit_code :FRetType: qmckl_exit_code
:END: :END:
@ -1357,7 +1357,7 @@ If the determinant of the Slater-matrix is passed, it will be updated to the det
from applying the updates to the original matrix. from applying the updates to the original matrix.
*** API *** API
#+NAME: qmckl_sherman_morrison_splitting_args #+NAME: qmckl_sm_splitting_args
| Variable | Type | In/Out | Description | | Variable | Type | In/Out | Description |
|---------------+-----------------------+--------+------------------------------------------------------| |---------------+-----------------------+--------+------------------------------------------------------|
| context | qmckl_context | in | Global state | | context | qmckl_context | in | Global state |
@ -1386,7 +1386,7 @@ able to do numerically correct computations, it does not do it in the most effic
not be used in real workloads. not be used in real workloads.
#+begin_src f90 :tangle (eval f) #+begin_src f90 :tangle (eval f)
integer function qmckl_sherman_morrison_splitting_doc_f(context, & integer function qmckl_sm_splitting_doc_f(context, &
lds, dim, & lds, dim, &
nupdates, & nupdates, &
upds, & upds, &
@ -1422,21 +1422,21 @@ integer function qmckl_sherman_morrison_splitting_doc_f(context, &
info = QMCKL_SUCCESS info = QMCKL_SUCCESS
end function qmckl_sherman_morrison_splitting_doc_f end function qmckl_sm_splitting_doc_f
#+end_src #+end_src
**** C interface to the pedagogical kernel (not directly exposed) **** C interface to the pedagogical kernel (not directly exposed)
The following Fortran function ~qmckl_slagel_splitting_doc~ makes sure The following Fortran function ~qmckl_sm_splitting_core_doc~ makes sure
that the pedagogical kernel ~qmckl_slagel_splitting_doc_f~, written in that the pedagogical kernel ~qmckl_sm_splitting_core_doc_f~, written in
Fortran, can be called from C using the ~ISO_C_BINDING~. The Fortran function Fortran, can be called from C using the ~ISO_C_BINDING~. The Fortran function
~qmckl_slagel_splitting_doc~ will be exposed in the header file 'qmckl.h' ~qmckl_sm_splitting_core_doc~ will be exposed in the header file 'qmckl.h'
for C users and in the module file 'qmckl_f.F90' for Fortran users. for C users and in the module file 'qmckl_f.F90' for Fortran users.
#+CALL: generate_c_interface(table=qmckl_sherman_morrison_splitting_args,rettyp=get_value("CRetType"),fname="qmckl_sherman_morrison_splitting_doc") #+CALL: generate_c_interface(table=qmckl_sm_splitting_args,rettyp=get_value("CRetType"),fname="qmckl_sm_splitting_doc")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval f) :comments org :exports none #+begin_src f90 :tangle (eval f) :comments org :exports none
integer(c_int32_t) function qmckl_sherman_morrison_splitting_doc & integer(c_int32_t) function qmckl_sm_splitting_doc &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) & (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) &
bind(C) result(info) bind(C) result(info)
@ -1453,20 +1453,20 @@ integer(c_int32_t) function qmckl_sherman_morrison_splitting_doc &
real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS) real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS)
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
integer(c_int32_t), external :: qmckl_sherman_morrison_splitting_doc_f integer(c_int32_t), external :: qmckl_sm_splitting_doc_f
info = qmckl_sherman_morrison_splitting_doc_f & info = qmckl_sm_splitting_doc_f &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant)
end function qmckl_sherman_morrison_splitting_doc end function qmckl_sm_splitting_doc
#+end_src #+end_src
*** C headers (exposed in qmckl.h) *** C headers (exposed in qmckl.h)
#+CALL: generate_c_header(table=qmckl_sherman_morrison_splitting_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+CALL: generate_c_header(table=qmckl_sm_splitting_args,rettyp=get_value("CRetType"),fname=get_value("Name"))
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_func) :comments org #+begin_src c :tangle (eval h_func) :comments org
qmckl_exit_code qmckl_sherman_morrison_splitting ( qmckl_exit_code qmckl_sm_splitting (
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -1478,11 +1478,11 @@ qmckl_exit_code qmckl_sherman_morrison_splitting (
double* determinant ); double* determinant );
#+end_src #+end_src
#+CALL: generate_c_header(table=qmckl_sherman_morrison_splitting_args,rettyp=get_value("CRetType"),fname="qmckl_sherman_morrison_splitting_hpc") #+CALL: generate_c_header(table=qmckl_sm_splitting_args,rettyp=get_value("CRetType"),fname="qmckl_sm_splitting_hpc")
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_func) :comments org #+begin_src c :tangle (eval h_func) :comments org
qmckl_exit_code qmckl_sherman_morrison_splitting_hpc ( qmckl_exit_code qmckl_sm_splitting_hpc (
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -1494,11 +1494,11 @@ qmckl_exit_code qmckl_sherman_morrison_splitting_hpc (
double* determinant ); double* determinant );
#+end_src #+end_src
#+CALL: generate_c_header(table=qmckl_sherman_morrison_splitting_args,rettyp=get_value("CRetType"),fname="qmckl_sherman_morrison_splitting_doc") #+CALL: generate_c_header(table=qmckl_sm_splitting_args,rettyp=get_value("CRetType"),fname="qmckl_sm_splitting_doc")
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_func) :comments org #+begin_src c :tangle (eval h_func) :comments org
qmckl_exit_code qmckl_sherman_morrison_splitting_doc ( qmckl_exit_code qmckl_sm_splitting_doc (
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -1515,7 +1515,7 @@ qmckl_exit_code qmckl_sherman_morrison_splitting_doc (
#+begin_src python :noweb yes #+begin_src python :noweb yes
text=""" text="""
case {Dim}: { case {Dim}: {
rc = qmckl_slagel_splitting_{Dim}( rc = qmckl_sm_splitting_core_{Dim}(
context, context,
N_updates, N_updates,
Updates, Updates,
@ -1536,7 +1536,7 @@ return '\n'.join(result)
#+end_src #+end_src
#+begin_src c :tangle (eval c) :comments org :noweb yes #+begin_src c :tangle (eval c) :comments org :noweb yes
qmckl_exit_code qmckl_sherman_morrison_splitting_hpc( qmckl_exit_code qmckl_sm_splitting_hpc(
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -1551,7 +1551,7 @@ qmckl_exit_code qmckl_sherman_morrison_splitting_hpc(
return qmckl_failwith( return qmckl_failwith(
context, context,
QMCKL_NULL_CONTEXT, QMCKL_NULL_CONTEXT,
"qmckl_sherman_morrison_splitting_hpc", "qmckl_sm_splitting_hpc",
NULL); NULL);
} }
@ -1569,7 +1569,7 @@ qmckl_exit_code qmckl_sherman_morrison_splitting_hpc(
} }
} }
} else { } else {
rc = qmckl_slagel_splitting_hpc( rc = qmckl_sm_splitting_core_hpc(
context, LDS, Dim, N_updates, Updates, Updates_index, context, LDS, Dim, N_updates, Updates, Updates_index,
breakdown, Slater_inv, later_updates, breakdown, Slater_inv, later_updates,
later_index, &later, determinant); later_index, &later, determinant);
@ -1577,7 +1577,7 @@ qmckl_exit_code qmckl_sherman_morrison_splitting_hpc(
if (rc != QMCKL_SUCCESS) return QMCKL_FAILURE; if (rc != QMCKL_SUCCESS) return QMCKL_FAILURE;
if (later > 0) { if (later > 0) {
qmckl_exit_code rc = qmckl_sherman_morrison_splitting_hpc( qmckl_exit_code rc = qmckl_sm_splitting_hpc(
context, LDS, Dim, later, context, LDS, Dim, later,
later_updates, later_index, later_updates, later_index,
breakdown, Slater_inv, determinant); breakdown, Slater_inv, determinant);
@ -1589,7 +1589,7 @@ qmckl_exit_code qmckl_sherman_morrison_splitting_hpc(
#+end_src #+end_src
#+begin_src c :tangle (eval c) :comment org #+begin_src c :tangle (eval c) :comment org
qmckl_exit_code qmckl_sherman_morrison_splitting( qmckl_exit_code qmckl_sm_splitting(
const qmckl_context context, const qmckl_context context,
const uint64_t LDS, const uint64_t LDS,
const uint64_t Dim, const uint64_t Dim,
@ -1604,11 +1604,11 @@ qmckl_exit_code qmckl_sherman_morrison_splitting(
return qmckl_failwith( return qmckl_failwith(
context, context,
QMCKL_NULL_CONTEXT, QMCKL_NULL_CONTEXT,
"qmckl_sherman_morrison_splitting", "qmckl_sm_splitting",
NULL); NULL);
} }
#ifdef HAS_HPC #ifdef HAS_HPC
return qmckl_sherman_morrison_splitting_hpc( return qmckl_sm_splitting_hpc(
context, context,
LDS, LDS,
Dim, Dim,
@ -1619,7 +1619,7 @@ qmckl_exit_code qmckl_sherman_morrison_splitting(
Slater_inv, Slater_inv,
determinant); determinant);
#else #else
// return qmckl_sherman_morrison_splitting_doc( // return qmckl_sm_splitting_doc(
// context, // context,
// LDS, // LDS,
// Dim, // Dim,
@ -1629,7 +1629,7 @@ qmckl_exit_code qmckl_sherman_morrison_splitting(
// breakdown, // breakdown,
// Slater_inv, // Slater_inv,
// determinant); // determinant);
return qmckl_sherman_morrison_splitting_hpc( return qmckl_sm_splitting_hpc(
context, context,
LDS, LDS,
Dim, Dim,
@ -1647,17 +1647,17 @@ qmckl_exit_code qmckl_sherman_morrison_splitting(
*** Fortran interfaces (exposed in qmckl_f.F90) *** Fortran interfaces (exposed in qmckl_f.F90)
:PROPERTIES: :PROPERTIES:
:Name: qmckl_sherman_morrison_naive :Name: qmckl_sm_naive
:CRetType: qmckl_exit_code :CRetType: qmckl_exit_code
:FRetType: qmckl_exit_code :FRetType: qmckl_exit_code
:END: :END:
#+CALL: generate_f_interface(table=qmckl_sherman_morrison_splitting_args,rettyp=get_value("FRetType"),fname="qmckl_sherman_morrison_splitting_hpc") #+CALL: generate_f_interface(table=qmckl_sm_splitting_args,rettyp=get_value("FRetType"),fname="qmckl_sm_splitting_hpc")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none #+begin_src f90 :tangle (eval fh_func) :comments org :exports none
interface interface
integer(c_int32_t) function qmckl_sherman_morrison_splitting_hpc & integer(c_int32_t) function qmckl_sm_splitting_hpc &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) & (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) &
bind(C) bind(C)
use, intrinsic :: iso_c_binding use, intrinsic :: iso_c_binding
@ -1674,16 +1674,16 @@ interface
real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS) real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS)
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
end function qmckl_sherman_morrison_splitting_hpc end function qmckl_sm_splitting_hpc
end interface end interface
#+end_src #+end_src
#+CALL: generate_f_interface(table=qmckl_sherman_morrison_splitting_args,rettyp=get_value("FRetType"),fname="qmckl_sherman_morrison_splitting_doc") #+CALL: generate_f_interface(table=qmckl_sm_splitting_args,rettyp=get_value("FRetType"),fname="qmckl_sm_splitting_doc")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none #+begin_src f90 :tangle (eval fh_func) :comments org :exports none
interface interface
integer(c_int32_t) function qmckl_sherman_morrison_splitting_doc & integer(c_int32_t) function qmckl_sm_splitting_doc &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) & (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) &
bind(C) bind(C)
use, intrinsic :: iso_c_binding use, intrinsic :: iso_c_binding
@ -1700,16 +1700,16 @@ interface
real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS) real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS)
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
end function qmckl_sherman_morrison_splitting_doc end function qmckl_sm_splitting_doc
end interface end interface
#+end_src #+end_src
#+CALL: generate_f_interface(table=qmckl_sherman_morrison_splitting_args,rettyp=get_value("FRetType"),fname="qmckl_sherman_morrison_splitting") #+CALL: generate_f_interface(table=qmckl_sm_splitting_args,rettyp=get_value("FRetType"),fname="qmckl_sm_splitting")
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none #+begin_src f90 :tangle (eval fh_func) :comments org :exports none
interface interface
integer(c_int32_t) function qmckl_sherman_morrison_splitting & integer(c_int32_t) function qmckl_sm_splitting &
(context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) & (context, LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, determinant) &
bind(C) bind(C)
use, intrinsic :: iso_c_binding use, intrinsic :: iso_c_binding
@ -1726,7 +1726,7 @@ interface
real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS) real (c_double ) , intent(inout) :: Slater_inv(Dim*LDS)
real (c_double ) , intent(inout) :: determinant real (c_double ) , intent(inout) :: determinant
end function qmckl_sherman_morrison_splitting end function qmckl_sm_splitting
end interface end interface
#+end_src #+end_src
@ -1739,7 +1739,7 @@ assert(Updates3 != NULL);
assert(Updates_index3 != NULL); assert(Updates_index3 != NULL);
assert(Slater_inv3_2 != NULL); assert(Slater_inv3_2 != NULL);
det = -1.23743195512859e-09; det = -1.23743195512859e-09;
rc = qmckl_sherman_morrison_splitting(context, LDS, Dim, N_updates3, Updates3, Updates_index3, breakdown, Slater_inv3_2, &det); rc = qmckl_sm_splitting(context, LDS, Dim, N_updates3, Updates3, Updates_index3, breakdown, Slater_inv3_2, &det);
assert(fabs(det - 1.602708950725074e-10) < 1e-15); assert(fabs(det - 1.602708950725074e-10) < 1e-15);
for (unsigned int i = 0; i < Dim; i++) { for (unsigned int i = 0; i < Dim; i++) {
for (unsigned int j = 0; j < Dim; j++) { for (unsigned int j = 0; j < Dim; j++) {