1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>HDF5: Single Writer Multiple Readers</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="hdf5doxy.css" rel="stylesheet" type="text/css">
<!-- <link href="hdf5doxy.css" rel="stylesheet" type="text/css"/>
-->
<script type="text/javascript" src="hdf5_navtree_hacks.js"></script>
</head>
<body>
<div style="background:#FFDDDD;font-size:120%;text-align:center;margin:0;padding:5px">Please, help us to better serve our user community by answering the following short survey: <a href="https://www.hdfgroup.org/website-survey/">https://www.hdfgroup.org/website-survey/</a></div>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="HDFG-logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname"><a href="https://www.hdfgroup.org">HDF5</a>
 <span id="projectnumber">1.15.0.4261552</span>
</div>
<div id="projectbrief">API Reference</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.svg"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group___s_w_m_r.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Single Writer Multiple Readers<div class="ingroups"><a class="el" href="group___h5_f.html">Files (H5F)</a></div></div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Collaboration diagram for Single Writer Multiple Readers:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="group___s_w_m_r.png" border="0" usemap="#agroup______s__w__m__r" alt=""/></div>
<map name="agroup______s__w__m__r" id="agroup______s__w__m__r">
<area shape="rect" href="group___h5_f.html" title=" " alt="" coords="5,13,97,38"/>
<area shape="rect" title=" " alt="" coords="145,5,308,45"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaa80bd62f19993e414e383db7d1623e5f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_w_m_r.html#gaa80bd62f19993e414e383db7d1623e5f">H5Fget_metadata_read_retry_info</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> file_id, <a class="el" href="struct_h5_f__retry__info__t.html">H5F_retry_info_t</a> *info)</td></tr>
<tr class="memdesc:gaa80bd62f19993e414e383db7d1623e5f"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the collection of read retries for metadata entries with checksum. <a href="group___s_w_m_r.html#gaa80bd62f19993e414e383db7d1623e5f">More...</a><br /></td></tr>
<tr class="separator:gaa80bd62f19993e414e383db7d1623e5f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga159be34fbe7e4a959589310ef0196dfe"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_w_m_r.html#ga159be34fbe7e4a959589310ef0196dfe">H5Fstart_swmr_write</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> file_id)</td></tr>
<tr class="memdesc:ga159be34fbe7e4a959589310ef0196dfe"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves free-space section information for a file. <a href="group___s_w_m_r.html#ga159be34fbe7e4a959589310ef0196dfe">More...</a><br /></td></tr>
<tr class="separator:ga159be34fbe7e4a959589310ef0196dfe"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaa80bd62f19993e414e383db7d1623e5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa80bd62f19993e414e383db7d1623e5f">◆ </a></span>H5Fget_metadata_read_retry_info()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5Fget_metadata_read_retry_info </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> </td>
<td class="paramname"><em>file_id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_h5_f__retry__info__t.html">H5F_retry_info_t</a> * </td>
<td class="paramname"><em>info</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the collection of read retries for metadata entries with checksum. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">file_id</td><td>File identifier </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">info</td><td>Struct containing the collection of read retries for metadata entries with checksum </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.<br />
</dd></dl>
<p><b>Failure Modes:</b> </p><ul>
<li>When the input identifier is not a file identifier. </li>
<li>When the pointer to the output structure is NULL. </li>
<li>When the memory allocation for <code>retries</code> failed.</li>
</ul>
<p><a class="el" href="group___s_w_m_r.html#gaa80bd62f19993e414e383db7d1623e5f" title="Retrieves the collection of read retries for metadata entries with checksum.">H5Fget_metadata_read_retry_info()</a> retrieves information regarding the number of read retries for metadata entries with checksum for the file <code>file_id</code>. This information is reported in the <a class="el" href="struct_h5_f__retry__info__t.html">H5F_retry_info_t</a> struct defined in <a class="el" href="_h5_fpublic_8h.html">H5Fpublic.h</a> as follows: </p><div class="fragment"><div class="line"><span class="preprocessor">#define H5F_NUM_METADATA_READ_RETRY_TYPES 21</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct_h5_f__retry__info__t.html">H5F_retry_info_t</a> {</div>
<div class="line"> <span class="keywordtype">unsigned</span> <a class="code" href="struct_h5_f__retry__info__t.html#aa86f48adcf8ee5bbe9d05ae595130544">nbins</a>;</div>
<div class="line"> uint32_t *<a class="code" href="struct_h5_f__retry__info__t.html#a9ed64b2becff4cade9713b0cd9f3827e">retries</a>[<a class="code" href="_h5_fpublic_8h.html#a3a67d0d121762e7c44c4ef3f40a49611">H5F_NUM_METADATA_READ_RETRY_TYPES</a>];</div>
<div class="line">} <a class="code" href="struct_h5_f__retry__info__t.html">H5F_retry_info_t</a>;</div>
<div class="ttc" id="a_h5_fpublic_8h_html_a3a67d0d121762e7c44c4ef3f40a49611"><div class="ttname"><a href="_h5_fpublic_8h.html#a3a67d0d121762e7c44c4ef3f40a49611">H5F_NUM_METADATA_READ_RETRY_TYPES</a></div><div class="ttdeci">#define H5F_NUM_METADATA_READ_RETRY_TYPES</div><div class="ttdef"><b>Definition:</b> H5Fpublic.h:228</div></div>
<div class="ttc" id="astruct_h5_f__retry__info__t_html"><div class="ttname"><a href="struct_h5_f__retry__info__t.html">H5F_retry_info_t</a></div><div class="ttdef"><b>Definition:</b> H5Fpublic.h:234</div></div>
<div class="ttc" id="astruct_h5_f__retry__info__t_html_a9ed64b2becff4cade9713b0cd9f3827e"><div class="ttname"><a href="struct_h5_f__retry__info__t.html#a9ed64b2becff4cade9713b0cd9f3827e">H5F_retry_info_t::retries</a></div><div class="ttdeci">uint32_t * retries[21]</div><div class="ttdef"><b>Definition:</b> H5Fpublic.h:236</div></div>
<div class="ttc" id="astruct_h5_f__retry__info__t_html_aa86f48adcf8ee5bbe9d05ae595130544"><div class="ttname"><a href="struct_h5_f__retry__info__t.html#aa86f48adcf8ee5bbe9d05ae595130544">H5F_retry_info_t::nbins</a></div><div class="ttdeci">unsigned nbins</div><div class="ttdef"><b>Definition:</b> H5Fpublic.h:235</div></div>
</div><!-- fragment --><p> <code>nbins</code> is the number of bins for each <code>retries</code>[i] of metadata entry <code>i</code>. It is calculated based on the current number of read attempts used in the library and logarithmic base 10.</p>
<p>If read retries are incurred for a metadata entry <code>i</code>, the library will allocate memory for <code>retries[i] (nbins * sizeof(uint32_t)</code> and store the collection of retries there. If there are no retries for a metadata entry <code>i</code>, <code>retries[i]</code> will be NULL. After a call to this routine, users should free each <code>retries[i]</code> that is non-NULL, otherwise resource leak will occur.</p>
<p>For the library default read attempts of 100 for SWMR access, nbins will be 2 as depicted below: </p><ul>
<li><code>retries[i][0]</code> is the number of 1 to 9 read retries. </li>
<li><code>retries[i][1]</code> is the number of 10 to 99 read retries. For the library default read attempts of 1 for non-SWMR access, <code>nbins</code> will be 0 and each <code>retries[i]</code> will be NULL.</li>
</ul>
<p>The following table lists the 21 metadata entries of <code>retries[]</code>: </p><table class="doxtable">
<tr>
<th>Index for <code>retries[]</code> </th><th>Metadata entries<sup>*</sup> </th></tr>
<tr>
<td>0</td><td>Object header (version 2) </td></tr>
<tr>
<td>1</td><td>Object header chunk (version 2) </td></tr>
<tr>
<td>2</td><td>B-tree header (version 2) </td></tr>
<tr>
<td>3</td><td>B-tree internal node (version 2) </td></tr>
<tr>
<td>4</td><td>B-tree leaf node (version 2) </td></tr>
<tr>
<td>5</td><td>Fractal heap header </td></tr>
<tr>
<td>6</td><td>Fractal heap direct block (optional checksum) </td></tr>
<tr>
<td>7</td><td>Fractal heap indirect block </td></tr>
<tr>
<td>8</td><td>Free-space header </td></tr>
<tr>
<td>9</td><td>Free-space sections </td></tr>
<tr>
<td>10</td><td>Shared object header message table </td></tr>
<tr>
<td>11</td><td>Shared message record list </td></tr>
<tr>
<td>12</td><td>Extensive array header </td></tr>
<tr>
<td>13</td><td>Extensive array index block </td></tr>
<tr>
<td>14</td><td>Extensive array super block </td></tr>
<tr>
<td>15</td><td>Extensive array data block </td></tr>
<tr>
<td>16</td><td>Extensive array data block page </td></tr>
<tr>
<td>17</td><td>Fixed array super block </td></tr>
<tr>
<td>18</td><td>Fixed array data block </td></tr>
<tr>
<td>19</td><td>Fixed array data block page </td></tr>
<tr>
<td>20</td><td>File's superblock (version 2) </td></tr>
<tr>
<td colspan="2"><sup>*</sup> All entries are of version 0 (zero) unless indicated otherwise. </td></tr>
</table>
<dl class="section note"><dt>Note</dt><dd>On a system that is not atomic, the library might possibly read inconsistent metadata with checksum when performing single-writer/multiple-reader (SWMR) operations for an HDF5 file. Upon encountering such situations, the library will try reading the metadata again for a set number of times to attempt to obtain consistent data. The maximum number of read attempts used by the library will be either the value set via <a class="el" href="group___f_a_p_l.html#gab827cef16ec569c87cec94a8b3f350c5" title="Sets the number of read attempts in a file access property list.">H5Pset_metadata_read_attempts()</a> or the library default value when a value is not set.<br />
When the current number of metadata read attempts used in the library is unable to remedy the reading of inconsistent metadata on a system, the user can assess the information obtained via this routine to derive a different maximum value. The information can also be helpful for debugging purposes to identify potential issues with metadata flush dependencies and SWMR implementation in general.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>1.10.0 </dd></dl>
</div>
</div>
<a id="ga159be34fbe7e4a959589310ef0196dfe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga159be34fbe7e4a959589310ef0196dfe">◆ </a></span>H5Fstart_swmr_write()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5Fstart_swmr_write </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> </td>
<td class="paramname"><em>file_id</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves free-space section information for a file. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">file_id</td><td>File identifier</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="group___s_w_m_r.html#ga159be34fbe7e4a959589310ef0196dfe" title="Retrieves free-space section information for a file.">H5Fstart_swmr_write()</a> will activate SWMR writing mode for a file associated with <code>file_id</code>. This routine will prepare and ensure the file is safe for SWMR writing as follows: </p><ul>
<li>Check that the file is opened with write access (<a class="el" href="_h5_fpublic_8h.html#a402673dec5c537b27a49a9a8bd6140b4">H5F_ACC_RDWR</a>). </li>
<li>Check that the file is opened with the latest library format to ensure data structures with check-summed metadata are used. </li>
<li>Check that the file is not already marked in SWMR writing mode. </li>
<li>Enable reading retries for check-summed metadata to remedy possible checksum failures from reading inconsistent metadata on a system that is not atomic. </li>
<li>Turn off usage of the library's accumulator to avoid possible ordering problem on a system that is not atomic. </li>
<li>Perform a flush of the file's data buffers and metadata to set a consistent state for starting SWMR write operations.</li>
</ul>
<p>Library objects are groups, datasets, and committed datatypes. For the current implementation, groups and datasets can remain open when activating SWMR writing mode, but not committed datatypes. Attributes attached to objects cannot remain open either.</p>
<dl class="section since"><dt>Since</dt><dd>1.10.0 </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>
|