1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-25 13:53:55 +01:00

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

This commit is contained in:
q-posev 2021-05-26 17:12:38 +00:00
parent d84dfaea8d
commit 9d63bf0b4a
5 changed files with 229 additions and 190 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-05-24 Mon 22:02 -->
<!-- 2021-05-26 Wed 17:12 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREXIO source code documentation</title>
@ -341,7 +341,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-05-24 Mon 22:02</p>
<p class="date">Created: 2021-05-26 Wed 17:12</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-05-24 Mon 22:02 -->
<!-- 2021-05-26 Wed 17:12 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREXIO source code documentation</title>
@ -341,7 +341,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-05-24 Mon 22:02</p>
<p class="date">Created: 2021-05-26 Wed 17:12</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-05-24 Mon 22:02 -->
<!-- 2021-05-26 Wed 17:12 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Front end API</title>
@ -311,45 +311,46 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org080e62e">1. Coding conventions</a>
<li><a href="#org8a2c28e">1. Coding conventions</a>
<ul>
<li><a href="#org77a3de5">1.1. Memory allocation</a></li>
<li><a href="#org37fca10">1.1. Memory allocation</a></li>
</ul>
</li>
<li><a href="#orgd9f19a8">2. Front end</a>
<li><a href="#org342f653">2. Front end</a>
<ul>
<li><a href="#org4c481b2">2.1. Error handling</a></li>
<li><a href="#org7dc5deb">2.2. Back ends</a></li>
<li><a href="#org009ed55">2.3. Read/write behavior</a></li>
<li><a href="#orgf766e93">2.4. TREXIO file type</a></li>
<li><a href="#org87243a7">2.5. Polymorphism of the file handle</a></li>
<li><a href="#org4b9fcf0">2.6. File opening</a></li>
<li><a href="#org82aee32">2.7. File closing</a></li>
<li><a href="#org86b9726">2.1. Error handling</a></li>
<li><a href="#org6b58c83">2.2. Back ends</a></li>
<li><a href="#orgb9835fe">2.3. Read/write behavior</a></li>
<li><a href="#org92e8610">2.4. TREXIO file type</a></li>
<li><a href="#orgcf84634">2.5. Polymorphism of the file handle</a></li>
<li><a href="#org508a851">2.6. File opening</a></li>
<li><a href="#orgda2849f">2.7. File closing</a></li>
<li><a href="#org79e8197">2.8. C helper functions</a></li>
</ul>
</li>
<li><a href="#org066d790">3. Templates for front end</a>
<li><a href="#org44efb7b">3. Templates for front end</a>
<ul>
<li><a href="#org259896f">3.1. Templates for front end has/read/write a dimension</a>
<li><a href="#orgb07b302">3.1. Templates for front end has/read/write a dimension</a>
<ul>
<li><a href="#org2c758a9">3.1.1. C templates for front end</a></li>
<li><a href="#orgdc46bb0">3.1.2. Fortran templates for front end</a></li>
<li><a href="#org13c9072">3.1.1. C templates for front end</a></li>
<li><a href="#org8fb7625">3.1.2. Fortran templates for front end</a></li>
</ul>
</li>
<li><a href="#org6f2e305">3.2. Templates for front end has/read/write a dataset</a>
<li><a href="#org6e25739">3.2. Templates for front end has/read/write a dataset</a>
<ul>
<li><a href="#org8bd3db4">3.2.1. C templates for front end</a></li>
<li><a href="#orge1f773f">3.2.2. Fortran templates for front end</a></li>
<li><a href="#org56fe54e">3.2.1. C templates for front end</a></li>
<li><a href="#orgb9009d8">3.2.2. Fortran templates for front end</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#orge1275cb">4. Fortran helper/wrapper functions</a></li>
<li><a href="#orga6032e2">4. Fortran helper/wrapper functions</a></li>
</ul>
</div>
</div>
<div id="outline-container-org080e62e" class="outline-2">
<h2 id="org080e62e"><span class="section-number-2">1</span> Coding conventions</h2>
<div id="outline-container-org8a2c28e" class="outline-2">
<h2 id="org8a2c28e"><span class="section-number-2">1</span> Coding conventions</h2>
<div class="outline-text-2" id="text-1">
<ul class="org-ul">
<li>integer types will be defined using types given in <code>stdint.h</code></li>
@ -364,8 +365,8 @@ for the JavaScript code in this tag.
</ul>
</div>
<div id="outline-container-org77a3de5" class="outline-3">
<h3 id="org77a3de5"><span class="section-number-3">1.1</span> Memory allocation</h3>
<div id="outline-container-org37fca10" class="outline-3">
<h3 id="org37fca10"><span class="section-number-3">1.1</span> Memory allocation</h3>
<div class="outline-text-3" id="text-1-1">
<p>
Memory allocation of structures can be facilitated by using the
@ -400,8 +401,8 @@ The maximum string size for the filenames is 4096 characters.
</div>
</div>
<div id="outline-container-orgd9f19a8" class="outline-2">
<h2 id="orgd9f19a8"><span class="section-number-2">2</span> Front end</h2>
<div id="outline-container-org342f653" class="outline-2">
<h2 id="org342f653"><span class="section-number-2">2</span> Front end</h2>
<div class="outline-text-2" id="text-2">
<p>
All calls to TREXIO are thread-safe.
@ -409,10 +410,10 @@ TREXIO front end is modular, which simplifies implementation of new back ends.
</p>
</div>
<div id="outline-container-org4c481b2" class="outline-3">
<h3 id="org4c481b2"><span class="section-number-3">2.1</span> Error handling</h3>
<div id="outline-container-org86b9726" class="outline-3">
<h3 id="org86b9726"><span class="section-number-3">2.1</span> Error handling</h3>
<div class="outline-text-3" id="text-2-1">
<table id="orga038f02" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org2b4df6d" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -694,8 +695,8 @@ The text strings are extracted from the previous table.
</div>
</div>
<div id="outline-container-org7dc5deb" class="outline-3">
<h3 id="org7dc5deb"><span class="section-number-3">2.2</span> Back ends</h3>
<div id="outline-container-org6b58c83" class="outline-3">
<h3 id="org6b58c83"><span class="section-number-3">2.2</span> Back ends</h3>
<div class="outline-text-3" id="text-2-2">
<p>
TREXIO has several back ends:
@ -725,8 +726,8 @@ lines that correspond to the <code>TREXIO_JSON</code> back end (not implemented
</div>
</div>
</div>
<div id="outline-container-org009ed55" class="outline-3">
<h3 id="org009ed55"><span class="section-number-3">2.3</span> Read/write behavior</h3>
<div id="outline-container-orgb9835fe" class="outline-3">
<h3 id="orgb9835fe"><span class="section-number-3">2.3</span> Read/write behavior</h3>
<div class="outline-text-3" id="text-2-3">
<p>
Every time a reading function is called, the data is read from the
@ -754,8 +755,8 @@ concurrent programs, the behavior is not specified.
</p>
</div>
</div>
<div id="outline-container-orgf766e93" class="outline-3">
<h3 id="orgf766e93"><span class="section-number-3">2.4</span> TREXIO file type</h3>
<div id="outline-container-org92e8610" class="outline-3">
<h3 id="org92e8610"><span class="section-number-3">2.4</span> TREXIO file type</h3>
<div class="outline-text-3" id="text-2-4">
<p>
<code>trexio_s</code> is the the main type for TREXIO files, visible to the users
@ -787,8 +788,8 @@ TREXIO files will have as a first argument the TREXIO file handle.
</div>
</div>
</div>
<div id="outline-container-org87243a7" class="outline-3">
<h3 id="org87243a7"><span class="section-number-3">2.5</span> Polymorphism of the file handle</h3>
<div id="outline-container-orgcf84634" class="outline-3">
<h3 id="orgcf84634"><span class="section-number-3">2.5</span> Polymorphism of the file handle</h3>
<div class="outline-text-3" id="text-2-5">
<p>
Polymorphism of the <code>trexio_t</code> type is handled by ensuring that the
@ -807,8 +808,8 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-org4b9fcf0" class="outline-3">
<h3 id="org4b9fcf0"><span class="section-number-3">2.6</span> File opening</h3>
<div id="outline-container-org508a851" class="outline-3">
<h3 id="org508a851"><span class="section-number-3">2.6</span> File opening</h3>
<div class="outline-text-3" id="text-2-6">
<p>
<code>trexio_open</code> creates a new TREXIO file or opens existing one.
@ -972,8 +973,8 @@ should tend to avoid renaming the <code>.txt</code> data files.
</div>
</div>
<div id="outline-container-org82aee32" class="outline-3">
<h3 id="org82aee32"><span class="section-number-3">2.7</span> File closing</h3>
<div id="outline-container-orgda2849f" class="outline-3">
<h3 id="orgda2849f"><span class="section-number-3">2.7</span> File closing</h3>
<div class="outline-text-3" id="text-2-7">
<p>
<code>trexio_close</code> closes an existing <code>trexio_t</code> file.
@ -1070,10 +1071,48 @@ output:
</div>
</div>
</div>
<div id="outline-container-org79e8197" class="outline-3">
<h3 id="org79e8197"><span class="section-number-3">2.8</span> C helper functions</h3>
<div class="outline-text-3" id="text-2-8">
<p>
#+begin<sub>src</sub> c :tangle prefix<sub>front.c</sub>
trexio<sub>exit</sub><sub>code</sub> transform<sub>str</sub> (char** dest, const char** src, uint64<sub>t</sub> str<sub>max</sub><sub>num</sub>, uint32<sub>t</sub> str<sub>max</sub><sub>len</sub>){
</p>
<p>
if (dest == NULL) return TREXIO<sub>INVALID</sub><sub>ARG</sub><sub>1</sub>;
assert (str<sub>max</sub><sub>num</sub> &gt; 0);
assert (str<sub>max</sub><sub>len</sub> &gt; 0);
</p>
<p>
char* tmp<sub>str</sub> = (char*)calloc(str<sub>max</sub><sub>num</sub>*(str<sub>max</sub><sub>len</sub>+1)+1,sizeof(char));
</p>
<p>
for (int i=0; i&lt;str<sub>max</sub><sub>num</sub>; i++){
dest[i] = tmp<sub>str</sub>;
strncpy(tmp<sub>str</sub>, src[i], str<sub>max</sub><sub>len</sub>);
tmp<sub>str</sub> += str<sub>max</sub><sub>len</sub> + 1;
}
</p>
<p>
<i>*tmp<sub>str</sub> cannot be freed here but it is taken case of when pointer to dest is deallocated *</i>
</p>
<p>
return TREXIO<sub>SUCCESS</sub>;
}
#+end<sub>src</sub> c
</p>
</div>
</div>
</div>
<div id="outline-container-org066d790" class="outline-2">
<h2 id="org066d790"><span class="section-number-2">3</span> Templates for front end</h2>
<div id="outline-container-org44efb7b" class="outline-2">
<h2 id="org44efb7b"><span class="section-number-2">3</span> Templates for front end</h2>
<div class="outline-text-2" id="text-3">
<p>
Consider the following block of <code>trex.json</code>:
@ -1263,8 +1302,8 @@ or double precision for integer and floating point numbers.
</p>
</div>
<div id="outline-container-org259896f" class="outline-3">
<h3 id="org259896f"><span class="section-number-3">3.1</span> Templates for front end has/read/write a dimension</h3>
<div id="outline-container-orgb07b302" class="outline-3">
<h3 id="orgb07b302"><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">
<p>
This section concerns API calls related to dimensioning variables.
@ -1333,8 +1372,8 @@ This section concerns API calls related to dimensioning variables.
</table>
</div>
<div id="outline-container-org2c758a9" class="outline-4">
<h4 id="org2c758a9"><span class="section-number-4">3.1.1</span> C templates for front end</h4>
<div id="outline-container-org13c9072" class="outline-4">
<h4 id="org13c9072"><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">
<p>
The <code>C</code> templates that correspond to each of the abovementioned
@ -1502,7 +1541,7 @@ precision (see Table above).
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END);
assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END);
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
@ -1527,8 +1566,8 @@ precision (see Table above).
</div>
</div>
<div id="outline-container-orgdc46bb0" class="outline-4">
<h4 id="orgdc46bb0"><span class="section-number-4">3.1.2</span> Fortran templates for front end</h4>
<div id="outline-container-org8fb7625" class="outline-4">
<h4 id="org8fb7625"><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">
<p>
The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from Fortran.
@ -1614,8 +1653,8 @@ These templates are based on the use of <code>iso_c_binding</code>. Pointers hav
</div>
</div>
<div id="outline-container-org6f2e305" class="outline-3">
<h3 id="org6f2e305"><span class="section-number-3">3.2</span> Templates for front end has/read/write a dataset</h3>
<div id="outline-container-org6e25739" class="outline-3">
<h3 id="org6e25739"><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">
<p>
This section concerns API calls related to datasets.
@ -1640,43 +1679,43 @@ This section concerns API calls related to datasets.
</thead>
<tbody>
<tr>
<td class="org-left"><code>trexio_has_$group$_$group_dset$</code></td>
<td class="org-left"><code>trexio_has_$group_dset$</code></td>
<td class="org-left">Check if a dataset exists in a file</td>
<td class="org-left">---</td>
</tr>
<tr>
<td class="org-left"><code>trexio_read_$group$_$group_dset$</code></td>
<td class="org-left"><code>trexio_read_$group_dset$</code></td>
<td class="org-left">Read a dataset</td>
<td class="org-left">Double</td>
</tr>
<tr>
<td class="org-left"><code>trexio_write_$group$_$group_dset$</code></td>
<td class="org-left"><code>trexio_write_$group_dset$</code></td>
<td class="org-left">Write a dataset</td>
<td class="org-left">Double</td>
</tr>
<tr>
<td class="org-left"><code>trexio_read_$group$_$group_dset$_32</code></td>
<td class="org-left"><code>trexio_read_$group_dset$_32</code></td>
<td class="org-left">Read a dataset</td>
<td class="org-left">Single</td>
</tr>
<tr>
<td class="org-left"><code>trexio_write_$group$_$group_dset$_32</code></td>
<td class="org-left"><code>trexio_write_$group_dset$_32</code></td>
<td class="org-left">Write a dataset</td>
<td class="org-left">Single</td>
</tr>
<tr>
<td class="org-left"><code>trexio_read_$group$_$group_dset$_64</code></td>
<td class="org-left"><code>trexio_read_$group_dset$_64</code></td>
<td class="org-left">Read a dataset</td>
<td class="org-left">Double</td>
</tr>
<tr>
<td class="org-left"><code>trexio_write_$group$_$group_dset$_64</code></td>
<td class="org-left"><code>trexio_write_$group_dset$_64</code></td>
<td class="org-left">Write a dataset</td>
<td class="org-left">Double</td>
</tr>
@ -1684,8 +1723,8 @@ This section concerns API calls related to datasets.
</table>
</div>
<div id="outline-container-org8bd3db4" class="outline-4">
<h4 id="org8bd3db4"><span class="section-number-4">3.2.1</span> C templates for front end</h4>
<div id="outline-container-org56fe54e" class="outline-4">
<h4 id="org56fe54e"><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">
<p>
The C templates that correspond to each of the abovementioned functions can be found below.
@ -1698,7 +1737,7 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_read_$group$_$group_dset$_64</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_dset_dtype_double$* <span style="color: #a020f0;">const</span> $group_dset$)
<span style="color: #0000ff;">trexio_read_$group_dset$_64</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_dset_dtype_double$* <span style="color: #a020f0;">const</span> $group_dset$)
{
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
@ -1715,20 +1754,20 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<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$};
assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END);
assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END);
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
<span style="color: #a020f0;">case</span> TREXIO_TEXT:
<span style="color: #a020f0;">return</span> trexio_text_read_$group$_$group_dset$(file, $group_dset$, rank, dims);
<span style="color: #a020f0;">return</span> trexio_text_read_$group_dset$(file, $group_dset$, rank, dims);
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_HDF5:
<span style="color: #a020f0;">return</span> trexio_hdf5_read_$group$_$group_dset$(file, $group_dset$, rank, dims);
<span style="color: #a020f0;">return</span> trexio_hdf5_read_$group_dset$(file, $group_dset$, rank, dims);
<span style="color: #a020f0;">break</span>;
/*
<span style="color: #b22222;"> case TREXIO_JSON:</span>
<span style="color: #b22222;"> return trexio_json_read_$group$_$group_dset$(file, $group_dset$, rank, dims);</span>
<span style="color: #b22222;"> return trexio_json_read_$group_dset$(file, $group_dset$, rank, dims);</span>
<span style="color: #b22222;"> break;</span>
*/
}
@ -1739,7 +1778,7 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_write_$group$_$group_dset$_64</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> $group_dset_dtype_double$* $group_dset$)
<span style="color: #0000ff;">trexio_write_$group_dset$_64</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> $group_dset_dtype_double$* $group_dset$)
{
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
@ -1756,20 +1795,20 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<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$};
assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END);
assert(file-&gt;back_end &lt; TREXIO_INVALID_BACK_END);
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
<span style="color: #a020f0;">case</span> TREXIO_TEXT:
<span style="color: #a020f0;">return</span> trexio_text_write_$group$_$group_dset$(file, $group_dset$, rank, dims);
<span style="color: #a020f0;">return</span> trexio_text_write_$group_dset$(file, $group_dset$, rank, dims);
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_HDF5:
<span style="color: #a020f0;">return</span> trexio_hdf5_write_$group$_$group_dset$(file, $group_dset$, rank, dims);
<span style="color: #a020f0;">return</span> trexio_hdf5_write_$group_dset$(file, $group_dset$, rank, dims);
<span style="color: #a020f0;">break</span>;
/*
<span style="color: #b22222;"> case TREXIO_JSON:</span>
<span style="color: #b22222;"> return trexio_json_write_$group$_$group_dset$(file, $group_dset$, rank, dims);</span>
<span style="color: #b22222;"> return trexio_json_write_$group_dset$(file, $group_dset$, rank, dims);</span>
<span style="color: #b22222;"> break;</span>
*/
}
@ -1780,7 +1819,7 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_read_$group$_$group_dset$_32</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_dset_dtype_single$* <span style="color: #a020f0;">const</span> $group_dset$)
<span style="color: #0000ff;">trexio_read_$group_dset$_32</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_dset_dtype_single$* <span style="color: #a020f0;">const</span> $group_dset$)
{
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
@ -1812,15 +1851,15 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
<span style="color: #a020f0;">case</span> TREXIO_TEXT:
rc = trexio_text_read_$group$_$group_dset$(file, $group_dset$_64, rank, dims);
rc = trexio_text_read_$group_dset$(file, $group_dset$_64, rank, dims);
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_HDF5:
rc = trexio_hdf5_read_$group$_$group_dset$(file, $group_dset$_64, rank, dims);
rc = trexio_hdf5_read_$group_dset$(file, $group_dset$_64, rank, dims);
<span style="color: #a020f0;">break</span>;
/*
<span style="color: #b22222;"> case TREXIO_JSON:</span>
<span style="color: #b22222;"> rc = trexio_json_read_$group$_$group_dset$(file, $group_dset$_64, rank, dims);</span>
<span style="color: #b22222;"> rc = trexio_json_read_$group_dset$(file, $group_dset$_64, rank, dims);</span>
<span style="color: #b22222;"> break;</span>
*/
}
@ -1842,7 +1881,7 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_write_$group$_$group_dset$_32</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> $group_dset_dtype_single$* $group_dset$)
<span style="color: #0000ff;">trexio_write_$group_dset$_32</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> $group_dset_dtype_single$* $group_dset$)
{
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
@ -1878,15 +1917,15 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
<span style="color: #a020f0;">case</span> TREXIO_TEXT:
rc = trexio_text_write_$group$_$group_dset$(file, $group_dset$_64, rank, dims);
rc = trexio_text_write_$group_dset$(file, $group_dset$_64, rank, dims);
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_HDF5:
rc = trexio_hdf5_write_$group$_$group_dset$(file, $group_dset$_64, rank, dims);
rc = trexio_hdf5_write_$group_dset$(file, $group_dset$_64, rank, dims);
<span style="color: #a020f0;">break</span>;
/*
<span style="color: #b22222;"> case TREXIO_JSON:</span>
<span style="color: #b22222;"> rc = trexio_json_write_$group$_$group_dset$(file, $group_dset$_64, rank, dims);</span>
<span style="color: #b22222;"> rc = trexio_json_write_$group_dset$(file, $group_dset$_64, rank, dims);</span>
<span style="color: #b22222;"> break;</span>
*/
}
@ -1902,25 +1941,25 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_read_$group$_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_dset_dtype_default$* <span style="color: #a020f0;">const</span> $group_dset$)
<span style="color: #0000ff;">trexio_read_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_dset_dtype_default$* <span style="color: #a020f0;">const</span> $group_dset$)
{
<span style="color: #a020f0;">return</span> trexio_read_$group$_$group_dset$_$default_prec$(file, $group_dset$);
<span style="color: #a020f0;">return</span> trexio_read_$group_dset$_$default_prec$(file, $group_dset$);
}
</pre>
</div>
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_write_$group$_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> $group_dset_dtype_default$* $group_dset$)
<span style="color: #0000ff;">trexio_write_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> $group_dset_dtype_default$* $group_dset$)
{
<span style="color: #a020f0;">return</span> trexio_write_$group$_$group_dset$_$default_prec$(file, $group_dset$);
<span style="color: #a020f0;">return</span> trexio_write_$group_dset$_$default_prec$(file, $group_dset$);
}
</pre>
</div>
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_has_$group$_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>)
<span style="color: #0000ff;">trexio_has_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</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_INVALID_ARG_1;
@ -1930,15 +1969,15 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
<span style="color: #a020f0;">case</span> TREXIO_TEXT:
<span style="color: #a020f0;">return</span> trexio_text_has_$group$_$group_dset$(file);
<span style="color: #a020f0;">return</span> trexio_text_has_$group_dset$(file);
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_HDF5:
<span style="color: #a020f0;">return</span> trexio_hdf5_has_$group$_$group_dset$(file);
<span style="color: #a020f0;">return</span> trexio_hdf5_has_$group_dset$(file);
<span style="color: #a020f0;">break</span>;
/*
<span style="color: #b22222;"> case TREXIO_JSON:</span>
<span style="color: #b22222;"> return trexio_json_has_$group$_$group_dset$(file);</span>
<span style="color: #b22222;"> return trexio_json_has_$group_dset$(file);</span>
<span style="color: #b22222;"> break;</span>
*/
}
@ -1949,8 +1988,8 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
</div>
</div>
<div id="outline-container-orge1f773f" class="outline-4">
<h4 id="orge1f773f"><span class="section-number-4">3.2.2</span> Fortran templates for front end</h4>
<div id="outline-container-orgb9009d8" class="outline-4">
<h4 id="orgb9009d8"><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">
<p>
The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from <code>Fortran</code>.
@ -1959,76 +1998,76 @@ These templates are based on the use of <code>iso_c_binding</code>. Pointers hav
<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_write_$group$_$group_dset$_64</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) bind(C)</span>
<span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">trexio_write_$group_dset$_64</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) 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>
$group_dset_f_dtype_double$, <span style="color: #a020f0;">intent</span>(in) :: dset$group_dset_f_dims$
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_write_$group$_$group_dset$_64</span>
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_write_$group_dset$_64</span>
<span style="color: #a020f0;">end interface</span>
</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_read_$group$_$group_dset$_64</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) bind(C)</span>
<span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">trexio_read_$group_dset$_64</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) 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>
$group_dset_f_dtype_double$, <span style="color: #a020f0;">intent</span>(out) :: dset$group_dset_f_dims$
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_read_$group$_$group_dset$_64</span>
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_read_$group_dset$_64</span>
<span style="color: #a020f0;">end interface</span>
</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_write_$group$_$group_dset$_32</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) bind(C)</span>
<span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">trexio_write_$group_dset$_32</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) 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>
$group_dset_f_dtype_single$, <span style="color: #a020f0;">intent</span>(in) :: dset$group_dset_f_dims$
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_write_$group$_$group_dset$_32</span>
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_write_$group_dset$_32</span>
<span style="color: #a020f0;">end interface</span>
</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_read_$group$_$group_dset$_32</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) bind(C)</span>
<span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">trexio_read_$group_dset$_32</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) 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>
$group_dset_f_dtype_single$, <span style="color: #a020f0;">intent</span>(out) :: dset$group_dset_f_dims$
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_read_$group$_$group_dset$_32</span>
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_read_$group_dset$_32</span>
<span style="color: #a020f0;">end interface</span>
</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_write_$group$_$group_dset$</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) bind(C)</span>
<span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">trexio_write_$group_dset$</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) 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>
$group_dset_f_dtype_default$, <span style="color: #a020f0;">intent</span>(in) :: dset$group_dset_f_dims$
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_write_$group$_$group_dset$</span>
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_write_$group_dset$</span>
<span style="color: #a020f0;">end interface</span>
</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_read_$group$_$group_dset$</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) bind(C)</span>
<span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">trexio_read_$group_dset$</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file, dset) 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>
$group_dset_f_dtype_default$, <span style="color: #a020f0;">intent</span>(out) :: dset$group_dset_f_dims$
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_read_$group$_$group_dset$</span>
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_read_$group_dset$</span>
<span style="color: #a020f0;">end interface</span>
</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_has_$group$_$group_dset$</span><span style="color: #a0522d;"> </span><span style="color: #000000; background-color: #ffffff;">(trex_file) bind(C)</span>
<span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">trexio_has_$group_dset$</span><span style="color: #a0522d;"> </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_has_$group$_$group_dset$</span>
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">trexio_has_$group_dset$</span>
<span style="color: #a020f0;">end interface</span>
</pre>
</div>
@ -2037,8 +2076,8 @@ These templates are based on the use of <code>iso_c_binding</code>. Pointers hav
</div>
</div>
<div id="outline-container-orge1275cb" class="outline-2">
<h2 id="orge1275cb"><span class="section-number-2">4</span> Fortran helper/wrapper functions</h2>
<div id="outline-container-orga6032e2" class="outline-2">
<h2 id="orga6032e2"><span class="section-number-2">4</span> Fortran helper/wrapper functions</h2>
<div class="outline-text-2" id="text-4">
<p>
The function below adapts the original C-based <code>trexio_open</code> for Fortran.
@ -2067,7 +2106,7 @@ Note, that Fortran interface calls the main <code>TREXIO</code> API, which is wr
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-05-24 Mon 22:02</p>
<p class="date">Created: 2021-05-26 Wed 17:12</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-05-24 Mon 22:02 -->
<!-- 2021-05-26 Wed 17:12 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>HDF5 back end</title>
@ -311,37 +311,37 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgd9d1f81">1. HDF5 back end</a>
<li><a href="#orgdc4d015">1. HDF5 back end</a>
<ul>
<li><a href="#org59cf013">1.1. Template for HDF5 definitions</a></li>
<li><a href="#org5d29550">1.2. Template for HDF5 structures</a></li>
<li><a href="#orga4e301d">1.3. Template for HDF5 init/deinit</a></li>
<li><a href="#orgb37b35d">1.4. Template for HDF5 has/read/write a number</a></li>
<li><a href="#org0cf72a1">1.5. Template for HDF5 has/read/write a dataset</a></li>
<li><a href="#org9452876">1.1. Template for HDF5 definitions</a></li>
<li><a href="#org81f4b6d">1.2. Template for HDF5 structures</a></li>
<li><a href="#org26a5b56">1.3. Template for HDF5 init/deinit</a></li>
<li><a href="#org74e8eee">1.4. Template for HDF5 has/read/write a number</a></li>
<li><a href="#orgac32969">1.5. Template for HDF5 has/read/write a dataset</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-orgd9d1f81" class="outline-2">
<h2 id="orgd9d1f81"><span class="section-number-2">1</span> HDF5 back end</h2>
<div id="outline-container-orgdc4d015" class="outline-2">
<h2 id="orgdc4d015"><span class="section-number-2">1</span> HDF5 back end</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-org59cf013" class="outline-3">
<h3 id="org59cf013"><span class="section-number-3">1.1</span> Template for HDF5 definitions</h3>
<div id="outline-container-org9452876" class="outline-3">
<h3 id="org9452876"><span class="section-number-3">1.1</span> Template for HDF5 definitions</h3>
<div class="outline-text-3" id="text-1-1">
<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>
<span style="color: #483d8b;">#define</span> $GROUP_NUM$_NAME <span style="color: #8b2252;">"$group_num$"</span>
<span style="color: #483d8b;">#define</span> $GROUP$_$GROUP_DSET$_NAME <span style="color: #8b2252;">"$group_dset$"</span>
<span style="color: #483d8b;">#define</span> $GROUP_DSET$_NAME <span style="color: #8b2252;">"$group_dset$"</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org5d29550" class="outline-3">
<h3 id="org5d29550"><span class="section-number-3">1.2</span> Template for HDF5 structures</h3>
<div id="outline-container-org81f4b6d" class="outline-3">
<h3 id="org81f4b6d"><span class="section-number-3">1.2</span> Template for HDF5 structures</h3>
<div class="outline-text-3" id="text-1-2">
<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> {
@ -356,8 +356,8 @@ for the JavaScript code in this tag.
</div>
<div id="outline-container-orga4e301d" class="outline-3">
<h3 id="orga4e301d"><span class="section-number-3">1.3</span> Template for HDF5 init/deinit</h3>
<div id="outline-container-org26a5b56" class="outline-3">
<h3 id="org26a5b56"><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="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -440,8 +440,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-orgb37b35d" class="outline-3">
<h3 id="orgb37b35d"><span class="section-number-3">1.4</span> Template for HDF5 has/read/write a number</h3>
<div id="outline-container-org74e8eee" class="outline-3">
<h3 id="org74e8eee"><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="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -563,12 +563,12 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-org0cf72a1" class="outline-3">
<h3 id="org0cf72a1"><span class="section-number-3">1.5</span> Template for HDF5 has/read/write a dataset</h3>
<div id="outline-container-orgac32969" class="outline-3">
<h3 id="orgac32969"><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="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_hdf5_read_$group$_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_dset_dtype$* <span style="color: #a020f0;">const</span> $group_dset$,
<span style="color: #0000ff;">trexio_hdf5_read_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_dset_dtype$* <span style="color: #a020f0;">const</span> $group_dset$,
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">rank</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint64_t</span>* <span style="color: #a0522d;">dims</span>)
{
@ -580,14 +580,14 @@ for the JavaScript code in this tag.
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span>;
<span style="color: #228b22;">int</span> <span style="color: #a0522d;">rrank</span>;
// <span style="color: #b22222;">get the rank of the dataset in a file</span>
status = H5LTget_dataset_ndims (f-&gt;$group$_group, $GROUP$_$GROUP_DSET$_NAME, &amp;rrank);
status = H5LTget_dataset_ndims (f-&gt;$group$_group, $GROUP_DSET$_NAME, &amp;rrank);
<span style="color: #a020f0;">if</span> (status &lt; 0) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
<span style="color: #a020f0;">if</span> (rrank != (<span style="color: #228b22;">int</span>) rank) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_3;
// <span style="color: #b22222;">open the dataset to get its dimensions</span>
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dset_id</span> = H5Dopen(f-&gt;$group$_group, $GROUP$_$GROUP_DSET$_NAME, H5P_DEFAULT);
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dset_id</span> = H5Dopen(f-&gt;$group$_group, $GROUP_DSET$_NAME, H5P_DEFAULT);
<span style="color: #a020f0;">if</span> (dset_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
// <span style="color: #b22222;">allocate space for the dimensions to be read</span>
@ -613,7 +613,7 @@ for the JavaScript code in this tag.
/* <span style="color: #b22222;">High-level H5LT API. No need to deal with dataspaces and datatypes </span>*/
status = H5LTread_dataset(f-&gt;$group$_group,
$GROUP$_$GROUP_DSET$_NAME,
$GROUP_DSET$_NAME,
H5T_NATIVE_$GROUP_DSET_H5_DTYPE$,
$group_dset$);
<span style="color: #a020f0;">if</span> (status &lt; 0) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
@ -625,7 +625,7 @@ for the JavaScript code in this tag.
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_hdf5_write_$group$_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> $group_dset_dtype$* $group_dset$,
<span style="color: #0000ff;">trexio_hdf5_write_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #a020f0;">const</span> $group_dset_dtype$* $group_dset$,
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">rank</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint64_t</span>* <span style="color: #a0522d;">dims</span>)
{
@ -640,10 +640,10 @@ for the JavaScript code in this tag.
<span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a0522d;">f</span> = (<span style="color: #228b22;">trexio_hdf5_t</span>*) file;
<span style="color: #a020f0;">if</span> ( H5LTfind_dataset(f-&gt;$group$_group, $GROUP$_$GROUP_DSET$_NAME) != 1 ) {
<span style="color: #a020f0;">if</span> ( H5LTfind_dataset(f-&gt;$group$_group, $GROUP_DSET$_NAME) != 1 ) {
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5LTmake_dataset(f-&gt;$group$_group,
$GROUP$_$GROUP_DSET$_NAME,
$GROUP_DSET$_NAME,
(<span style="color: #228b22;">int</span>) rank, (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hsize_t</span>*) dims,
H5T_NATIVE_$GROUP_DSET_H5_DTYPE$,
$group_dset$);
@ -651,7 +651,7 @@ for the JavaScript code in this tag.
} <span style="color: #a020f0;">else</span> {
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dset_id</span> = H5Dopen(f-&gt;$group$_group, $GROUP$_$GROUP_DSET$_NAME, H5P_DEFAULT);
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dset_id</span> = H5Dopen(f-&gt;$group$_group, $GROUP_DSET$_NAME, H5P_DEFAULT);
<span style="color: #a020f0;">if</span> (dset_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5Dwrite(dset_id,
@ -672,14 +672,14 @@ for the JavaScript code in this tag.
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_hdf5_has_$group$_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>)
<span style="color: #0000ff;">trexio_hdf5_has_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</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_INVALID_ARG_1;
<span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a0522d;">f</span> = (<span style="color: #228b22;">trexio_hdf5_t</span>*) file;
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5LTfind_dataset(f-&gt;$group$_group, $GROUP$_$GROUP_DSET$_NAME);
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5LTfind_dataset(f-&gt;$group$_group, $GROUP_DSET$_NAME);
/* <span style="color: #b22222;">H5LTfind_dataset returns 1 if dataset exists, 0 otherwise </span>*/
<span style="color: #a020f0;">if</span> (status == 1){
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
@ -698,7 +698,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-05-24 Mon 22:02</p>
<p class="date">Created: 2021-05-26 Wed 17:12</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-05-24 Mon 22:02 -->
<!-- 2021-05-26 Wed 17:12 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TEXT back end</title>
@ -311,24 +311,24 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgf64dd42">1. TEXT back end</a>
<li><a href="#org0039b92">1. TEXT back end</a>
<ul>
<li><a href="#orgf8eb90e">1.1. Template for group-related structures in text back end</a></li>
<li><a href="#org186e202">1.2. Template for general structure in text back end</a></li>
<li><a href="#org334018b">1.3. Initialize function (constant part)</a></li>
<li><a href="#org5ce7e06">1.4. Deinitialize function (templated part)</a></li>
<li><a href="#org40eb616">1.5. Template for text read struct</a></li>
<li><a href="#org332e8d5">1.6. Template for text flush struct</a></li>
<li><a href="#orgba81a42">1.7. Template for text free memory</a></li>
<li><a href="#org953f59a">1.8. Template for has/read/write the <code>$group_num$</code> attribute</a></li>
<li><a href="#org4f2716e">1.9. Template for has/read/write the <code>$group_dset$</code> dataset</a></li>
<li><a href="#org6034fdc">1.10. RDM struct (hard-coded)</a>
<li><a href="#org94d2cbd">1.1. Template for group-related structures in text back end</a></li>
<li><a href="#orgb535277">1.2. Template for general structure in text back end</a></li>
<li><a href="#org3bd4317">1.3. Initialize function (constant part)</a></li>
<li><a href="#orga4a0240">1.4. Deinitialize function (templated part)</a></li>
<li><a href="#org4352d21">1.5. Template for text read struct</a></li>
<li><a href="#org0e60e24">1.6. Template for text flush struct</a></li>
<li><a href="#org4c5c754">1.7. Template for text free memory</a></li>
<li><a href="#org434846f">1.8. Template for has/read/write the <code>$group_num$</code> attribute</a></li>
<li><a href="#org4d5c063">1.9. Template for has/read/write the <code>$group_dset$</code> dataset</a></li>
<li><a href="#org31d4dc3">1.10. RDM struct (hard-coded)</a>
<ul>
<li><a href="#org64cd129">1.10.1. Read the complete struct</a></li>
<li><a href="#org1b0d854">1.10.2. Flush the complete struct</a></li>
<li><a href="#orgf44bbdd">1.10.3. Free memory</a></li>
<li><a href="#orga35603f">1.10.4. Read/Write the one<sub>e</sub> attribute</a></li>
<li><a href="#org8b8b525">1.10.5. Read/Write the two<sub>e</sub> attribute</a></li>
<li><a href="#orgfebac61">1.10.1. Read the complete struct</a></li>
<li><a href="#orgb8d1e0d">1.10.2. Flush the complete struct</a></li>
<li><a href="#org45ac446">1.10.3. Free memory</a></li>
<li><a href="#orgabfff13">1.10.4. Read/Write the one<sub>e</sub> attribute</a></li>
<li><a href="#org5cf5e93">1.10.5. Read/Write the two<sub>e</sub> attribute</a></li>
</ul>
</li>
</ul>
@ -337,8 +337,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-orgf64dd42" class="outline-2">
<h2 id="orgf64dd42"><span class="section-number-2">1</span> TEXT back end</h2>
<div id="outline-container-org0039b92" class="outline-2">
<h2 id="org0039b92"><span class="section-number-2">1</span> TEXT back end</h2>
<div class="outline-text-2" id="text-1">
<p>
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>
</div>
<div id="outline-container-orgf8eb90e" class="outline-3">
<h3 id="orgf8eb90e"><span class="section-number-3">1.1</span> Template for group-related structures in text back end</h3>
<div id="outline-container-org94d2cbd" class="outline-3">
<h3 id="org94d2cbd"><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="org-src-container">
<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 id="outline-container-org186e202" class="outline-3">
<h3 id="org186e202"><span class="section-number-3">1.2</span> Template for general structure in text back end</h3>
<div id="outline-container-orgb535277" class="outline-3">
<h3 id="orgb535277"><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="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> {
@ -403,8 +403,8 @@ The file is written when closed, or when the flush function is called.
</div>
</div>
<div id="outline-container-org334018b" class="outline-3">
<h3 id="org334018b"><span class="section-number-3">1.3</span> Initialize function (constant part)</h3>
<div id="outline-container-org3bd4317" class="outline-3">
<h3 id="org3bd4317"><span class="section-number-3">1.3</span> Initialize function (constant part)</h3>
<div class="outline-text-3" id="text-1-3">
<div class="org-src-container">
<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 id="outline-container-org5ce7e06" class="outline-3">
<h3 id="org5ce7e06"><span class="section-number-3">1.4</span> Deinitialize function (templated part)</h3>
<div id="outline-container-orga4a0240" class="outline-3">
<h3 id="orga4a0240"><span class="section-number-3">1.4</span> Deinitialize function (templated part)</h3>
<div class="outline-text-3" id="text-1-4">
<div class="org-src-container">
<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 id="outline-container-org40eb616" class="outline-3">
<h3 id="org40eb616"><span class="section-number-3">1.5</span> Template for text read struct</h3>
<div id="outline-container-org4352d21" class="outline-3">
<h3 id="org4352d21"><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="org-src-container">
<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 id="outline-container-org332e8d5" class="outline-3">
<h3 id="org332e8d5"><span class="section-number-3">1.6</span> Template for text flush struct</h3>
<div id="outline-container-org0e60e24" class="outline-3">
<h3 id="org0e60e24"><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="org-src-container">
<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 id="outline-container-orgba81a42" class="outline-3">
<h3 id="orgba81a42"><span class="section-number-3">1.7</span> Template for text free memory</h3>
<div id="outline-container-org4c5c754" class="outline-3">
<h3 id="org4c5c754"><span class="section-number-3">1.7</span> Template for text free memory</h3>
<div class="outline-text-3" id="text-1-7">
<p>
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 id="outline-container-org953f59a" class="outline-3">
<h3 id="org953f59a"><span class="section-number-3">1.8</span> Template for has/read/write the <code>$group_num$</code> attribute</h3>
<div id="outline-container-org434846f" class="outline-3">
<h3 id="org434846f"><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="org-src-container">
<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 id="outline-container-org4f2716e" class="outline-3">
<h3 id="org4f2716e"><span class="section-number-3">1.9</span> Template for has/read/write the <code>$group_dset$</code> dataset</h3>
<div id="outline-container-org4d5c063" class="outline-3">
<h3 id="org4d5c063"><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">
<p>
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 id="outline-container-org6034fdc" class="outline-3">
<h3 id="org6034fdc"><span class="section-number-3">1.10</span> RDM struct (hard-coded)</h3>
<div id="outline-container-org31d4dc3" class="outline-3">
<h3 id="org31d4dc3"><span class="section-number-3">1.10</span> RDM struct (hard-coded)</h3>
<div class="outline-text-3" id="text-1-10">
</div>
<div id="outline-container-org64cd129" class="outline-4">
<h4 id="org64cd129"><span class="section-number-4">1.10.1</span> Read the complete struct</h4>
<div id="outline-container-orgfebac61" class="outline-4">
<h4 id="orgfebac61"><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="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>);
@ -1056,8 +1056,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div>
</div>
<div id="outline-container-org1b0d854" class="outline-4">
<h4 id="org1b0d854"><span class="section-number-4">1.10.2</span> Flush the complete struct</h4>
<div id="outline-container-orgb8d1e0d" class="outline-4">
<h4 id="orgb8d1e0d"><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="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>);
@ -1099,8 +1099,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div>
</div>
<div id="outline-container-orgf44bbdd" class="outline-4">
<h4 id="orgf44bbdd"><span class="section-number-4">1.10.3</span> Free memory</h4>
<div id="outline-container-org45ac446" class="outline-4">
<h4 id="org45ac446"><span class="section-number-4">1.10.3</span> Free memory</h4>
<div class="outline-text-4" id="text-1-10-3">
<p>
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 id="outline-container-orga35603f" class="outline-4">
<h4 id="orga35603f"><span class="section-number-4">1.10.4</span> Read/Write the one<sub>e</sub> attribute</h4>
<div id="outline-container-orgabfff13" class="outline-4">
<h4 id="orgabfff13"><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">
<p>
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 id="outline-container-org8b8b525" class="outline-4">
<h4 id="org8b8b525"><span class="section-number-4">1.10.5</span> Read/Write the two<sub>e</sub> attribute</h4>
<div id="outline-container-org5cf5e93" class="outline-4">
<h4 id="org5cf5e93"><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">
<p>
<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 id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-05-24 Mon 22:02</p>
<p class="date">Created: 2021-05-26 Wed 17:12</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>