1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-11-03 12:43:57 +01:00

Deploying to gh-pages from @ TREX-CoE/qmckl@09c8f9700f 🚀

This commit is contained in:
scemama 2021-03-28 23:40:32 +00:00
parent 851081f2bb
commit 42b3cf591f
9 changed files with 226 additions and 225 deletions

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-03-28 Sun 23:18 -->
<!-- 2021-03-28 Sun 23:40 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>QMCkl source code documentation</title>
@ -348,7 +348,7 @@ and bug reports should be submitted at
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-03-28 Sun 23:18</p>
<p class="date">Created: 2021-03-28 Sun 23:40</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-03-28 Sun 23:18 -->
<!-- 2021-03-28 Sun 23:40 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>QMCkl source code documentation</title>
@ -348,7 +348,7 @@ and bug reports should be submitted at
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-03-28 Sun 23:18</p>
<p class="date">Created: 2021-03-28 Sun 23:40</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-03-28 Sun 23:18 -->
<!-- 2021-03-28 Sun 23:40 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Introduction</title>
@ -333,30 +333,30 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org6b1f165">1. Using QMCkl</a></li>
<li><a href="#orgf6b850a">2. Developing in QMCkl</a>
<li><a href="#orgb70c621">1. Using QMCkl</a></li>
<li><a href="#org5805181">2. Developing in QMCkl</a>
<ul>
<li><a href="#orgf068d73">2.1. Literate programming</a></li>
<li><a href="#org481f2ee">2.2. Source code editing</a></li>
<li><a href="#orge8f3f5d">2.3. Choice of the programming language</a></li>
<li><a href="#orgdf4fbfb">2.4. Coding rules</a></li>
<li><a href="#org7fffd37">2.5. Design of the library</a></li>
<li><a href="#org6a79703">2.6. Naming conventions</a></li>
<li><a href="#orgfb1bd33">2.7. Application programming interface</a></li>
<li><a href="#org57d8607">2.8. Global state</a></li>
<li><a href="#org7aa1e5e">2.9. Low-level functions</a></li>
<li><a href="#orgbd5d6e3">2.10. High-level functions</a></li>
<li><a href="#orgea083c4">2.11. Numerical precision</a></li>
<li><a href="#org51b9002">2.12. Algorithms</a></li>
<li><a href="#orgd9a567b">2.13. Rules for the API</a></li>
<li><a href="#org6703b2b">2.1. Literate programming</a></li>
<li><a href="#org99f235d">2.2. Source code editing</a></li>
<li><a href="#org0e38020">2.3. Choice of the programming language</a></li>
<li><a href="#org573c8ad">2.4. Coding rules</a></li>
<li><a href="#org05713f0">2.5. Design of the library</a></li>
<li><a href="#org15f5922">2.6. Naming conventions</a></li>
<li><a href="#org2016963">2.7. Application programming interface</a></li>
<li><a href="#orgc412529">2.8. Global state</a></li>
<li><a href="#orgf43aa74">2.9. Low-level functions</a></li>
<li><a href="#org9191e07">2.10. High-level functions</a></li>
<li><a href="#org28587b9">2.11. Numerical precision</a></li>
<li><a href="#orgc0ec3d1">2.12. Algorithms</a></li>
<li><a href="#org9c9e3a2">2.13. Rules for the API</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-org6b1f165" class="outline-2">
<h2 id="org6b1f165"><span class="section-number-2">1</span> Using QMCkl</h2>
<div id="outline-container-orgb70c621" class="outline-2">
<h2 id="orgb70c621"><span class="section-number-2">1</span> Using QMCkl</h2>
<div class="outline-text-2" id="text-1">
<p>
The <code>qmckl.h</code> header file has to be included in C codes when
@ -385,12 +385,12 @@ Both files are located in the <code>include/</code> directory.
</div>
</div>
<div id="outline-container-orgf6b850a" class="outline-2">
<h2 id="orgf6b850a"><span class="section-number-2">2</span> Developing in QMCkl</h2>
<div id="outline-container-org5805181" class="outline-2">
<h2 id="org5805181"><span class="section-number-2">2</span> Developing in QMCkl</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-orgf068d73" class="outline-3">
<h3 id="orgf068d73"><span class="section-number-3">2.1</span> Literate programming</h3>
<div id="outline-container-org6703b2b" class="outline-3">
<h3 id="org6703b2b"><span class="section-number-3">2.1</span> Literate programming</h3>
<div class="outline-text-3" id="text-2-1">
<p>
In a traditional source code, most of the lines of source files of a program
@ -436,8 +436,8 @@ interactively, in the same spirit as Jupyter notebooks.
</div>
<div id="outline-container-org481f2ee" class="outline-3">
<h3 id="org481f2ee"><span class="section-number-3">2.2</span> Source code editing</h3>
<div id="outline-container-org99f235d" class="outline-3">
<h3 id="org99f235d"><span class="section-number-3">2.2</span> Source code editing</h3>
<div class="outline-text-3" id="text-2-2">
<p>
For a tutorial on literate programming with org-mode, follow <a href="http://www.howardism.org/Technical/Emacs/literate-programming-tutorial.html">this link</a>.
@ -469,8 +469,8 @@ org-mode.
</div>
<div id="outline-container-orge8f3f5d" class="outline-3">
<h3 id="orge8f3f5d"><span class="section-number-3">2.3</span> Choice of the programming language</h3>
<div id="outline-container-org0e38020" class="outline-3">
<h3 id="org0e38020"><span class="section-number-3">2.3</span> Choice of the programming language</h3>
<div class="outline-text-3" id="text-2-3">
<p>
Most of the codes of the <a href="https://trex-coe.eu">TREX CoE</a> are written in Fortran with some scripts in
@ -518,8 +518,8 @@ For more guidelines on using Fortran to generate a C interface, see
</div>
</div>
<div id="outline-container-orgdf4fbfb" class="outline-3">
<h3 id="orgdf4fbfb"><span class="section-number-3">2.4</span> Coding rules</h3>
<div id="outline-container-org573c8ad" class="outline-3">
<h3 id="org573c8ad"><span class="section-number-3">2.4</span> Coding rules</h3>
<div class="outline-text-3" id="text-2-4">
<p>
The authors should follow the recommendations of the
@ -535,8 +535,8 @@ freed</li>
</div>
<div id="outline-container-org7fffd37" class="outline-3">
<h3 id="org7fffd37"><span class="section-number-3">2.5</span> Design of the library</h3>
<div id="outline-container-org05713f0" class="outline-3">
<h3 id="org05713f0"><span class="section-number-3">2.5</span> Design of the library</h3>
<div class="outline-text-3" id="text-2-5">
<p>
The proposed API should allow the library to: deal with memory transfers
@ -547,8 +547,8 @@ functions (see below).
</div>
</div>
<div id="outline-container-org6a79703" class="outline-3">
<h3 id="org6a79703"><span class="section-number-3">2.6</span> Naming conventions</h3>
<div id="outline-container-org15f5922" class="outline-3">
<h3 id="org15f5922"><span class="section-number-3">2.6</span> Naming conventions</h3>
<div class="outline-text-3" id="text-2-6">
<p>
To avoid namespace collisions, we use <code>qmckl_</code> as a prefix for all exported
@ -573,8 +573,8 @@ form is allowed.
</div>
</div>
<div id="outline-container-orgfb1bd33" class="outline-3">
<h3 id="orgfb1bd33"><span class="section-number-3">2.7</span> Application programming interface</h3>
<div id="outline-container-org2016963" class="outline-3">
<h3 id="org2016963"><span class="section-number-3">2.7</span> Application programming interface</h3>
<div class="outline-text-3" id="text-2-7">
<p>
In the C language, the number of bits used by the integer types can change
@ -607,15 +607,15 @@ bindings in other languages in other repositories.
</div>
</div>
<div id="outline-container-org57d8607" class="outline-3">
<h3 id="org57d8607"><span class="section-number-3">2.8</span> Global state</h3>
<div id="outline-container-orgc412529" class="outline-3">
<h3 id="orgc412529"><span class="section-number-3">2.8</span> Global state</h3>
<div class="outline-text-3" id="text-2-8">
<p>
Global variables should be avoided in the library, because it is
possible that one single program needs to use multiple instances
of the library. To solve this problem we propose to use a pointer
to a <a href="./qmckl_context.html"><code>context</code></a> variable, built by the library with the
<code>qmckl_context_create</code> function. The <a id="org1c026ec">=context=</a> contains the global
<code>qmckl_context_create</code> function. The <a id="orgab1c430">=context=</a> contains the global
state of the library, and is used as the first argument of many
QMCkl functions.
</p>
@ -635,8 +635,8 @@ versions can be destroyed with <code>qmckl_context_destroy</code>.
</div>
</div>
<div id="outline-container-org7aa1e5e" class="outline-3">
<h3 id="org7aa1e5e"><span class="section-number-3">2.9</span> Low-level functions</h3>
<div id="outline-container-orgf43aa74" class="outline-3">
<h3 id="orgf43aa74"><span class="section-number-3">2.9</span> Low-level functions</h3>
<div class="outline-text-3" id="text-2-9">
<p>
Low-level functions are very simple functions which are leaves of
@ -645,14 +645,14 @@ the function call tree (they don't call any other QMCkl function).
<p>
These functions are <i>pure</i>, and unaware of the QMCkl
<a href="#org1c026ec"><code>context</code></a>. They are not allowed to allocate/deallocate memory, and
<a href="#orgab1c430"><code>context</code></a>. They are not allowed to allocate/deallocate memory, and
if they need temporary memory it should be provided in input.
</p>
</div>
</div>
<div id="outline-container-orgbd5d6e3" class="outline-3">
<h3 id="orgbd5d6e3"><span class="section-number-3">2.10</span> High-level functions</h3>
<div id="outline-container-org9191e07" class="outline-3">
<h3 id="org9191e07"><span class="section-number-3">2.10</span> High-level functions</h3>
<div class="outline-text-3" id="text-2-10">
<p>
High-level functions are at the top of the function call tree.
@ -665,27 +665,27 @@ temporary storage, to simplify the use of accelerators.
<p>
The high-level functions should be pure, unless the introduction
of non-purity is justified. All the side effects should be made in
the <a href="#org1c026ec"><code>context</code></a> variable.
the <a href="#orgab1c430"><code>context</code></a> variable.
</p>
</div>
</div>
<div id="outline-container-orgea083c4" class="outline-3">
<h3 id="orgea083c4"><span class="section-number-3">2.11</span> Numerical precision</h3>
<div id="outline-container-org28587b9" class="outline-3">
<h3 id="org28587b9"><span class="section-number-3">2.11</span> Numerical precision</h3>
<div class="outline-text-3" id="text-2-11">
<p>
The number of bits of precision required for a function should be
given as an input of low-level computational functions. This input
will be used to define the values of the different thresholds that
might be used to avoid computing unnecessary noise. High-level
functions will use the precision specified in the <a href="#org1c026ec"><code>context</code></a>
functions will use the precision specified in the <a href="#orgab1c430"><code>context</code></a>
variable.
</p>
</div>
</div>
<div id="outline-container-org51b9002" class="outline-3">
<h3 id="org51b9002"><span class="section-number-3">2.12</span> Algorithms</h3>
<div id="outline-container-orgc0ec3d1" class="outline-3">
<h3 id="orgc0ec3d1"><span class="section-number-3">2.12</span> Algorithms</h3>
<div class="outline-text-3" id="text-2-12">
<p>
Reducing the scaling of an algorithm usually implies also reducing
@ -698,8 +698,8 @@ implemented adapted to different problem sizes.
</div>
</div>
<div id="outline-container-orgd9a567b" class="outline-3">
<h3 id="orgd9a567b"><span class="section-number-3">2.13</span> Rules for the API</h3>
<div id="outline-container-org9c9e3a2" class="outline-3">
<h3 id="org9c9e3a2"><span class="section-number-3">2.13</span> Rules for the API</h3>
<div class="outline-text-3" id="text-2-13">
<ul class="org-ul">
<li><code>stdint</code> should be used for integers (<code>int32_t</code>, <code>int64_t</code>)</li>
@ -713,7 +713,7 @@ implemented adapted to different problem sizes.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-03-28 Sun 23:18</p>
<p class="date">Created: 2021-03-28 Sun 23:40</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-03-28 Sun 23:18 -->
<!-- 2021-03-28 Sun 23:40 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Atomic Orbitals</title>
@ -333,14 +333,14 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgc4abd52">1. Polynomial part</a>
<li><a href="#orga2b0b45">1. Polynomial part</a>
<ul>
<li><a href="#org8b960fb">1.1. Powers of \(x-X_i\)</a></li>
<li><a href="#orge7c59d8">1.2. Value, Gradient and Laplacian of a polynomial</a></li>
<li><a href="#orge87d613">1.1. Powers of \(x-X_i\)</a></li>
<li><a href="#org6b3bbe0">1.2. Value, Gradient and Laplacian of a polynomial</a></li>
</ul>
</li>
<li><a href="#orge821a51">2. Gaussian basis functions</a></li>
<li><a href="#org01c63ff">3. <span class="todo TODO">TODO</span> Slater basis functions</a></li>
<li><a href="#orga5eed8f">2. Gaussian basis functions</a></li>
<li><a href="#org3bd7200">3. <span class="todo TODO">TODO</span> Slater basis functions</a></li>
</ul>
</div>
</div>
@ -389,12 +389,12 @@ In this section we describe the kernels used to compute the values,
gradients and Laplacian of the atomic basis functions.
</p>
<div id="outline-container-orgc4abd52" class="outline-2">
<h2 id="orgc4abd52"><span class="section-number-2">1</span> Polynomial part</h2>
<div id="outline-container-orga2b0b45" class="outline-2">
<h2 id="orga2b0b45"><span class="section-number-2">1</span> Polynomial part</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-org8b960fb" class="outline-3">
<h3 id="org8b960fb"><span class="section-number-3">1.1</span> Powers of \(x-X_i\)</h3>
<div id="outline-container-orge87d613" class="outline-3">
<h3 id="orge87d613"><span class="section-number-3">1.1</span> Powers of \(x-X_i\)</h3>
<div class="outline-text-3" id="text-1-1">
<p>
The <code>qmckl_ao_power</code> function computes all the powers of the <code>n</code>
@ -574,8 +574,8 @@ Requirements:
</div>
</div>
<div id="outline-container-orge7c59d8" class="outline-3">
<h3 id="orge7c59d8"><span class="section-number-3">1.2</span> Value, Gradient and Laplacian of a polynomial</h3>
<div id="outline-container-org6b3bbe0" class="outline-3">
<h3 id="org6b3bbe0"><span class="section-number-3">1.2</span> Value, Gradient and Laplacian of a polynomial</h3>
<div class="outline-text-3" id="text-1-2">
<p>
A polynomial is centered on a nucleus \(\mathbf{R}_i\)
@ -960,8 +960,8 @@ munit_assert_int(0, ==, test_qmckl_ao_polynomial_vgl(context));
</div>
</div>
<div id="outline-container-orge821a51" class="outline-2">
<h2 id="orge821a51"><span class="section-number-2">2</span> Gaussian basis functions</h2>
<div id="outline-container-orga5eed8f" class="outline-2">
<h2 id="orga5eed8f"><span class="section-number-2">2</span> Gaussian basis functions</h2>
<div class="outline-text-2" id="text-2">
<p>
<code>qmckl_ao_gaussian_vgl</code> computes the values, gradients and
@ -1193,13 +1193,13 @@ Requirements :
</div>
</div>
<div id="outline-container-org01c63ff" class="outline-2">
<h2 id="org01c63ff"><span class="section-number-2">3</span> <span class="todo TODO">TODO</span> Slater basis functions</h2>
<div id="outline-container-org3bd7200" class="outline-2">
<h2 id="org3bd7200"><span class="section-number-2">3</span> <span class="todo TODO">TODO</span> Slater basis functions</h2>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-03-28 Sun 23:18</p>
<p class="date">Created: 2021-03-28 Sun 23:40</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-03-28 Sun 23:18 -->
<!-- 2021-03-28 Sun 23:40 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Context</title>
@ -333,51 +333,51 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org2bb9568">1. Context handling</a>
<li><a href="#org0fb81f4">1. Context handling</a>
<ul>
<li><a href="#org1d06117">1.1. Data structure</a></li>
<li><a href="#org7a3ab61">1.2. Creation</a></li>
<li><a href="#org45b9874">1.3. Access to the previous context</a></li>
<li><a href="#org4f1dd7a">1.4. Locking</a></li>
<li><a href="#orgc505719">1.5. Copy</a></li>
<li><a href="#org8dabc32">1.6. Destroy</a></li>
<li><a href="#org144dc84">1.1. Data structure</a></li>
<li><a href="#orgf62bdeb">1.2. Creation</a></li>
<li><a href="#orgf4334dc">1.3. Access to the previous context</a></li>
<li><a href="#orgce0c987">1.4. Locking</a></li>
<li><a href="#orge6c6240">1.5. Copy</a></li>
<li><a href="#orgba8e08a">1.6. Destroy</a></li>
</ul>
</li>
<li><a href="#org83c6d7f">2. Memory allocation handling</a>
<li><a href="#org794c736">2. Memory allocation handling</a>
<ul>
<li><a href="#orgc4c4ede">2.1. Data structure</a></li>
<li><a href="#orgbef83e3">2.2. Append memory</a></li>
<li><a href="#org78687dd">2.3. Remove memory</a></li>
<li><a href="#org0844de7">2.1. Data structure</a></li>
<li><a href="#org1ad85ee">2.2. Append memory</a></li>
<li><a href="#org1a3828e">2.3. Remove memory</a></li>
</ul>
</li>
<li><a href="#orgabd4876">3. Error handling</a>
<li><a href="#org6baa1d9">3. Error handling</a>
<ul>
<li><a href="#org1e7b74a">3.1. Data structure</a></li>
<li><a href="#org2a236d9">3.2. Updating errors</a></li>
<li><a href="#org727f328">3.1. Data structure</a></li>
<li><a href="#orgaf5e190">3.2. Updating errors</a></li>
</ul>
</li>
<li><a href="#org4dcb9eb">4. Control of the numerical precision</a>
<li><a href="#orgb1bb94e">4. Control of the numerical precision</a>
<ul>
<li><a href="#org01c5d0e">4.1. Precision</a></li>
<li><a href="#orgcda4f1b">4.2. Range</a></li>
<li><a href="#org800591a">4.3. Helper functions</a></li>
<li><a href="#org6cce1e7">4.1. Precision</a></li>
<li><a href="#org050dac5">4.2. Range</a></li>
<li><a href="#orge0408c5">4.3. Helper functions</a></li>
</ul>
</li>
<li><a href="#org61ec0f1">5. <span class="todo TODO">TODO</span> Basis set</a>
<li><a href="#orgeec52e9">5. <span class="todo TODO">TODO</span> Basis set</a>
<ul>
<li><a href="#org11c949f">5.1. Data structure</a></li>
<li><a href="#org62a4ccd">5.2. <code>qmckl_context_update_ao_basis</code></a>
<li><a href="#org713d98f">5.1. Data structure</a></li>
<li><a href="#org211a794">5.2. <code>qmckl_context_update_ao_basis</code></a>
<ul>
<li><a href="#org909ff76">5.2.1. Source</a></li>
<li><a href="#org35884b5">5.2.2. Fortran interface</a></li>
<li><a href="#orgb373341">5.2.3. <span class="todo TODO">TODO</span> Test</a></li>
<li><a href="#orgc9741c4">5.2.1. Source</a></li>
<li><a href="#org7052863">5.2.2. Fortran interface</a></li>
<li><a href="#org8beb1fc">5.2.3. <span class="todo TODO">TODO</span> Test</a></li>
</ul>
</li>
<li><a href="#orgf72eb2a">5.3. <code>qmckl_context_set_ao_basis</code></a>
<li><a href="#orgd68f4f3">5.3. <code>qmckl_context_set_ao_basis</code></a>
<ul>
<li><a href="#orga43f1ee">5.3.1. Source</a></li>
<li><a href="#org6ffae6d">5.3.2. Fortran interface</a></li>
<li><a href="#orgbf0c658">5.3.3. <span class="todo TODO">TODO</span> Test</a></li>
<li><a href="#org8b9d416">5.3.1. Source</a></li>
<li><a href="#org99b78b7">5.3.2. Fortran interface</a></li>
<li><a href="#org213f75c">5.3.3. <span class="todo TODO">TODO</span> Test</a></li>
</ul>
</li>
</ul>
@ -401,8 +401,8 @@ A value of <code>QMCKL_NULL_CONTEXT</code> for the context is equivalent to a
</pre>
</div>
<div id="outline-container-org2bb9568" class="outline-2">
<h2 id="org2bb9568"><span class="section-number-2">1</span> Context handling</h2>
<div id="outline-container-org0fb81f4" class="outline-2">
<h2 id="org0fb81f4"><span class="section-number-2">1</span> Context handling</h2>
<div class="outline-text-2" id="text-1">
<p>
The context appears as an immutable data structure: modifying a
@ -419,8 +419,8 @@ and <code>ctx</code> is a <code>qmckl_context_struct*</code> pointer.
</p>
</div>
<div id="outline-container-org1d06117" class="outline-3">
<h3 id="org1d06117"><span class="section-number-3">1.1</span> Data structure</h3>
<div id="outline-container-org144dc84" class="outline-3">
<h3 id="org144dc84"><span class="section-number-3">1.1</span> Data structure</h3>
<div class="outline-text-3" id="text-1-1">
<p>
The main data structure contains pointers to other data structures,
@ -430,7 +430,7 @@ pointers.
</p>
<div class="org-src-container">
<pre class="src src-c" id="org20c4d9e"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_context_struct</span> {
<pre class="src src-c" id="org675a899"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_context_struct</span> {
/* <span style="color: #b22222;">Pointer to the previous context, before modification </span>*/
<span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_context_struct</span> * <span style="color: #a0522d;">prev</span>;
@ -510,8 +510,8 @@ if the context is valid, <code>QMCKL_NULL_CONTEXT</code> otherwise.
</div>
</div>
<div id="outline-container-org7a3ab61" class="outline-3">
<h3 id="org7a3ab61"><span class="section-number-3">1.2</span> Creation</h3>
<div id="outline-container-orgf62bdeb" class="outline-3">
<h3 id="orgf62bdeb"><span class="section-number-3">1.2</span> Creation</h3>
<div class="outline-text-3" id="text-1-2">
<p>
To create a new context, <code>qmckl_context_create()</code> should be used.
@ -549,8 +549,8 @@ To create a new context, <code>qmckl_context_create()</code> should be used.
</div>
</div>
</div>
<div id="outline-container-org45b9874" class="outline-3">
<h3 id="org45b9874"><span class="section-number-3">1.3</span> Access to the previous context</h3>
<div id="outline-container-orgf4334dc" class="outline-3">
<h3 id="orgf4334dc"><span class="section-number-3">1.3</span> Access to the previous context</h3>
<div class="outline-text-3" id="text-1-3">
<p>
<code>qmckl_context_previous</code> returns the previous context. It returns
@ -572,8 +572,8 @@ To create a new context, <code>qmckl_context_create()</code> should be used.
</div>
</div>
</div>
<div id="outline-container-org4f1dd7a" class="outline-3">
<h3 id="org4f1dd7a"><span class="section-number-3">1.4</span> Locking</h3>
<div id="outline-container-orgce0c987" class="outline-3">
<h3 id="orgce0c987"><span class="section-number-3">1.4</span> Locking</h3>
<div class="outline-text-3" id="text-1-4">
<p>
For thread safety, the context may be locked/unlocked. The lock is
@ -633,8 +633,8 @@ number of times the thread has locked it is saved in the
</div>
</div>
<div id="outline-container-orgc505719" class="outline-3">
<h3 id="orgc505719"><span class="section-number-3">1.5</span> Copy</h3>
<div id="outline-container-orge6c6240" class="outline-3">
<h3 id="orge6c6240"><span class="section-number-3">1.5</span> Copy</h3>
<div class="outline-text-3" id="text-1-5">
<p>
<code>qmckl_context_copy</code> makes a shallow copy of a context. It returns
@ -680,8 +680,8 @@ number of times the thread has locked it is saved in the
</div>
</div>
</div>
<div id="outline-container-org8dabc32" class="outline-3">
<h3 id="org8dabc32"><span class="section-number-3">1.6</span> Destroy</h3>
<div id="outline-container-orgba8e08a" class="outline-3">
<h3 id="orgba8e08a"><span class="section-number-3">1.6</span> Destroy</h3>
<div class="outline-text-3" id="text-1-6">
<p>
The context is destroyed with <code>qmckl_context_destroy</code>, leaving the ancestors untouched.
@ -736,12 +736,12 @@ It frees the context, and returns the previous context.
</div>
</div>
</div>
<div id="outline-container-org83c6d7f" class="outline-2">
<h2 id="org83c6d7f"><span class="section-number-2">2</span> Memory allocation handling</h2>
<div id="outline-container-org794c736" class="outline-2">
<h2 id="org794c736"><span class="section-number-2">2</span> Memory allocation handling</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-orgc4c4ede" class="outline-3">
<h3 id="orgc4c4ede"><span class="section-number-3">2.1</span> Data structure</h3>
<div id="outline-container-org0844de7" class="outline-3">
<h3 id="org0844de7"><span class="section-number-3">2.1</span> Data structure</h3>
<div class="outline-text-3" id="text-2-1">
<p>
Pointers to all allocated memory domains are stored in the context,
@ -750,7 +750,7 @@ computation of the amount of currently used memory by the library.
</p>
<div class="org-src-container">
<pre class="src src-c" id="org049e366"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_memory_struct</span> {
<pre class="src src-c" id="org5f9324f"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_memory_struct</span> {
<span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_memory_struct</span> * <span style="color: #a0522d;">next</span> ;
<span style="color: #228b22;">void</span> * <span style="color: #a0522d;">pointer</span> ;
<span style="color: #228b22;">size_t</span> <span style="color: #a0522d;">size</span> ;
@ -760,8 +760,8 @@ computation of the amount of currently used memory by the library.
</div>
</div>
<div id="outline-container-orgbef83e3" class="outline-3">
<h3 id="orgbef83e3"><span class="section-number-3">2.2</span> Append memory</h3>
<div id="outline-container-org1ad85ee" class="outline-3">
<h3 id="org1ad85ee"><span class="section-number-3">2.2</span> Append memory</h3>
<div class="outline-text-3" id="text-2-2">
<p>
The following function, called in <a href="./qmckl_memory.html"><code>qmckl_memory.c</code></a>, appends a new
@ -819,8 +819,8 @@ immediately with <code>QMCKL_SUCCESS</code>.
</div>
</div>
<div id="outline-container-org78687dd" class="outline-3">
<h3 id="org78687dd"><span class="section-number-3">2.3</span> Remove memory</h3>
<div id="outline-container-org1a3828e" class="outline-3">
<h3 id="org1a3828e"><span class="section-number-3">2.3</span> Remove memory</h3>
<div class="outline-text-3" id="text-2-3">
<p>
The following function, called in <a href="./qmckl_memory.html"><code>qmckl_memory.c</code></a>, removes a
@ -859,11 +859,7 @@ immediately with <code>QMCKL_SUCCESS</code>.
qmckl_unlock(context);
<span style="color: #a020f0;">if</span> (alloc != <span style="color: #008b8b;">NULL</span>) {
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
} <span style="color: #a020f0;">else</span> {
<span style="color: #a020f0;">return</span> QMCKL_DEALLOCATION_FAILED;
}
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
</pre>
</div>
@ -871,15 +867,15 @@ immediately with <code>QMCKL_SUCCESS</code>.
</div>
</div>
<div id="outline-container-orgabd4876" class="outline-2">
<h2 id="orgabd4876"><span class="section-number-2">3</span> Error handling</h2>
<div id="outline-container-org6baa1d9" class="outline-2">
<h2 id="org6baa1d9"><span class="section-number-2">3</span> Error handling</h2>
<div class="outline-text-2" id="text-3">
</div>
<div id="outline-container-org1e7b74a" class="outline-3">
<h3 id="org1e7b74a"><span class="section-number-3">3.1</span> Data structure</h3>
<div id="outline-container-org727f328" class="outline-3">
<h3 id="org727f328"><span class="section-number-3">3.1</span> Data structure</h3>
<div class="outline-text-3" id="text-3-1">
<div class="org-src-container">
<pre class="src src-c" id="org26fba74"><span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">QMCKL_MAX_FUN_LEN</span> 256
<pre class="src src-c" id="orgf4ba9b2"><span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">QMCKL_MAX_FUN_LEN</span> 256
<span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">QMCKL_MAX_MSG_LEN</span> 1024
<span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_error_struct</span> {
@ -894,8 +890,8 @@ immediately with <code>QMCKL_SUCCESS</code>.
</div>
</div>
<div id="outline-container-org2a236d9" class="outline-3">
<h3 id="org2a236d9"><span class="section-number-3">3.2</span> Updating errors</h3>
<div id="outline-container-orgaf5e190" class="outline-3">
<h3 id="orgaf5e190"><span class="section-number-3">3.2</span> Updating errors</h3>
<div class="outline-text-3" id="text-3-2">
<p>
The error is updated in the context using
@ -1044,8 +1040,8 @@ For example, this function can be used as
</div>
</div>
<div id="outline-container-org4dcb9eb" class="outline-2">
<h2 id="org4dcb9eb"><span class="section-number-2">4</span> Control of the numerical precision</h2>
<div id="outline-container-orgb1bb94e" class="outline-2">
<h2 id="orgb1bb94e"><span class="section-number-2">4</span> Control of the numerical precision</h2>
<div class="outline-text-2" id="text-4">
<p>
Controlling numerical precision enables optimizations. Here, the
@ -1053,7 +1049,7 @@ default parameters determining the target numerical precision and
range are defined.
</p>
<table id="org45e9725" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org16cf1a5" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1098,7 +1094,7 @@ range are defined.
</div>
<div class="org-src-container">
<pre class="src src-c" id="orgc8f765b"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_precision_struct</span> {
<pre class="src src-c" id="org6f36587"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_precision_struct</span> {
<span style="color: #228b22;">int</span> <span style="color: #a0522d;">precision</span>;
<span style="color: #228b22;">int</span> <span style="color: #a0522d;">range</span>;
} <span style="color: #228b22;">qmckl_precision_struct</span>;
@ -1119,8 +1115,8 @@ integer. The update functions return <code>QMCKL_SUCCESS</code> or
</p>
</div>
<div id="outline-container-org01c5d0e" class="outline-3">
<h3 id="org01c5d0e"><span class="section-number-3">4.1</span> Precision</h3>
<div id="outline-container-org6cce1e7" class="outline-3">
<h3 id="org6cce1e7"><span class="section-number-3">4.1</span> Precision</h3>
<div class="outline-text-3" id="text-4-1">
<p>
<code>qmckl_context_update_precision</code> modifies the parameter for the
@ -1240,8 +1236,8 @@ different precision parameter.
</div>
</div>
<div id="outline-container-orgcda4f1b" class="outline-3">
<h3 id="orgcda4f1b"><span class="section-number-3">4.2</span> Range</h3>
<div id="outline-container-org050dac5" class="outline-3">
<h3 id="org050dac5"><span class="section-number-3">4.2</span> Range</h3>
<div class="outline-text-3" id="text-4-2">
<p>
<code>qmckl_context_update_range</code> modifies the parameter for the numerical range in a given context.
@ -1348,8 +1344,8 @@ different precision parameter.
</div>
</div>
</div>
<div id="outline-container-org800591a" class="outline-3">
<h3 id="org800591a"><span class="section-number-3">4.3</span> Helper functions</h3>
<div id="outline-container-orge0408c5" class="outline-3">
<h3 id="orge0408c5"><span class="section-number-3">4.3</span> Helper functions</h3>
<div class="outline-text-3" id="text-4-3">
<p>
<code>qmckl_context_get_epsilon</code> returns \(\epsilon = 2^{1-n}\) where <code>n</code> is the precision.
@ -1365,8 +1361,8 @@ different precision parameter.
</div>
</div>
</div>
<div id="outline-container-org61ec0f1" class="outline-2">
<h2 id="org61ec0f1"><span class="section-number-2">5</span> <span class="todo TODO">TODO</span> Basis set</h2>
<div id="outline-container-orgeec52e9" class="outline-2">
<h2 id="orgeec52e9"><span class="section-number-2">5</span> <span class="todo TODO">TODO</span> Basis set</h2>
<div class="outline-text-2" id="text-5">
<p>
For H<sub>2</sub> with the following basis set,
@ -1413,11 +1409,11 @@ COEFFICIENT = [ 0.006068, 0.045308, 0.202822, 0.503903, 0.383421,
</pre>
</div>
<div id="outline-container-org11c949f" class="outline-3">
<h3 id="org11c949f"><span class="section-number-3">5.1</span> Data structure</h3>
<div id="outline-container-org713d98f" class="outline-3">
<h3 id="org713d98f"><span class="section-number-3">5.1</span> Data structure</h3>
<div class="outline-text-3" id="text-5-1">
<div class="org-src-container">
<pre class="src src-c" id="org26ac866"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_ao_basis_struct</span> {
<pre class="src src-c" id="orgf64d7cc"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_ao_basis_struct</span> {
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">shell_num</span>;
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">prim_num</span>;
@ -1435,8 +1431,8 @@ COEFFICIENT = [ 0.006068, 0.045308, 0.202822, 0.503903, 0.383421,
</div>
</div>
<div id="outline-container-org62a4ccd" class="outline-3">
<h3 id="org62a4ccd"><span class="section-number-3">5.2</span> <code>qmckl_context_update_ao_basis</code></h3>
<div id="outline-container-org211a794" class="outline-3">
<h3 id="org211a794"><span class="section-number-3">5.2</span> <code>qmckl_context_update_ao_basis</code></h3>
<div class="outline-text-3" id="text-5-2">
<p>
Updates the data describing the AO basis set into the context.
@ -1520,8 +1516,8 @@ Updates the data describing the AO basis set into the context.
</div>
</div>
<div id="outline-container-org909ff76" class="outline-4">
<h4 id="org909ff76"><span class="section-number-4">5.2.1</span> Source</h4>
<div id="outline-container-orgc9741c4" class="outline-4">
<h4 id="orgc9741c4"><span class="section-number-4">5.2.1</span> Source</h4>
<div class="outline-text-4" id="text-5-2-1">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
@ -1668,8 +1664,8 @@ Updates the data describing the AO basis set into the context.
</div>
</div>
<div id="outline-container-org35884b5" class="outline-4">
<h4 id="org35884b5"><span class="section-number-4">5.2.2</span> Fortran interface</h4>
<div id="outline-container-org7052863" class="outline-4">
<h4 id="org7052863"><span class="section-number-4">5.2.2</span> Fortran interface</h4>
<div class="outline-text-4" id="text-5-2-2">
<div class="org-src-container">
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
@ -1695,13 +1691,13 @@ Updates the data describing the AO basis set into the context.
</div>
</div>
<div id="outline-container-orgb373341" class="outline-4">
<h4 id="orgb373341"><span class="section-number-4">5.2.3</span> <span class="todo TODO">TODO</span> Test</h4>
<div id="outline-container-org8beb1fc" class="outline-4">
<h4 id="org8beb1fc"><span class="section-number-4">5.2.3</span> <span class="todo TODO">TODO</span> Test</h4>
</div>
</div>
<div id="outline-container-orgf72eb2a" class="outline-3">
<h3 id="orgf72eb2a"><span class="section-number-3">5.3</span> <code>qmckl_context_set_ao_basis</code></h3>
<div id="outline-container-orgd68f4f3" class="outline-3">
<h3 id="orgd68f4f3"><span class="section-number-3">5.3</span> <code>qmckl_context_set_ao_basis</code></h3>
<div class="outline-text-3" id="text-5-3">
<p>
Sets the data describing the AO basis set into the context.
@ -1780,8 +1776,8 @@ Sets the data describing the AO basis set into the context.
</div>
</div>
<div id="outline-container-orga43f1ee" class="outline-4">
<h4 id="orga43f1ee"><span class="section-number-4">5.3.1</span> Source</h4>
<div id="outline-container-org8b9d416" class="outline-4">
<h4 id="org8b9d416"><span class="section-number-4">5.3.1</span> Source</h4>
<div class="outline-text-4" id="text-5-3-1">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">qmckl_context</span>
@ -1810,8 +1806,8 @@ Sets the data describing the AO basis set into the context.
</div>
</div>
<div id="outline-container-org6ffae6d" class="outline-4">
<h4 id="org6ffae6d"><span class="section-number-4">5.3.2</span> Fortran interface</h4>
<div id="outline-container-org99b78b7" class="outline-4">
<h4 id="org99b78b7"><span class="section-number-4">5.3.2</span> Fortran interface</h4>
<div class="outline-text-4" id="text-5-3-2">
<div class="org-src-container">
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
@ -1837,15 +1833,15 @@ Sets the data describing the AO basis set into the context.
</div>
</div>
<div id="outline-container-orgbf0c658" class="outline-4">
<h4 id="orgbf0c658"><span class="section-number-4">5.3.3</span> <span class="todo TODO">TODO</span> Test</h4>
<div id="outline-container-org213f75c" class="outline-4">
<h4 id="org213f75c"><span class="section-number-4">5.3.3</span> <span class="todo TODO">TODO</span> Test</h4>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-03-28 Sun 23:18</p>
<p class="date">Created: 2021-03-28 Sun 23:40</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-03-28 Sun 23:18 -->
<!-- 2021-03-28 Sun 23:40 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Inter-particle distances</title>
@ -333,14 +333,14 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org5016c73">1. Squared distance</a>
<li><a href="#org65df30a">1. Squared distance</a>
<ul>
<li><a href="#org116046e">1.1. <code>qmckl_distance_sq</code></a>
<li><a href="#orgbd56de8">1.1. <code>qmckl_distance_sq</code></a>
<ul>
<li><a href="#orgd7bf86f">1.1.1. Requirements</a></li>
<li><a href="#org9cb72e0">1.1.2. C header</a></li>
<li><a href="#org4a84f44">1.1.3. Source</a></li>
<li><a href="#org6752097">1.1.4. Performance</a></li>
<li><a href="#org1f5c068">1.1.1. Requirements</a></li>
<li><a href="#orga04895c">1.1.2. C header</a></li>
<li><a href="#orgff832ca">1.1.3. Source</a></li>
<li><a href="#org626a84c">1.1.4. Performance</a></li>
</ul>
</li>
</ul>
@ -352,12 +352,12 @@ for the JavaScript code in this tag.
Functions for the computation of distances between particles.
</p>
<div id="outline-container-org5016c73" class="outline-2">
<h2 id="org5016c73"><span class="section-number-2">1</span> Squared distance</h2>
<div id="outline-container-org65df30a" class="outline-2">
<h2 id="org65df30a"><span class="section-number-2">1</span> Squared distance</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-org116046e" class="outline-3">
<h3 id="org116046e"><span class="section-number-3">1.1</span> <code>qmckl_distance_sq</code></h3>
<div id="outline-container-orgbd56de8" class="outline-3">
<h3 id="orgbd56de8"><span class="section-number-3">1.1</span> <code>qmckl_distance_sq</code></h3>
<div class="outline-text-3" id="text-1-1">
<p>
<code>qmckl_distance_sq</code> computes the matrix of the squared distances
@ -370,7 +370,7 @@ between all pairs of points in two sets, one point within each set:
\]
</p>
<table id="org01bacbb" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org39fb159" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -463,8 +463,8 @@ between all pairs of points in two sets, one point within each set:
</table>
</div>
<div id="outline-container-orgd7bf86f" class="outline-4">
<h4 id="orgd7bf86f"><span class="section-number-4">1.1.1</span> Requirements</h4>
<div id="outline-container-org1f5c068" class="outline-4">
<h4 id="org1f5c068"><span class="section-number-4">1.1.1</span> Requirements</h4>
<div class="outline-text-4" id="text-1-1-1">
<ul class="org-ul">
<li><code>context</code> is not <code>QMCKL_NULL_CONTEXT</code></li>
@ -482,8 +482,8 @@ between all pairs of points in two sets, one point within each set:
</div>
</div>
<div id="outline-container-org9cb72e0" class="outline-4">
<h4 id="org9cb72e0"><span class="section-number-4">1.1.2</span> C header</h4>
<div id="outline-container-orga04895c" class="outline-4">
<h4 id="orga04895c"><span class="section-number-4">1.1.2</span> C header</h4>
<div class="outline-text-4" id="text-1-1-2">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_distance_sq</span> (
@ -503,8 +503,8 @@ between all pairs of points in two sets, one point within each set:
</div>
</div>
<div id="outline-container-org4a84f44" class="outline-4">
<h4 id="org4a84f44"><span class="section-number-4">1.1.3</span> Source</h4>
<div id="outline-container-orgff832ca" class="outline-4">
<h4 id="orgff832ca"><span class="section-number-4">1.1.3</span> Source</h4>
<div class="outline-text-4" id="text-1-1-3">
<div class="org-src-container">
<pre class="src src-f90"><span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">qmckl_distance_sq_f</span><span style="color: #000000; background-color: #ffffff;">(context, transa, transb, m, n, A, LDA, B, LDB, C, LDC) result(info)</span>
@ -637,8 +637,8 @@ between all pairs of points in two sets, one point within each set:
</div>
</div>
<div id="outline-container-org6752097" class="outline-4">
<h4 id="org6752097"><span class="section-number-4">1.1.4</span> Performance</h4>
<div id="outline-container-org626a84c" class="outline-4">
<h4 id="org626a84c"><span class="section-number-4">1.1.4</span> Performance</h4>
<div class="outline-text-4" id="text-1-1-4">
<p>
This function might be more efficient when <code>A</code> and <code>B</code> are
@ -651,7 +651,7 @@ transposed.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-03-28 Sun 23:18</p>
<p class="date">Created: 2021-03-28 Sun 23:40</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-03-28 Sun 23:18 -->
<!-- 2021-03-28 Sun 23:40 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Error handling</title>
@ -311,14 +311,14 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org6363679"></a></li>
<li><a href="#orgd7973f6"></a></li>
</ul>
</div>
</div>
<div id="outline-container-org6363679" class="outline-2">
<h2 id="org6363679"></h2>
<div class="outline-text-2" id="text-org6363679">
<div id="outline-container-orgd7973f6" class="outline-2">
<h2 id="orgd7973f6"></h2>
<div class="outline-text-2" id="text-orgd7973f6">
<p>
The library should never make the calling programs abort, nor
perform any input/output operations. This decision has to be taken
@ -329,7 +329,7 @@ by the developer of the code calling the library.
All the functions return with an exit code, defined as
</p>
<div class="org-src-container">
<pre class="src src-c" id="orga46fae3"><span style="color: #a020f0;">typedef</span> <span style="color: #228b22;">int32_t</span> <span style="color: #228b22;">qmckl_exit_code</span>;
<pre class="src src-c" id="org6cac882"><span style="color: #a020f0;">typedef</span> <span style="color: #228b22;">int32_t</span> <span style="color: #228b22;">qmckl_exit_code</span>;
</pre>
</div>
@ -345,7 +345,7 @@ error code is returned to the program.
Here is the complete list of exit codes.
</p>
<table id="org9825e0c" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgd252c8d" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -483,67 +483,72 @@ The text strings are extracted from the previous table.
</p>
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">void</span> <span style="color: #0000ff;">qmckl_string_of_error</span>(<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #a0522d;">error</span>, <span style="color: #228b22;">char</span> <span style="color: #a0522d;">string</span>[128]) {
<pre class="src src-c"><span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span>* <span style="color: #0000ff;">qmckl_string_of_error</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #a0522d;">error</span>) {
<span style="color: #a020f0;">switch</span> (error) {
<span style="color: #a020f0;">case</span> QMCKL_SUCCESS:
strncpy(string,<span style="color: #8b2252;">"Success"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Success"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_ARG_1:
strncpy(string,<span style="color: #8b2252;">"Invalid argument 1"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid argument 1"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_ARG_2:
strncpy(string,<span style="color: #8b2252;">"Invalid argument 2"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid argument 2"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_ARG_3:
strncpy(string,<span style="color: #8b2252;">"Invalid argument 3"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid argument 3"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_ARG_4:
strncpy(string,<span style="color: #8b2252;">"Invalid argument 4"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid argument 4"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_ARG_5:
strncpy(string,<span style="color: #8b2252;">"Invalid argument 5"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid argument 5"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_ARG_6:
strncpy(string,<span style="color: #8b2252;">"Invalid argument 6"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid argument 6"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_ARG_7:
strncpy(string,<span style="color: #8b2252;">"Invalid argument 7"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid argument 7"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_ARG_8:
strncpy(string,<span style="color: #8b2252;">"Invalid argument 8"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid argument 8"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_ARG_9:
strncpy(string,<span style="color: #8b2252;">"Invalid argument 9"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid argument 9"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_ARG_10:
strncpy(string,<span style="color: #8b2252;">"Invalid argument 10"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid argument 10"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_FAILURE:
strncpy(string,<span style="color: #8b2252;">"Failure"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Failure"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_ERRNO:
strncpy(string,strerror(errno),128);
<span style="color: #a020f0;">return</span> strerror(errno);
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_CONTEXT:
strncpy(string,<span style="color: #8b2252;">"Invalid context"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid context"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_ALLOCATION_FAILED:
strncpy(string,<span style="color: #8b2252;">"Allocation failed"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Allocation failed"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_DEALLOCATION_FAILED:
strncpy(string,<span style="color: #8b2252;">"De-allocation failed"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"De-allocation failed"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> QMCKL_INVALID_EXIT_CODE:
strncpy(string,<span style="color: #8b2252;">"Invalid exit code"</span>,128);
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid exit code"</span>;
<span style="color: #a020f0;">break</span>;
}
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Unknown error"</span>;
}
<span style="color: #228b22;">void</span> <span style="color: #0000ff;">qmckl_string_of_error_f</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #a0522d;">error</span>, <span style="color: #228b22;">char</span> <span style="color: #a0522d;">result</span>[128]) {
strncpy(result, qmckl_string_of_error(error), 128);
}
</pre>
</div>
<div class="org-src-container">
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
<span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">qmckl_string_of_error</span> (error, string) <span style="color: #a020f0;">bind</span>(C)
<span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">qmckl_string_of_error</span> (error, string) <span style="color: #a020f0;">bind</span>(C, name=<span style="color: #8b2252;">'qmckl_string_of_error_f'</span>)
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> error</span>
<span style="color: #228b22;">character</span>, <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> string(128)</span>
@ -556,7 +561,7 @@ The text strings are extracted from the previous table.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-03-28 Sun 23:18</p>
<p class="date">Created: 2021-03-28 Sun 23:40</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-03-28 Sun 23:18 -->
<!-- 2021-03-28 Sun 23:40 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Memory management</title>
@ -311,7 +311,7 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org2130623"></a></li>
<li><a href="#orga97b5ff"></a></li>
</ul>
</div>
</div>
@ -321,9 +321,9 @@ optimized libraries to fine-tune the memory allocation.
</p>
<div id="outline-container-org2130623" class="outline-2">
<h2 id="org2130623"></h2>
<div class="outline-text-2" id="text-org2130623">
<div id="outline-container-orga97b5ff" class="outline-2">
<h2 id="orga97b5ff"></h2>
<div class="outline-text-2" id="text-orga97b5ff">
<p>
Memory allocation inside the library should be done with
<code>qmckl_malloc</code>. It lets the library choose how the memory will be
@ -434,7 +434,7 @@ allocation and needs to be updated.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-03-28 Sun 23:18</p>
<p class="date">Created: 2021-03-28 Sun 23:40</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-03-28 Sun 23:18 -->
<!-- 2021-03-28 Sun 23:40 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Testing</title>
@ -311,7 +311,7 @@ for the JavaScript code in this tag.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-03-28 Sun 23:18</p>
<p class="date">Created: 2021-03-28 Sun 23:40</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>