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 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
|
<!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.8"/>
<title>Hardware Locality (hwloc): Manipulating Object Type, Sets and Attributes as 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 style="padding-left: 0.5em;">
<div id="projectname">Hardware Locality (hwloc)
 <span id="projectnumber">1.10.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Manipulating Object Type, Sets and Attributes as 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="a00079.html#ga5ca0bf94bbbb080d0eff17a57bd90422">hwloc_obj_type_string</a> (<a class="el" href="a00074.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a> type)</td></tr>
<tr class="separator:ga5ca0bf94bbbb080d0eff17a57bd90422"><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="a00079.html#ga8f8452fa8e707cad59b8a73a6fa06059">hwloc_obj_type_sscanf</a> (const char *string, <a class="el" href="a00074.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>
<tr class="memitem:gadb8765c260edea80c52cd06a76639ba4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00079.html#gadb8765c260edea80c52cd06a76639ba4">hwloc_obj_type_snprintf</a> (char *restrict string, size_t size, <a class="el" href="a00075.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="a00079.html#ga870e876931c282a1c7aee2f031912ce3">hwloc_obj_attr_snprintf</a> (char *restrict string, size_t size, <a class="el" href="a00075.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="a00079.html#ga8e0472dfa655c68c0c9072e1ee3a1e03">hwloc_obj_cpuset_snprintf</a> (char *restrict str, size_t size, size_t nobj, const <a class="el" href="a00075.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> *restrict objs)</td></tr>
<tr class="separator:ga8e0472dfa655c68c0c9072e1ee3a1e03"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gab358661a92bb27d8542b255cc9f6f25e"><td class="memItemLeft" align="right" valign="top">static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00079.html#gab358661a92bb27d8542b255cc9f6f25e">hwloc_obj_get_info_by_name</a> (<a class="el" href="a00075.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> obj, const char *name)</td></tr>
<tr class="separator:gab358661a92bb27d8542b255cc9f6f25e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga7e90c5398a9d77df31d7d45faf0f316b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00079.html#ga7e90c5398a9d77df31d7d45faf0f316b">hwloc_obj_add_info</a> (<a class="el" href="a00075.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> obj, const char *name, const char *value)</td></tr>
<tr class="separator:ga7e90c5398a9d77df31d7d45faf0f316b"><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 class="anchor" id="ga7e90c5398a9d77df31d7d45faf0f316b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void hwloc_obj_add_info </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00075.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 * </td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add the given info name and value pair to the given object. </p>
<p>The info is appended to the existing info array even if another key with the same name already exists.</p>
<p>The input strings are copied before being added in the object infos.</p>
<dl class="section note"><dt>Note</dt><dd>This function may be used to enforce object colors in the lstopo graphical output by using "lstopoStyle" as a name and "Background=#rrggbb" as a value. See CUSTOM COLORS in the lstopo(1) manpage for details.</dd>
<dd>
If <code>value</code> contains some non-printable characters, they will be dropped when exporting to XML, see <a class="el" href="a00084.html#ga2bf166eda4d3605362ac86f77684002a" title="Export the topology into an XML file. ">hwloc_topology_export_xml()</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="ga870e876931c282a1c7aee2f031912ce3"></a>
<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="a00075.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 class="anchor" id="ga8e0472dfa655c68c0c9072e1ee3a1e03"></a>
<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="a00075.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 class="anchor" id="gab358661a92bb27d8542b255cc9f6f25e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static const char* hwloc_obj_get_info_by_name </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00075.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 * </td>
<td class="paramname"><em>name</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Search the given key name in object infos and return the corresponding value. </p>
<p>If multiple keys match the given name, only the first one is returned.</p>
<dl class="section return"><dt>Returns</dt><dd><code>NULL</code> if no such key exists. </dd></dl>
</div>
</div>
<a class="anchor" id="gadb8765c260edea80c52cd06a76639ba4"></a>
<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="a00075.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>It differs from <a class="el" href="a00079.html#ga5ca0bf94bbbb080d0eff17a57bd90422" title="Return a stringified topology object type. ">hwloc_obj_type_string()</a> because it prints type attributes such as cache depth and type.</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 class="anchor" id="ga8f8452fa8e707cad59b8a73a6fa06059"></a>
<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="a00074.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 "socket" or "cache" into the corresponding types. Matching is case-insensitive, and only the first letters are actually required to match.</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>typeattrd</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 class="anchor" id="ga5ca0bf94bbbb080d0eff17a57bd90422"></a>
<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="a00074.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 stringified topology object type. </p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Oct 7 2014 11:56:52 for Hardware Locality (hwloc) by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
|