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.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Locality (hwloc): Converting between Object Types, Sets and Attributes, and Strings</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="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<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="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Hardware Locality (hwloc)
 <span id="projectnumber">1.11.5</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Converting between Object Types, Sets and Attributes, and Strings</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga5ca0bf94bbbb080d0eff17a57bd90422"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00168.html#ga5ca0bf94bbbb080d0eff17a57bd90422">hwloc_obj_type_string</a> (<a class="el" href="a00163.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a> type)</td></tr>
<tr class="separator:ga5ca0bf94bbbb080d0eff17a57bd90422"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gadb8765c260edea80c52cd06a76639ba4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00168.html#gadb8765c260edea80c52cd06a76639ba4">hwloc_obj_type_snprintf</a> (char *restrict string, size_t size, <a class="el" href="a00164.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> obj, int verbose)</td></tr>
<tr class="separator:gadb8765c260edea80c52cd06a76639ba4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga870e876931c282a1c7aee2f031912ce3"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00168.html#ga870e876931c282a1c7aee2f031912ce3">hwloc_obj_attr_snprintf</a> (char *restrict string, size_t size, <a class="el" href="a00164.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> obj, const char *restrict separator, int verbose)</td></tr>
<tr class="separator:ga870e876931c282a1c7aee2f031912ce3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga8e0472dfa655c68c0c9072e1ee3a1e03"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00168.html#ga8e0472dfa655c68c0c9072e1ee3a1e03">hwloc_obj_cpuset_snprintf</a> (char *restrict str, size_t size, size_t nobj, const <a class="el" href="a00164.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> *restrict objs)</td></tr>
<tr class="separator:ga8e0472dfa655c68c0c9072e1ee3a1e03"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga8f8452fa8e707cad59b8a73a6fa06059"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00168.html#ga8f8452fa8e707cad59b8a73a6fa06059">hwloc_obj_type_sscanf</a> (const char *string, <a class="el" href="a00163.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a> *typep, int *depthattrp, void *typeattrp, size_t typeattrsize)</td></tr>
<tr class="separator:ga8f8452fa8e707cad59b8a73a6fa06059"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga870e876931c282a1c7aee2f031912ce3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga870e876931c282a1c7aee2f031912ce3">§ </a></span>hwloc_obj_attr_snprintf()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_obj_attr_snprintf </td>
<td>(</td>
<td class="paramtype">char *restrict </td>
<td class="paramname"><em>string</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00164.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td>
<td class="paramname"><em>obj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *restrict </td>
<td class="paramname"><em>separator</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>verbose</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Stringify the attributes of a given topology object into a human-readable form. </p>
<p>Attribute values are separated by <code>separator</code>.</p>
<p>Only the major attributes are printed in non-verbose mode.</p>
<p>If <code>size</code> is 0, <code>string</code> may safely be <code>NULL</code>.</p>
<dl class="section return"><dt>Returns</dt><dd>the number of character that were actually written if not truncating, or that would have been written (not including the ending \0). </dd></dl>
</div>
</div>
<a id="ga8e0472dfa655c68c0c9072e1ee3a1e03"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8e0472dfa655c68c0c9072e1ee3a1e03">§ </a></span>hwloc_obj_cpuset_snprintf()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_obj_cpuset_snprintf </td>
<td>(</td>
<td class="paramtype">char *restrict </td>
<td class="paramname"><em>str</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>nobj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="a00164.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> *restrict </td>
<td class="paramname"><em>objs</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Stringify the cpuset containing a set of objects. </p>
<p>If <code>size</code> is 0, <code>string</code> may safely be <code>NULL</code>.</p>
<dl class="section return"><dt>Returns</dt><dd>the number of character that were actually written if not truncating, or that would have been written (not including the ending \0). </dd></dl>
</div>
</div>
<a id="gadb8765c260edea80c52cd06a76639ba4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadb8765c260edea80c52cd06a76639ba4">§ </a></span>hwloc_obj_type_snprintf()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_obj_type_snprintf </td>
<td>(</td>
<td class="paramtype">char *restrict </td>
<td class="paramname"><em>string</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00164.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td>
<td class="paramname"><em>obj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>verbose</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Stringify the type of a given topology object into a human-readable form. </p>
<p>Contrary to <a class="el" href="a00168.html#ga5ca0bf94bbbb080d0eff17a57bd90422" title="Return a constant stringified object type. ">hwloc_obj_type_string()</a>, this function includes object-specific attributes (such as the Group depth, the Bridge type, or OS device type) in the output, and it requires the caller to provide the output buffer.</p>
<p>The output is guaranteed to be the same for all objects of a same topology level.</p>
<p>If <code>size</code> is 0, <code>string</code> may safely be <code>NULL</code>.</p>
<dl class="section return"><dt>Returns</dt><dd>the number of character that were actually written if not truncating, or that would have been written (not including the ending \0). </dd></dl>
</div>
</div>
<a id="ga8f8452fa8e707cad59b8a73a6fa06059"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8f8452fa8e707cad59b8a73a6fa06059">§ </a></span>hwloc_obj_type_sscanf()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_obj_type_sscanf </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>string</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00163.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a> * </td>
<td class="paramname"><em>typep</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>depthattrp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>typeattrp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>typeattrsize</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Return an object type and attributes from a type string. </p>
<p>Convert strings such as "Package" or "Cache" into the corresponding types. Matching is case-insensitive, and only the first letters are actually required to match.</p>
<p>This function is guaranteed to match any string returned by <a class="el" href="a00168.html#ga5ca0bf94bbbb080d0eff17a57bd90422" title="Return a constant stringified object type. ">hwloc_obj_type_string()</a> or <a class="el" href="a00168.html#gadb8765c260edea80c52cd06a76639ba4" title="Stringify the type of a given topology object into a human-readable form. ">hwloc_obj_type_snprintf()</a>.</p>
<p>Types that have specific attributes, for instance caches and groups, may be returned in <code>depthattrp</code> and <code>typeattrp</code>. They are ignored when these pointers are <code>NULL</code>.</p>
<p>For instance "L2i" or "L2iCache" would return type HWLOC_OBJ_CACHE in <code>typep</code>, 2 in <code>depthattrp</code>, and HWLOC_OBJ_CACHE_TYPE_INSTRUCTION in <code>typeattrp</code> (this last pointer should point to a hwloc_obj_cache_type_t). "Group3" would return type HWLOC_OBJ_GROUP type and 3 in <code>depthattrp</code>. Attributes that are not specified in the string (for instance "Group" without a depth, or "L2Cache" without a cache type) are set to -1.</p>
<p><code>typeattrp</code> is only filled if the size specified in <code>typeattrsize</code> is large enough. It is currently only used for caches, and the required size is at least the size of hwloc_obj_cache_type_t.</p>
<dl class="section return"><dt>Returns</dt><dd>0 if a type was correctly identified, otherwise -1.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This is an extended version of the now deprecated hwloc_obj_type_of_string() </dd></dl>
</div>
</div>
<a id="ga5ca0bf94bbbb080d0eff17a57bd90422"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5ca0bf94bbbb080d0eff17a57bd90422">§ </a></span>hwloc_obj_type_string()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* hwloc_obj_type_string </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00163.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a> </td>
<td class="paramname"><em>type</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Return a constant stringified object type. </p>
<p>This function is the basic way to convert a generic type into a string.</p>
<p><a class="el" href="a00168.html#gadb8765c260edea80c52cd06a76639ba4" title="Stringify the type of a given topology object into a human-readable form. ">hwloc_obj_type_snprintf()</a> may return a more precise output for a specific object, but it requires the caller to provide the output buffer. </p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>
|