mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 10:06:09 +01:00
Properly comment qmckl_probes
Add comment to explicit the use of qmckl_probes and provide a link to Verificarlo's documentation
This commit is contained in:
parent
291ea5441d
commit
5e18523274
@ -8,8 +8,31 @@ vfc_probes probes;
|
||||
#endif
|
||||
|
||||
|
||||
// Wrappers to Verificarlo functions
|
||||
// QMCkl is a wrapper to Verificarlo's vfc_probes system. The goal of QMCkl
|
||||
// probes isto simplify the use of vfc_probes, and to provide functions that
|
||||
// can be called either wit or without vfc_ci support by using #ifndef
|
||||
// statements :
|
||||
//
|
||||
// - when vfc_ci is disabled, qmckl_probes functions will either return false
|
||||
// (no error) or perform a check based on a reference value
|
||||
// - when vfc_ci is enabled, qmckl_probe functions will simply encapsulate
|
||||
// calls to vfc_probe
|
||||
//
|
||||
// Moreover, one does not have to worry about the life cycle of the probes
|
||||
// structure, as it is automatically created, dumped and freed by this wrapper.
|
||||
//
|
||||
// vfc_ci support can be enabled by using the following configure command :
|
||||
// QMCKL_DEVEL=1 ./configure --prefix=$PWD/_install --enable-silent-rules
|
||||
// --enable-maintainer-mode CC=verificarlo-f FC=verificarlo-f --host=x86_64
|
||||
//
|
||||
// Finally, this wrapper also comes with a Fortran interface (in its dedicated
|
||||
// file).
|
||||
//
|
||||
// To learn more about Verificarlo CI :
|
||||
// https://github.com/verificarlo/verificarlo/blob/master/doc/06-Postprocessing.md#verificarlo-ci
|
||||
|
||||
|
||||
// Automatically initialize the vfc_probe object if VFC_CI is defined
|
||||
#ifdef VFC_CI
|
||||
void __attribute__((constructor)) qmckl_init_probes(){
|
||||
probes = vfc_init_probes();
|
||||
@ -17,6 +40,9 @@ void __attribute__((constructor)) qmckl_init_probes(){
|
||||
#endif
|
||||
|
||||
|
||||
// Standard probe, without check
|
||||
// - if VFC_CI is defined, place a standard probe
|
||||
// - if VFC_CI is undefined, return false (no error)
|
||||
bool qmckl_probe(
|
||||
char * testName,
|
||||
char * varName,
|
||||
@ -30,6 +56,10 @@ bool qmckl_probe(
|
||||
}
|
||||
|
||||
|
||||
// Probe with absolute check
|
||||
// - if VFC_CI is defined, place a probe with an absolute check
|
||||
// - if VFC_CI is undefined, perform an absolute check based on target value
|
||||
// and accuracy
|
||||
bool qmckl_probe_check(
|
||||
char * testName,
|
||||
char * varName,
|
||||
@ -45,6 +75,10 @@ bool qmckl_probe_check(
|
||||
}
|
||||
|
||||
|
||||
// Probe with relative check
|
||||
// - if VFC_CI is defined, place a probe with a relative check
|
||||
// - if VFC_CI is undefined, perform a relative check based on target value
|
||||
// and accuracy
|
||||
bool qmckl_probe_check_relative (
|
||||
char * testName,
|
||||
char * varName,
|
||||
@ -59,6 +93,8 @@ bool qmckl_probe_check_relative (
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// Automatically delete and dump the vfc_probe object if VFC_CI is defined
|
||||
#ifdef VFC_CI
|
||||
void __attribute__((destructor)) qmckl_dump_probes(){
|
||||
vfc_dump_probes(&probes);
|
||||
|
Loading…
Reference in New Issue
Block a user