1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-27 06:43:54 +01:00

Deploying to gh-pages from @ TREX-CoE/trexio@cdf25b4162 🚀

This commit is contained in:
q-posev 2021-06-14 07:35:37 +00:00
parent 202d8a71e2
commit 9d1ffc4cb6
5 changed files with 254 additions and 167 deletions

View File

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

View File

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

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-06-11 Fri 07:56 --> <!-- 2021-06-14 Mon 07:35 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Front end API</title> <title>Front end API</title>
@ -333,47 +333,47 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org791a8bf">1. Coding conventions</a> <li><a href="#org3d5df02">1. Coding conventions</a>
<ul> <ul>
<li><a href="#org54fd71a">1.1. Memory allocation</a></li> <li><a href="#org5966aa6">1.1. Memory allocation</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org27f6370">2. Front end</a> <li><a href="#orgc7d47d1">2. Front end</a>
<ul> <ul>
<li><a href="#org36fea46">2.1. Error handling</a></li> <li><a href="#orga317a90">2.1. Error handling</a></li>
<li><a href="#org007279b">2.2. Back ends</a></li> <li><a href="#org3bf5622">2.2. Back ends</a></li>
<li><a href="#orga786c63">2.3. Read/write behavior</a></li> <li><a href="#orga9d8d69">2.3. Read/write behavior</a></li>
<li><a href="#org4f864c4">2.4. TREXIO file type</a></li> <li><a href="#org0267417">2.4. TREXIO file type</a></li>
<li><a href="#orgb87fc76">2.5. Polymorphism of the file handle</a></li> <li><a href="#org09d3626">2.5. Polymorphism of the file handle</a></li>
<li><a href="#org6e59314">2.6. File opening</a></li> <li><a href="#org1510450">2.6. File opening</a></li>
<li><a href="#orgf74d7b8">2.7. File closing</a></li> <li><a href="#orgd51fe56">2.7. File closing</a></li>
<li><a href="#org7ca1b82">2.8. C helper functions</a></li> <li><a href="#org5dab63f">2.8. C helper functions</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orga16c9a5">3. Templates for front end</a> <li><a href="#orgef94619">3. Templates for front end</a>
<ul> <ul>
<li><a href="#org7897095">3.1. Templates for front end has/read/write a dimension</a> <li><a href="#org1971903">3.1. Templates for front end has/read/write a dimension</a>
<ul> <ul>
<li><a href="#orgfa59599">3.1.1. C templates for front end</a></li> <li><a href="#orgf00a762">3.1.1. C templates for front end</a></li>
<li><a href="#org3d8fe6c">3.1.2. Fortran templates for front end</a></li> <li><a href="#org6951827">3.1.2. Fortran templates for front end</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgefe2014">3.2. Templates for front end has/read/write a dataset</a> <li><a href="#orgd0d1572">3.2. Templates for front end has/read/write a dataset</a>
<ul> <ul>
<li><a href="#orgf9cfc2a">3.2.1. C templates for front end</a></li> <li><a href="#orge807969">3.2.1. C templates for front end</a></li>
<li><a href="#org5337118">3.2.2. Fortran templates for front end</a></li> <li><a href="#org02cecf6">3.2.2. Fortran templates for front end</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org2c4c231">3.3. Sparse data structures</a></li> <li><a href="#org9c39ef1">3.3. Sparse data structures</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgcf54da9">4. Fortran helper/wrapper functions</a></li> <li><a href="#orgd79bc70">4. Fortran helper/wrapper functions</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<div id="outline-container-org791a8bf" class="outline-2"> <div id="outline-container-org3d5df02" class="outline-2">
<h2 id="org791a8bf"><span class="section-number-2">1</span> Coding conventions</h2> <h2 id="org3d5df02"><span class="section-number-2">1</span> Coding conventions</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<ul class="org-ul"> <ul class="org-ul">
<li>integer types will be defined using types given in <code>stdint.h</code></li> <li>integer types will be defined using types given in <code>stdint.h</code></li>
@ -388,8 +388,8 @@ for the JavaScript code in this tag.
</ul> </ul>
</div> </div>
<div id="outline-container-org54fd71a" class="outline-3"> <div id="outline-container-org5966aa6" class="outline-3">
<h3 id="org54fd71a"><span class="section-number-3">1.1</span> Memory allocation</h3> <h3 id="org5966aa6"><span class="section-number-3">1.1</span> Memory allocation</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<p> <p>
Memory allocation of structures can be facilitated by using the Memory allocation of structures can be facilitated by using the
@ -424,8 +424,8 @@ The maximum string size for the filenames is 4096 characters.
</div> </div>
</div> </div>
<div id="outline-container-org27f6370" class="outline-2"> <div id="outline-container-orgc7d47d1" class="outline-2">
<h2 id="org27f6370"><span class="section-number-2">2</span> Front end</h2> <h2 id="orgc7d47d1"><span class="section-number-2">2</span> Front end</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p> <p>
All calls to TREXIO are thread-safe. All calls to TREXIO are thread-safe.
@ -433,10 +433,10 @@ TREXIO front end is modular, which simplifies implementation of new back ends.
</p> </p>
</div> </div>
<div id="outline-container-org36fea46" class="outline-3"> <div id="outline-container-orga317a90" class="outline-3">
<h3 id="org36fea46"><span class="section-number-3">2.1</span> Error handling</h3> <h3 id="orga317a90"><span class="section-number-3">2.1</span> Error handling</h3>
<div class="outline-text-3" id="text-2-1"> <div class="outline-text-3" id="text-2-1">
<table id="orgada4f0c" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgca5e553" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -727,8 +727,8 @@ The text strings are extracted from the previous table.
</div> </div>
</div> </div>
<div id="outline-container-org007279b" class="outline-3"> <div id="outline-container-org3bf5622" class="outline-3">
<h3 id="org007279b"><span class="section-number-3">2.2</span> Back ends</h3> <h3 id="org3bf5622"><span class="section-number-3">2.2</span> Back ends</h3>
<div class="outline-text-3" id="text-2-2"> <div class="outline-text-3" id="text-2-2">
<p> <p>
TREXIO has several back ends: TREXIO has several back ends:
@ -758,8 +758,8 @@ lines that correspond to the <code>TREXIO_JSON</code> back end (not implemented
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orga786c63" class="outline-3"> <div id="outline-container-orga9d8d69" class="outline-3">
<h3 id="orga786c63"><span class="section-number-3">2.3</span> Read/write behavior</h3> <h3 id="orga9d8d69"><span class="section-number-3">2.3</span> Read/write behavior</h3>
<div class="outline-text-3" id="text-2-3"> <div class="outline-text-3" id="text-2-3">
<p> <p>
Every time a reading function is called, the data is read from the Every time a reading function is called, the data is read from the
@ -787,8 +787,8 @@ concurrent programs, the behavior is not specified.
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org4f864c4" class="outline-3"> <div id="outline-container-org0267417" class="outline-3">
<h3 id="org4f864c4"><span class="section-number-3">2.4</span> TREXIO file type</h3> <h3 id="org0267417"><span class="section-number-3">2.4</span> TREXIO file type</h3>
<div class="outline-text-3" id="text-2-4"> <div class="outline-text-3" id="text-2-4">
<p> <p>
<code>trexio_s</code> is the the main type for TREXIO files, visible to the users <code>trexio_s</code> is the the main type for TREXIO files, visible to the users
@ -810,18 +810,19 @@ TREXIO files will have as a first argument the TREXIO file handle.
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">struct</span> <span style="color: #228b22;">trexio_s</span> { <pre class="src src-c"><span style="color: #a020f0;">struct</span> <span style="color: #228b22;">trexio_s</span> {
<span style="color: #228b22;">char</span>* <span style="color: #a0522d;">file_name</span>; <span style="color: #228b22;">char</span> <span style="color: #a0522d;">file_name</span>[TREXIO_MAX_FILENAME_LENGTH];
<span style="color: #228b22;">pthread_mutex_t</span> <span style="color: #a0522d;">thread_lock</span>; <span style="color: #228b22;">pthread_mutex_t</span> <span style="color: #a0522d;">thread_lock</span>;
<span style="color: #228b22;">back_end_t</span> <span style="color: #a0522d;">back_end</span>; <span style="color: #228b22;">back_end_t</span> <span style="color: #a0522d;">back_end</span>;
<span style="color: #228b22;">char</span> <span style="color: #a0522d;">mode</span>; <span style="color: #228b22;">char</span> <span style="color: #a0522d;">mode</span>;
<span style="color: #228b22;">char</span> <span style="color: #a0522d;">padding</span>[7]; /* <span style="color: #b22222;">Ensures the proper alignment of back ends </span>*/ <span style="color: #228b22;">bool</span> <span style="color: #a0522d;">one_based</span>;
<span style="color: #228b22;">char</span> <span style="color: #a0522d;">padding</span>[6]; /* <span style="color: #b22222;">Ensures the proper alignment of back ends </span>*/
}; };
</pre> </pre>
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgb87fc76" class="outline-3"> <div id="outline-container-org09d3626" class="outline-3">
<h3 id="orgb87fc76"><span class="section-number-3">2.5</span> Polymorphism of the file handle</h3> <h3 id="org09d3626"><span class="section-number-3">2.5</span> Polymorphism of the file handle</h3>
<div class="outline-text-3" id="text-2-5"> <div class="outline-text-3" id="text-2-5">
<p> <p>
Polymorphism of the <code>trexio_t</code> type is handled by ensuring that the Polymorphism of the <code>trexio_t</code> type is handled by ensuring that the
@ -840,8 +841,8 @@ corresponding types for all back ends can be safely casted to
</div> </div>
</div> </div>
<div id="outline-container-org6e59314" class="outline-3"> <div id="outline-container-org1510450" class="outline-3">
<h3 id="org6e59314"><span class="section-number-3">2.6</span> File opening</h3> <h3 id="org1510450"><span class="section-number-3">2.6</span> File opening</h3>
<div class="outline-text-3" id="text-2-6"> <div class="outline-text-3" id="text-2-6">
<p> <p>
<code>trexio_open</code> creates a new TREXIO file or opens existing one. <code>trexio_open</code> creates a new TREXIO file or opens existing one.
@ -870,11 +871,13 @@ output:
</p> </p>
<p> <p>
Note: the <code>file_name</code> in TEXT back end actually corresponds to the name of the folder where <code>.txt</code> Note: the <code>file_name</code> in TEXT back end actually corresponds to the
data files are stored. The actual name of each <code>.txt</code> file corresponds to the group name provided in name of the directory where <code>.txt</code> data files are stored. The
<code>trex.config</code> (e.g. <code>nucleus.txt</code> for nuclei-related data). actual name of each <code>.txt</code> file corresponds to the group name
These names are populated by the generator.py (i.e. they are hard-coded), which is why the user provided in <code>trex.config</code> (e.g. <code>nucleus.txt</code> for nuclei-related
should tend to avoid renaming the <code>.txt</code> data files. data). These names are populated by the generator.py (i.e. they
are hard-coded), which is why the user should tend to avoid
renaming the <code>.txt</code> data files.
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
@ -918,16 +921,15 @@ should tend to avoid renaming the <code>.txt</code> data files.
/* <span style="color: #b22222;">Data for the parent type </span>*/ /* <span style="color: #b22222;">Data for the parent type </span>*/
result-&gt;file_name = CALLOC(TREXIO_MAX_FILENAME_LENGTH, <span style="color: #228b22;">char</span>);
strncpy(result-&gt;file_name, file_name, TREXIO_MAX_FILENAME_LENGTH); strncpy(result-&gt;file_name, file_name, TREXIO_MAX_FILENAME_LENGTH);
<span style="color: #a020f0;">if</span> (result-&gt;file_name[TREXIO_MAX_FILENAME_LENGTH-1] != <span style="color: #8b2252;">'\0'</span>) { <span style="color: #a020f0;">if</span> (result-&gt;file_name[TREXIO_MAX_FILENAME_LENGTH-1] != <span style="color: #8b2252;">'\0'</span>) {
free(result-&gt;file_name);
free(result); free(result);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>; <span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
} }
result-&gt;back_end = back_end; result-&gt;back_end = back_end;
result-&gt;mode = mode; result-&gt;mode = mode;
result-&gt;one_based = <span style="color: #008b8b;">false</span>; // <span style="color: #b22222;">Need to be flipped in Fortran interface</span>
<span style="color: #228b22;">int</span> <span style="color: #a0522d;">irc</span> = pthread_mutex_init ( &amp;(result-&gt;thread_lock), <span style="color: #008b8b;">NULL</span>); <span style="color: #228b22;">int</span> <span style="color: #a0522d;">irc</span> = pthread_mutex_init ( &amp;(result-&gt;thread_lock), <span style="color: #008b8b;">NULL</span>);
assert (irc == 0); assert (irc == 0);
@ -954,7 +956,6 @@ should tend to avoid renaming the <code>.txt</code> data files.
} }
<span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) { <span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) {
free(result-&gt;file_name);
free(result); free(result);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>; <span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
} }
@ -980,7 +981,6 @@ should tend to avoid renaming the <code>.txt</code> data files.
} }
<span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) { <span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) {
free(result-&gt;file_name);
free(result); free(result);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>; <span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
} }
@ -1002,11 +1002,39 @@ should tend to avoid renaming the <code>.txt</code> data files.
<span style="color: #a020f0;">end interface</span> <span style="color: #a020f0;">end interface</span>
</pre> </pre>
</div> </div>
<p>
Because arrays are zero-based in Fortran, we need to set a flag to
know if we need to shift by 1 arrays of indices.
</p>
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <span style="color: #0000ff;">trexio_set_one_based</span>(<span style="color: #228b22;">trexio_t</span>* <span style="color: #a0522d;">file</span>)
{
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>)
<span style="color: #a020f0;">return</span> TREXIO_FILE_ERROR;
file-&gt;one_based = <span style="color: #008b8b;">true</span>;
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
}
</pre>
</div>
<div class="org-src-container">
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
<span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">trexio_set_one_based</span><span style="color: #000000; background-color: #ffffff;">(trex_file) bind(C)</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>(8), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> trex_file</span>
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_set_one_based</span>
<span style="color: #a020f0;">end interface</span>
</pre>
</div>
</div> </div>
</div> </div>
<div id="outline-container-orgf74d7b8" class="outline-3"> <div id="outline-container-orgd51fe56" class="outline-3">
<h3 id="orgf74d7b8"><span class="section-number-3">2.7</span> File closing</h3> <h3 id="orgd51fe56"><span class="section-number-3">2.7</span> File closing</h3>
<div class="outline-text-3" id="text-2-7"> <div class="outline-text-3" id="text-2-7">
<p> <p>
<code>trexio_close</code> closes an existing <code>trexio_t</code> file. <code>trexio_close</code> closes an existing <code>trexio_t</code> file.
@ -1051,7 +1079,6 @@ output:
} }
<span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) { <span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) {
FREE(file-&gt;file_name);
FREE(file); FREE(file);
<span style="color: #a020f0;">return</span> rc; <span style="color: #a020f0;">return</span> rc;
} }
@ -1078,8 +1105,6 @@ output:
/* <span style="color: #b22222;">Terminate front end </span>*/ /* <span style="color: #b22222;">Terminate front end </span>*/
FREE(file-&gt;file_name);
<span style="color: #228b22;">int</span> <span style="color: #a0522d;">irc</span> = pthread_mutex_destroy( &amp;(file-&gt;thread_lock) ); <span style="color: #228b22;">int</span> <span style="color: #a0522d;">irc</span> = pthread_mutex_destroy( &amp;(file-&gt;thread_lock) );
free(file); free(file);
@ -1104,8 +1129,8 @@ output:
</div> </div>
</div> </div>
<div id="outline-container-org7ca1b82" class="outline-3"> <div id="outline-container-org5dab63f" class="outline-3">
<h3 id="org7ca1b82"><span class="section-number-3">2.8</span> C helper functions</h3> <h3 id="org5dab63f"><span class="section-number-3">2.8</span> C helper functions</h3>
<div class="outline-text-3" id="text-2-8"> <div class="outline-text-3" id="text-2-8">
<p> <p>
#+begin<sub>src</sub> c :tangle prefix<sub>front.c</sub> #+begin<sub>src</sub> c :tangle prefix<sub>front.c</sub>
@ -1143,8 +1168,8 @@ for (int i=0; i&lt;str<sub>max</sub><sub>num</sub>; i++){
</div> </div>
</div> </div>
<div id="outline-container-orga16c9a5" class="outline-2"> <div id="outline-container-orgef94619" class="outline-2">
<h2 id="orga16c9a5"><span class="section-number-2">3</span> Templates for front end</h2> <h2 id="orgef94619"><span class="section-number-2">3</span> Templates for front end</h2>
<div class="outline-text-2" id="text-3"> <div class="outline-text-2" id="text-3">
<p> <p>
Consider the following block of <code>trex.json</code>: Consider the following block of <code>trex.json</code>:
@ -1333,8 +1358,8 @@ or double precision for integer and floating point numbers.
</p> </p>
</div> </div>
<div id="outline-container-org7897095" class="outline-3"> <div id="outline-container-org1971903" class="outline-3">
<h3 id="org7897095"><span class="section-number-3">3.1</span> Templates for front end has/read/write a dimension</h3> <h3 id="org1971903"><span class="section-number-3">3.1</span> Templates for front end has/read/write a dimension</h3>
<div class="outline-text-3" id="text-3-1"> <div class="outline-text-3" id="text-3-1">
<p> <p>
This section concerns API calls related to dimensioning variables. This section concerns API calls related to dimensioning variables.
@ -1403,8 +1428,8 @@ This section concerns API calls related to dimensioning variables.
</table> </table>
</div> </div>
<div id="outline-container-orgfa59599" class="outline-4"> <div id="outline-container-orgf00a762" class="outline-4">
<h4 id="orgfa59599"><span class="section-number-4">3.1.1</span> C templates for front end</h4> <h4 id="orgf00a762"><span class="section-number-4">3.1.1</span> C templates for front end</h4>
<div class="outline-text-4" id="text-3-1-1"> <div class="outline-text-4" id="text-3-1-1">
<p> <p>
The <code>C</code> templates that correspond to each of the abovementioned The <code>C</code> templates that correspond to each of the abovementioned
@ -1599,8 +1624,8 @@ precision (see Table above).
</div> </div>
</div> </div>
<div id="outline-container-org3d8fe6c" class="outline-4"> <div id="outline-container-org6951827" class="outline-4">
<h4 id="org3d8fe6c"><span class="section-number-4">3.1.2</span> Fortran templates for front end</h4> <h4 id="org6951827"><span class="section-number-4">3.1.2</span> Fortran templates for front end</h4>
<div class="outline-text-4" id="text-3-1-2"> <div class="outline-text-4" id="text-3-1-2">
<p> <p>
The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from Fortran. The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from Fortran.
@ -1686,8 +1711,8 @@ These templates are based on the use of <code>iso_c_binding</code>. Pointers hav
</div> </div>
</div> </div>
<div id="outline-container-orgefe2014" class="outline-3"> <div id="outline-container-orgd0d1572" class="outline-3">
<h3 id="orgefe2014"><span class="section-number-3">3.2</span> Templates for front end has/read/write a dataset</h3> <h3 id="orgd0d1572"><span class="section-number-3">3.2</span> Templates for front end has/read/write a dataset</h3>
<div class="outline-text-3" id="text-3-2"> <div class="outline-text-3" id="text-3-2">
<p> <p>
This section concerns API calls related to datasets. This section concerns API calls related to datasets.
@ -1756,8 +1781,8 @@ This section concerns API calls related to datasets.
</table> </table>
</div> </div>
<div id="outline-container-orgf9cfc2a" class="outline-4"> <div id="outline-container-orge807969" class="outline-4">
<h4 id="orgf9cfc2a"><span class="section-number-4">3.2.1</span> C templates for front end</h4> <h4 id="orge807969"><span class="section-number-4">3.2.1</span> C templates for front end</h4>
<div class="outline-text-4" id="text-3-2-1"> <div class="outline-text-4" id="text-3-2-1">
<p> <p>
The C templates that correspond to each of the abovementioned functions can be found below. The C templates that correspond to each of the abovementioned functions can be found below.
@ -1781,6 +1806,7 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
/* <span style="color: #b22222;">Error handling for this call is added by the generator </span>*/ /* <span style="color: #b22222;">Error handling for this call is added by the generator </span>*/
rc = trexio_read_$group_dset_dim$_64(file, &amp;($group_dset_dim$)); rc = trexio_read_$group_dset_dim$_64(file, &amp;($group_dset_dim$));
<span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc;
<span style="color: #a020f0;">if</span> ($group_dset_dim$ == 0L) <span style="color: #a020f0;">return</span> TREXIO_INVALID_NUM; <span style="color: #a020f0;">if</span> ($group_dset_dim$ == 0L) <span style="color: #a020f0;">return</span> TREXIO_INVALID_NUM;
@ -1789,22 +1815,36 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END); assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END);
rc = TREXIO_FAILURE;
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) { <span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
<span style="color: #a020f0;">case</span> TREXIO_TEXT: <span style="color: #a020f0;">case</span> TREXIO_TEXT:
<span style="color: #a020f0;">return</span> trexio_text_read_$group_dset$(file, $group_dset$, rank, dims); rc = trexio_text_read_$group_dset$(file, $group_dset$, rank, dims);
<span style="color: #a020f0;">break</span>; <span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_HDF5: <span style="color: #a020f0;">case</span> TREXIO_HDF5:
<span style="color: #a020f0;">return</span> trexio_hdf5_read_$group_dset$(file, $group_dset$, rank, dims); rc = trexio_hdf5_read_$group_dset$(file, $group_dset$, rank, dims);
<span style="color: #a020f0;">break</span>; <span style="color: #a020f0;">break</span>;
/* /*
<span style="color: #b22222;"> case TREXIO_JSON:</span> <span style="color: #b22222;"> case TREXIO_JSON:</span>
<span style="color: #b22222;"> return trexio_json_read_$group_dset$(file, $group_dset$, rank, dims);</span> <span style="color: #b22222;"> rc = trexio_json_read_$group_dset$(file, $group_dset$, rank, dims);</span>
<span style="color: #b22222;"> break;</span> <span style="color: #b22222;"> break;</span>
*/ */
} }
<span style="color: #a020f0;">return</span> TREXIO_FAILURE; <span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc;
/* <span style="color: #b22222;">Handle index type </span>*/
<span style="color: #a020f0;">if</span> ($is_index$) {
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dim_size</span> = 1;
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;rank; ++i){
dim_size *= dims[i];
}
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;dim_size; ++i){
$group_dset$[i] += ($group_dset_dtype_single$) 1;
}
}
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} }
</pre> </pre>
</div> </div>
@ -1823,30 +1863,56 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
/* <span style="color: #b22222;">Error handling for this call is added by the generator </span>*/ /* <span style="color: #b22222;">Error handling for this call is added by the generator </span>*/
rc = trexio_read_$group_dset_dim$_64(file, &amp;($group_dset_dim$)); rc = trexio_read_$group_dset_dim$_64(file, &amp;($group_dset_dim$));
<span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc;
<span style="color: #a020f0;">if</span> ($group_dset_dim$ == 0L) <span style="color: #a020f0;">return</span> TREXIO_INVALID_NUM; <span style="color: #a020f0;">if</span> ($group_dset_dim$ == 0L) <span style="color: #a020f0;">return</span> TREXIO_INVALID_NUM;
<span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">rank</span> = $group_dset_rank$; <span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">rank</span> = $group_dset_rank$;
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dims</span>[$group_dset_rank$] = {$group_dset_dim_list$}; <span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dims</span>[$group_dset_rank$] = {$group_dset_dim_list$};
$group_dset_dtype_double$* $group_dset$_p = $group_dset$;
/* <span style="color: #b22222;">Handle index type </span>*/
<span style="color: #a020f0;">if</span> ($is_index$) {
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dim_size</span> = 1;
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;rank; ++i){
dim_size *= dims[i];
}
$group_dset$_p = CALLOC(dim_size, $group_dset_dtype_double$);
<span style="color: #a020f0;">if</span> ($group_dset$_p == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_ALLOCATION_FAILED;
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;dim_size; ++i){
$group_dset$_p[i] = $group_dset$_p[i] - ($group_dset_dtype_single$) 1;
}
}
assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END); assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END);
rc = TREXIO_FAILURE;
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) { <span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
<span style="color: #a020f0;">case</span> TREXIO_TEXT: <span style="color: #a020f0;">case</span> TREXIO_TEXT:
<span style="color: #a020f0;">return</span> trexio_text_write_$group_dset$(file, $group_dset$, rank, dims); rc = trexio_text_write_$group_dset$(file, $group_dset$_p, rank, dims);
<span style="color: #a020f0;">break</span>; <span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_HDF5: <span style="color: #a020f0;">case</span> TREXIO_HDF5:
<span style="color: #a020f0;">return</span> trexio_hdf5_write_$group_dset$(file, $group_dset$, rank, dims); rc = trexio_hdf5_write_$group_dset$(file, $group_dset$_p, rank, dims);
<span style="color: #a020f0;">break</span>; <span style="color: #a020f0;">break</span>;
/* /*
<span style="color: #b22222;"> case TREXIO_JSON:</span> <span style="color: #b22222;"> case TREXIO_JSON:</span>
<span style="color: #b22222;"> return trexio_json_write_$group_dset$(file, $group_dset$, rank, dims);</span> <span style="color: #b22222;"> rc = trexio_json_write_$group_dset$(file, $group_dset$_p, rank, dims);</span>
<span style="color: #b22222;"> break;</span> <span style="color: #b22222;"> break;</span>
*/ */
} }
<span style="color: #a020f0;">return</span> TREXIO_FAILURE;
/* <span style="color: #b22222;">Handle index type </span>*/
<span style="color: #a020f0;">if</span> ($is_index$) {
FREE($group_dset$_p);
}
<span style="color: #a020f0;">return</span> rc;
} }
</pre> </pre>
</div> </div>
@ -1871,7 +1937,7 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dims</span>[$group_dset_rank$] = {$group_dset_dim_list$}; <span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dims</span>[$group_dset_rank$] = {$group_dset_dim_list$};
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dim_size</span> = 1; <span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dim_size</span> = 1;
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">unsigned</span> <span style="color: #228b22;">int</span> <span style="color: #a0522d;">i</span>=0; i&lt;rank; ++i){ <span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;rank; ++i){
dim_size *= dims[i]; dim_size *= dims[i];
} }
@ -1903,9 +1969,15 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<span style="color: #a020f0;">return</span> rc; <span style="color: #a020f0;">return</span> rc;
} }
<span style="color: #a020f0;">if</span> ($is_index$) {
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;dim_size; ++i){
$group_dset$[i] = ($group_dset_dtype_single$) $group_dset$_64[i] + ($group_dset_dtype_single$) 1;
}
} <span style="color: #a020f0;">else</span> {
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;dim_size; ++i){ <span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;dim_size; ++i){
$group_dset$[i] = ($group_dset_dtype_single$) $group_dset$_64[i]; $group_dset$[i] = ($group_dset_dtype_single$) $group_dset$_64[i];
} }
}
FREE($group_dset$_64); FREE($group_dset$_64);
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS; <span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
@ -1934,7 +2006,7 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dims</span>[$group_dset_rank$] = {$group_dset_dim_list$}; <span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dims</span>[$group_dset_rank$] = {$group_dset_dim_list$};
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dim_size</span> = 1; <span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dim_size</span> = 1;
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">unsigned</span> <span style="color: #228b22;">int</span> <span style="color: #a0522d;">i</span>=0; i&lt;rank; ++i){ <span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;rank; ++i){
dim_size *= dims[i]; dim_size *= dims[i];
} }
@ -1942,9 +2014,15 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<span style="color: #a020f0;">if</span> ($group_dset$_64 == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_ALLOCATION_FAILED; <span style="color: #a020f0;">if</span> ($group_dset$_64 == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_ALLOCATION_FAILED;
/* <span style="color: #b22222;">A type conversion from single precision to double reqired since back end only accepts 64-bit data </span>*/ /* <span style="color: #b22222;">A type conversion from single precision to double reqired since back end only accepts 64-bit data </span>*/
<span style="color: #a020f0;">if</span> ($is_index$) {
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;dim_size; ++i){
$group_dset$_64[i] = ($group_dset_dtype_double$) $group_dset$[i] - ($group_dset_dtype_double$) 1;
}
} <span style="color: #a020f0;">else</span> {
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;dim_size; ++i){ <span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">i</span>=0; i&lt;dim_size; ++i){
$group_dset$_64[i] = ($group_dset_dtype_double$) $group_dset$[i]; $group_dset$_64[i] = ($group_dset_dtype_double$) $group_dset$[i];
} }
}
assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END); assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END);
@ -2023,8 +2101,8 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
</div> </div>
</div> </div>
<div id="outline-container-org5337118" class="outline-4"> <div id="outline-container-org02cecf6" class="outline-4">
<h4 id="org5337118"><span class="section-number-4">3.2.2</span> Fortran templates for front end</h4> <h4 id="org02cecf6"><span class="section-number-4">3.2.2</span> Fortran templates for front end</h4>
<div class="outline-text-4" id="text-3-2-2"> <div class="outline-text-4" id="text-3-2-2">
<p> <p>
The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from <code>Fortran</code>. The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from <code>Fortran</code>.
@ -2110,8 +2188,8 @@ These templates are based on the use of <code>iso_c_binding</code>. Pointers hav
</div> </div>
</div> </div>
<div id="outline-container-org2c4c231" class="outline-3"> <div id="outline-container-org9c39ef1" class="outline-3">
<h3 id="org2c4c231"><span class="section-number-3">3.3</span> Sparse data structures</h3> <h3 id="org9c39ef1"><span class="section-number-3">3.3</span> Sparse data structures</h3>
<div class="outline-text-3" id="text-3-3"> <div class="outline-text-3" id="text-3-3">
<p> <p>
Sparse data structures are used typically for large tensors such as Sparse data structures are used typically for large tensors such as
@ -2253,8 +2331,8 @@ For the values,
</div> </div>
</div> </div>
<div id="outline-container-orgcf54da9" class="outline-2"> <div id="outline-container-orgd79bc70" class="outline-2">
<h2 id="orgcf54da9"><span class="section-number-2">4</span> Fortran helper/wrapper functions</h2> <h2 id="orgd79bc70"><span class="section-number-2">4</span> Fortran helper/wrapper functions</h2>
<div class="outline-text-2" id="text-4"> <div class="outline-text-2" id="text-4">
<p> <p>
The function below adapts the original C-based <code>trexio_open</code> for Fortran. The function below adapts the original C-based <code>trexio_open</code> for Fortran.
@ -2272,9 +2350,18 @@ Note, that Fortran interface calls the main <code>TREXIO</code> API, which is wr
<span style="color: #228b22;">character</span>, <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> mode</span> <span style="color: #228b22;">character</span>, <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> mode</span>
<span style="color: #228b22;">integer</span>(trexio_backend), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> backend</span> <span style="color: #228b22;">integer</span>(trexio_backend), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> backend</span>
<span style="color: #228b22;">character</span>(len=<span style="color: #a020f0;">len_trim</span>(filename)+1) ::<span style="color: #a0522d;"> filename_c</span> <span style="color: #228b22;">character</span>(len=<span style="color: #a020f0;">len_trim</span>(filename)+1) ::<span style="color: #a0522d;"> filename_c</span>
<span style="color: #228b22;">integer</span> ::<span style="color: #a0522d;"> rc</span>
filename_c = <span style="color: #a020f0;">trim</span>(filename) // <span style="color: #008b8b;">c_null_char</span> filename_c = <span style="color: #a020f0;">trim</span>(filename) // <span style="color: #008b8b;">c_null_char</span>
trexio_open = trexio_open_c(filename_c, mode, backend) trexio_open = trexio_open_c(filename_c, mode, backend)
<span style="color: #a020f0;">if</span> (trexio_open == 0_8) <span style="color: #a020f0;">then</span>
<span style="color: #a020f0;">return</span>
<span style="color: #a020f0;">endif</span>
rc = trexio_set_one_based(trexio_open)
<span style="color: #a020f0;">if</span> (rc /= TREXIO_SUCCESS) <span style="color: #a020f0;">then</span>
rc = trexio_close(trexio_open)
trexio_open = 0_8
<span style="color: #a020f0;">endif</span>
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_open</span> <span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_open</span>
</pre> </pre>
</div> </div>
@ -2283,7 +2370,7 @@ Note, that Fortran interface calls the main <code>TREXIO</code> API, which is wr
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-06-11 Fri 07:56</p> <p class="date">Created: 2021-06-14 Mon 07:35</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-06-11 Fri 07:56 --> <!-- 2021-06-14 Mon 07:35 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>HDF5 back end</title> <title>HDF5 back end</title>
@ -311,25 +311,25 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#orgc3ed59d">1. HDF5 back end</a> <li><a href="#orga8a34d8">1. HDF5 back end</a>
<ul> <ul>
<li><a href="#org724327c">1.1. Template for HDF5 definitions</a></li> <li><a href="#orgf949109">1.1. Template for HDF5 definitions</a></li>
<li><a href="#org7bcb00a">1.2. Template for HDF5 structures</a></li> <li><a href="#orgd6c384f">1.2. Template for HDF5 structures</a></li>
<li><a href="#org493e0a6">1.3. Template for HDF5 init/deinit</a></li> <li><a href="#org99fd15d">1.3. Template for HDF5 init/deinit</a></li>
<li><a href="#orgdbbd378">1.4. Template for HDF5 has/read/write a number</a></li> <li><a href="#orgd1fbc7e">1.4. Template for HDF5 has/read/write a number</a></li>
<li><a href="#orgc49b754">1.5. Template for HDF5 has/read/write a dataset</a></li> <li><a href="#org0fcce08">1.5. Template for HDF5 has/read/write a dataset</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div id="outline-container-orgc3ed59d" class="outline-2"> <div id="outline-container-orga8a34d8" class="outline-2">
<h2 id="orgc3ed59d"><span class="section-number-2">1</span> HDF5 back end</h2> <h2 id="orga8a34d8"><span class="section-number-2">1</span> HDF5 back end</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
</div> </div>
<div id="outline-container-org724327c" class="outline-3"> <div id="outline-container-orgf949109" class="outline-3">
<h3 id="org724327c"><span class="section-number-3">1.1</span> Template for HDF5 definitions</h3> <h3 id="orgf949109"><span class="section-number-3">1.1</span> Template for HDF5 definitions</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #483d8b;">#define</span> $GROUP$_GROUP_NAME <span style="color: #8b2252;">"$group$"</span> <pre class="src src-c"><span style="color: #483d8b;">#define</span> $GROUP$_GROUP_NAME <span style="color: #8b2252;">"$group$"</span>
@ -340,8 +340,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-org7bcb00a" class="outline-3"> <div id="outline-container-orgd6c384f" class="outline-3">
<h3 id="org7bcb00a"><span class="section-number-3">1.2</span> Template for HDF5 structures</h3> <h3 id="orgd6c384f"><span class="section-number-3">1.2</span> Template for HDF5 structures</h3>
<div class="outline-text-3" id="text-1-2"> <div class="outline-text-3" id="text-1-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">trexio_hdf5_s</span> { <pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">trexio_hdf5_s</span> {
@ -356,8 +356,8 @@ for the JavaScript code in this tag.
</div> </div>
<div id="outline-container-org493e0a6" class="outline-3"> <div id="outline-container-org99fd15d" class="outline-3">
<h3 id="org493e0a6"><span class="section-number-3">1.3</span> Template for HDF5 init/deinit</h3> <h3 id="org99fd15d"><span class="section-number-3">1.3</span> Template for HDF5 init/deinit</h3>
<div class="outline-text-3" id="text-1-3"> <div class="outline-text-3" id="text-1-3">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -437,8 +437,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-orgdbbd378" class="outline-3"> <div id="outline-container-orgd1fbc7e" class="outline-3">
<h3 id="orgdbbd378"><span class="section-number-3">1.4</span> Template for HDF5 has/read/write a number</h3> <h3 id="orgd1fbc7e"><span class="section-number-3">1.4</span> Template for HDF5 has/read/write a number</h3>
<div class="outline-text-3" id="text-1-4"> <div class="outline-text-3" id="text-1-4">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -560,8 +560,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-orgc49b754" class="outline-3"> <div id="outline-container-org0fcce08" class="outline-3">
<h3 id="orgc49b754"><span class="section-number-3">1.5</span> Template for HDF5 has/read/write a dataset</h3> <h3 id="org0fcce08"><span class="section-number-3">1.5</span> Template for HDF5 has/read/write a dataset</h3>
<div class="outline-text-3" id="text-1-5"> <div class="outline-text-3" id="text-1-5">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -695,7 +695,7 @@ for the JavaScript code in this tag.
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-06-11 Fri 07:56</p> <p class="date">Created: 2021-06-14 Mon 07:35</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-06-11 Fri 07:56 --> <!-- 2021-06-14 Mon 07:35 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TEXT back end</title> <title>TEXT back end</title>
@ -311,24 +311,24 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org1bc1e07">1. TEXT back end</a> <li><a href="#org4f1583e">1. TEXT back end</a>
<ul> <ul>
<li><a href="#org4c09bbf">1.1. Template for group-related structures in text back end</a></li> <li><a href="#org622f839">1.1. Template for group-related structures in text back end</a></li>
<li><a href="#orgccab0a0">1.2. Template for general structure in text back end</a></li> <li><a href="#org2bc7cd9">1.2. Template for general structure in text back end</a></li>
<li><a href="#org44cf6bf">1.3. Initialize function (constant part)</a></li> <li><a href="#org394737e">1.3. Initialize function (constant part)</a></li>
<li><a href="#org2a72d3f">1.4. Deinitialize function (templated part)</a></li> <li><a href="#orgc7b50a7">1.4. Deinitialize function (templated part)</a></li>
<li><a href="#org84a6f37">1.5. Template for text read struct</a></li> <li><a href="#orgba73b24">1.5. Template for text read struct</a></li>
<li><a href="#orgd018321">1.6. Template for text flush struct</a></li> <li><a href="#orgb1115ba">1.6. Template for text flush struct</a></li>
<li><a href="#orgddc0d37">1.7. Template for text free memory</a></li> <li><a href="#orgd41ec0e">1.7. Template for text free memory</a></li>
<li><a href="#org0b84fa2">1.8. Template for has/read/write the <code>$group_num$</code> attribute</a></li> <li><a href="#orgad26516">1.8. Template for has/read/write the <code>$group_num$</code> attribute</a></li>
<li><a href="#org9ae7599">1.9. Template for has/read/write the <code>$group_dset$</code> dataset</a></li> <li><a href="#org2f91d61">1.9. Template for has/read/write the <code>$group_dset$</code> dataset</a></li>
<li><a href="#orga0ad07d">1.10. RDM struct (hard-coded)</a> <li><a href="#orgbcff4b0">1.10. RDM struct (hard-coded)</a>
<ul> <ul>
<li><a href="#orga94f317">1.10.1. Read the complete struct</a></li> <li><a href="#orgd4e1776">1.10.1. Read the complete struct</a></li>
<li><a href="#org53854e4">1.10.2. Flush the complete struct</a></li> <li><a href="#org5029913">1.10.2. Flush the complete struct</a></li>
<li><a href="#org3ea0f7a">1.10.3. Free memory</a></li> <li><a href="#org76c677e">1.10.3. Free memory</a></li>
<li><a href="#org3a74c1e">1.10.4. Read/Write the one<sub>e</sub> attribute</a></li> <li><a href="#org1c54582">1.10.4. Read/Write the one<sub>e</sub> attribute</a></li>
<li><a href="#orga3119a3">1.10.5. Read/Write the two<sub>e</sub> attribute</a></li> <li><a href="#orgb30e092">1.10.5. Read/Write the two<sub>e</sub> attribute</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -337,8 +337,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-org1bc1e07" class="outline-2"> <div id="outline-container-org4f1583e" class="outline-2">
<h2 id="org1bc1e07"><span class="section-number-2">1</span> TEXT back end</h2> <h2 id="org4f1583e"><span class="section-number-2">1</span> TEXT back end</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> <p>
The "file" produced by the text back end is a directory with one The "file" produced by the text back end is a directory with one
@ -359,8 +359,8 @@ The file is written when closed, or when the flush function is called.
</p> </p>
</div> </div>
<div id="outline-container-org4c09bbf" class="outline-3"> <div id="outline-container-org622f839" class="outline-3">
<h3 id="org4c09bbf"><span class="section-number-3">1.1</span> Template for group-related structures in text back end</h3> <h3 id="org622f839"><span class="section-number-3">1.1</span> Template for group-related structures in text back end</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> $group$_s { <pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> $group$_s {
@ -376,8 +376,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-orgccab0a0" class="outline-3"> <div id="outline-container-org2bc7cd9" class="outline-3">
<h3 id="orgccab0a0"><span class="section-number-3">1.2</span> Template for general structure in text back end</h3> <h3 id="org2bc7cd9"><span class="section-number-3">1.2</span> Template for general structure in text back end</h3>
<div class="outline-text-3" id="text-1-2"> <div class="outline-text-3" id="text-1-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">rdm_s</span> { <pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">rdm_s</span> {
@ -403,8 +403,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-org44cf6bf" class="outline-3"> <div id="outline-container-org394737e" class="outline-3">
<h3 id="org44cf6bf"><span class="section-number-3">1.3</span> Initialize function (constant part)</h3> <h3 id="org394737e"><span class="section-number-3">1.3</span> Initialize function (constant part)</h3>
<div class="outline-text-3" id="text-1-3"> <div class="outline-text-3" id="text-1-3">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -505,8 +505,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-org2a72d3f" class="outline-3"> <div id="outline-container-orgc7b50a7" class="outline-3">
<h3 id="org2a72d3f"><span class="section-number-3">1.4</span> Deinitialize function (templated part)</h3> <h3 id="orgc7b50a7"><span class="section-number-3">1.4</span> Deinitialize function (templated part)</h3>
<div class="outline-text-3" id="text-1-4"> <div class="outline-text-3" id="text-1-4">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -531,8 +531,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-org84a6f37" class="outline-3"> <div id="outline-container-orgba73b24" class="outline-3">
<h3 id="org84a6f37"><span class="section-number-3">1.5</span> Template for text read struct</h3> <h3 id="orgba73b24"><span class="section-number-3">1.5</span> Template for text read struct</h3>
<div class="outline-text-3" id="text-1-5"> <div class="outline-text-3" id="text-1-5">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c">$group$_t* <pre class="src src-c">$group$_t*
@ -698,8 +698,8 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
</div> </div>
</div> </div>
<div id="outline-container-orgd018321" class="outline-3"> <div id="outline-container-orgb1115ba" class="outline-3">
<h3 id="orgd018321"><span class="section-number-3">1.6</span> Template for text flush struct</h3> <h3 id="orgb1115ba"><span class="section-number-3">1.6</span> Template for text flush struct</h3>
<div class="outline-text-3" id="text-1-6"> <div class="outline-text-3" id="text-1-6">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -758,8 +758,8 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
</div> </div>
</div> </div>
<div id="outline-container-orgddc0d37" class="outline-3"> <div id="outline-container-orgd41ec0e" class="outline-3">
<h3 id="orgddc0d37"><span class="section-number-3">1.7</span> Template for text free memory</h3> <h3 id="orgd41ec0e"><span class="section-number-3">1.7</span> Template for text free memory</h3>
<div class="outline-text-3" id="text-1-7"> <div class="outline-text-3" id="text-1-7">
<p> <p>
Memory is allocated when reading. The following function frees memory. Memory is allocated when reading. The following function frees memory.
@ -795,8 +795,8 @@ Memory is allocated when reading. The following function frees memory.
</div> </div>
</div> </div>
<div id="outline-container-org0b84fa2" class="outline-3"> <div id="outline-container-orgad26516" class="outline-3">
<h3 id="org0b84fa2"><span class="section-number-3">1.8</span> Template for has/read/write the <code>$group_num$</code> attribute</h3> <h3 id="orgad26516"><span class="section-number-3">1.8</span> Template for has/read/write the <code>$group_num$</code> attribute</h3>
<div class="outline-text-3" id="text-1-8"> <div class="outline-text-3" id="text-1-8">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -858,8 +858,8 @@ Memory is allocated when reading. The following function frees memory.
</div> </div>
</div> </div>
<div id="outline-container-org9ae7599" class="outline-3"> <div id="outline-container-org2f91d61" class="outline-3">
<h3 id="org9ae7599"><span class="section-number-3">1.9</span> Template for has/read/write the <code>$group_dset$</code> dataset</h3> <h3 id="org2f91d61"><span class="section-number-3">1.9</span> Template for has/read/write the <code>$group_dset$</code> dataset</h3>
<div class="outline-text-3" id="text-1-9"> <div class="outline-text-3" id="text-1-9">
<p> <p>
The <code>group_dset</code> array is assumed allocated with the appropriate size. The <code>group_dset</code> array is assumed allocated with the appropriate size.
@ -956,12 +956,12 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
<div id="outline-container-orga0ad07d" class="outline-3"> <div id="outline-container-orgbcff4b0" class="outline-3">
<h3 id="orga0ad07d"><span class="section-number-3">1.10</span> RDM struct (hard-coded)</h3> <h3 id="orgbcff4b0"><span class="section-number-3">1.10</span> RDM struct (hard-coded)</h3>
<div class="outline-text-3" id="text-1-10"> <div class="outline-text-3" id="text-1-10">
</div> </div>
<div id="outline-container-orga94f317" class="outline-4"> <div id="outline-container-orgd4e1776" class="outline-4">
<h4 id="orga94f317"><span class="section-number-4">1.10.1</span> Read the complete struct</h4> <h4 id="orgd4e1776"><span class="section-number-4">1.10.1</span> Read the complete struct</h4>
<div class="outline-text-4" id="text-1-10-1"> <div class="outline-text-4" id="text-1-10-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">rdm_t</span>* <span style="color: #0000ff;">trexio_text_read_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>); <pre class="src src-c"><span style="color: #228b22;">rdm_t</span>* <span style="color: #0000ff;">trexio_text_read_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>);
@ -1056,8 +1056,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
<div id="outline-container-org53854e4" class="outline-4"> <div id="outline-container-org5029913" class="outline-4">
<h4 id="org53854e4"><span class="section-number-4">1.10.2</span> Flush the complete struct</h4> <h4 id="org5029913"><span class="section-number-4">1.10.2</span> Flush the complete struct</h4>
<div class="outline-text-4" id="text-1-10-2"> <div class="outline-text-4" id="text-1-10-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <span style="color: #0000ff;">trexio_text_flush_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>); <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <span style="color: #0000ff;">trexio_text_flush_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>);
@ -1099,8 +1099,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
<div id="outline-container-org3ea0f7a" class="outline-4"> <div id="outline-container-org76c677e" class="outline-4">
<h4 id="org3ea0f7a"><span class="section-number-4">1.10.3</span> Free memory</h4> <h4 id="org76c677e"><span class="section-number-4">1.10.3</span> Free memory</h4>
<div class="outline-text-4" id="text-1-10-3"> <div class="outline-text-4" id="text-1-10-3">
<p> <p>
Memory is allocated when reading. The followig function frees memory. Memory is allocated when reading. The followig function frees memory.
@ -1136,8 +1136,8 @@ Memory is allocated when reading. The followig function frees memory.
</div> </div>
</div> </div>
<div id="outline-container-org3a74c1e" class="outline-4"> <div id="outline-container-org1c54582" class="outline-4">
<h4 id="org3a74c1e"><span class="section-number-4">1.10.4</span> Read/Write the one<sub>e</sub> attribute</h4> <h4 id="org1c54582"><span class="section-number-4">1.10.4</span> Read/Write the one<sub>e</sub> attribute</h4>
<div class="outline-text-4" id="text-1-10-4"> <div class="outline-text-4" id="text-1-10-4">
<p> <p>
The <code>one_e</code> array is assumed allocated with the appropriate size. The <code>one_e</code> array is assumed allocated with the appropriate size.
@ -1203,8 +1203,8 @@ The <code>one_e</code> array is assumed allocated with the appropriate size.
</div> </div>
</div> </div>
<div id="outline-container-orga3119a3" class="outline-4"> <div id="outline-container-orgb30e092" class="outline-4">
<h4 id="orga3119a3"><span class="section-number-4">1.10.5</span> Read/Write the two<sub>e</sub> attribute</h4> <h4 id="orgb30e092"><span class="section-number-4">1.10.5</span> Read/Write the two<sub>e</sub> attribute</h4>
<div class="outline-text-4" id="text-1-10-5"> <div class="outline-text-4" id="text-1-10-5">
<p> <p>
<code>two_e</code> is a sparse data structure, which can be too large to fit <code>two_e</code> is a sparse data structure, which can be too large to fit
@ -1312,7 +1312,7 @@ file for each sparse float structure.
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-06-11 Fri 07:56</p> <p class="date">Created: 2021-06-14 Mon 07:35</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>