| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 5 |
<meta http-equiv="X-UA-Compatible" content="IE=11"/> |
| 6 |
<meta name="generator" content="Doxygen 1.15.0"/> |
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 8 |
<title>Hardware Locality (hwloc): The bitmap API</title> |
| 9 |
<link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 10 |
<script type="text/javascript" src="jquery.js"></script> |
| 11 |
<script type="text/javascript" src="dynsections.js"></script> |
| 12 |
<script type="text/javascript" src="clipboard.js"></script> |
| 13 |
<link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 14 |
</head> |
| 15 |
<body> |
| 16 |
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 17 |
<div id="titlearea"> |
| 18 |
<table cellspacing="0" cellpadding="0"> |
| 19 |
<tbody> |
| 20 |
<tr id="projectrow"> |
| 21 |
<td id="projectalign"> |
| 22 |
<div id="projectname">Hardware Locality (hwloc)<span id="projectnumber"> 2.14.0</span> |
| 23 |
</div> |
| 24 |
</td> |
| 25 |
</tr> |
| 26 |
</tbody> |
| 27 |
</table> |
| 28 |
</div> |
| 29 |
<!-- end header part --> |
| 30 |
<!-- Generated by Doxygen 1.15.0 --> |
| 31 |
<script type="text/javascript"> |
| 32 |
$(function() { codefold.init(); }); |
| 33 |
</script> |
| 34 |
<script type="text/javascript" src="menudata.js"></script> |
| 35 |
<script type="text/javascript" src="menu.js"></script> |
| 36 |
<script type="text/javascript"> |
| 37 |
$(function() { |
| 38 |
initMenu('',false,false,'search.php','Search',false); |
| 39 |
}); |
| 40 |
</script> |
| 41 |
<div id="main-nav"></div> |
| 42 |
</div><!-- top --> |
| 43 |
<div id="doc-content"> |
| 44 |
<div class="header"> |
| 45 |
<div class="summary"> |
| 46 |
<a href="#define-members">Macros</a> | |
| 47 |
<a href="#typedef-members">Typedefs</a> | |
| 48 |
<a href="#func-members">Functions</a> </div> |
| 49 |
<div class="headertitle"><div class="title">The bitmap API </div></div> |
| 50 |
</div><!--header--> |
| 51 |
<div class="contents"> |
| 52 |
<table class="memberdecls"> |
| 53 |
<tr class="heading"><td colspan="2"><h2 id="header-define-members" class="groupheader"><a id="define-members" name="define-members"></a> |
| 54 |
Macros</h2></td></tr> |
| 55 |
<tr class="memitem:ga3f6861045a8029ade373510ffa727d2a" id="r_ga3f6861045a8029ade373510ffa727d2a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga3f6861045a8029ade373510ffa727d2a">hwloc_bitmap_foreach_begin</a>(id, bitmap)</td></tr> |
| 56 |
<tr class="memitem:gafcf3246db406218d4e155735b3fa6528" id="r_gafcf3246db406218d4e155735b3fa6528"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="#gafcf3246db406218d4e155735b3fa6528">hwloc_bitmap_foreach_end</a>()</td></tr> |
| 57 |
</table><table class="memberdecls"> |
| 58 |
<tr class="heading"><td colspan="2"><h2 id="header-typedef-members" class="groupheader"><a id="typedef-members" name="typedef-members"></a> |
| 59 |
Typedefs</h2></td></tr> |
| 60 |
<tr class="memitem:gaa3c2bf4c776d603dcebbb61b0c923d84" id="r_gaa3c2bf4c776d603dcebbb61b0c923d84"><td class="memItemLeft" align="right" valign="top">typedef struct hwloc_bitmap_s * </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td></tr> |
| 61 |
<tr class="memitem:gae991a108af01d408be2776c5b2c467b2" id="r_gae991a108af01d408be2776c5b2c467b2"><td class="memItemLeft" align="right" valign="top">typedef const struct hwloc_bitmap_s * </td><td class="memItemRight" valign="bottom"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td></tr> |
| 62 |
</table><table class="memberdecls"> |
| 63 |
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a> |
| 64 |
Functions</h2></td></tr> |
| 65 |
<tr class="memitem:gadece3d1eb5199fc2fb99bc7dcf1ccc05" id="r_gadece3d1eb5199fc2fb99bc7dcf1ccc05"><td class="memItemLeft" align="right" valign="top"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#gadece3d1eb5199fc2fb99bc7dcf1ccc05">hwloc_bitmap_alloc</a> (void)</td></tr> |
| 66 |
<tr class="memitem:ga02853b4a224970587b9d7a0e20d857c0" id="r_ga02853b4a224970587b9d7a0e20d857c0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga02853b4a224970587b9d7a0e20d857c0">hwloc_bitmap_alloc_full</a> (void)</td></tr> |
| 67 |
<tr class="memitem:ga156130d85b3a0674d6e0e6770fe68fbe" id="r_ga156130d85b3a0674d6e0e6770fe68fbe"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga156130d85b3a0674d6e0e6770fe68fbe">hwloc_bitmap_free</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap)</td></tr> |
| 68 |
<tr class="memitem:gae679434c1a5f41d3560a8a7e2c1b0dee" id="r_gae679434c1a5f41d3560a8a7e2c1b0dee"><td class="memItemLeft" align="right" valign="top"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#gae679434c1a5f41d3560a8a7e2c1b0dee">hwloc_bitmap_dup</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 69 |
<tr class="memitem:ga72a29824798b48784b8217471ec8f14c" id="r_ga72a29824798b48784b8217471ec8f14c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga72a29824798b48784b8217471ec8f14c">hwloc_bitmap_copy</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> dst, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> src)</td></tr> |
| 70 |
<tr class="memitem:ga9511644657030a021dce9941e3cda583" id="r_ga9511644657030a021dce9941e3cda583"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga9511644657030a021dce9941e3cda583">hwloc_bitmap_snprintf</a> (char *restrict buf, size_t buflen, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 71 |
<tr class="memitem:ga0fece972134fdecf2da9bc7a11dd827e" id="r_ga0fece972134fdecf2da9bc7a11dd827e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga0fece972134fdecf2da9bc7a11dd827e">hwloc_bitmap_asprintf</a> (char **strp, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 72 |
<tr class="memitem:ga064a85c643a364b60acbfa0f3663fc18" id="r_ga064a85c643a364b60acbfa0f3663fc18"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga064a85c643a364b60acbfa0f3663fc18">hwloc_bitmap_sscanf</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, const char *restrict string)</td></tr> |
| 73 |
<tr class="memitem:ga3d06e6447edeb61e56a9ad83f31f0a37" id="r_ga3d06e6447edeb61e56a9ad83f31f0a37"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga3d06e6447edeb61e56a9ad83f31f0a37">hwloc_bitmap_list_snprintf</a> (char *restrict buf, size_t buflen, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 74 |
<tr class="memitem:ga39c0f1b02053de66d205c9f8260b3665" id="r_ga39c0f1b02053de66d205c9f8260b3665"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga39c0f1b02053de66d205c9f8260b3665">hwloc_bitmap_list_asprintf</a> (char **strp, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 75 |
<tr class="memitem:gaf9314311d482c621e17c6a53a9fe993e" id="r_gaf9314311d482c621e17c6a53a9fe993e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaf9314311d482c621e17c6a53a9fe993e">hwloc_bitmap_list_sscanf</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, const char *restrict string)</td></tr> |
| 76 |
<tr class="memitem:ga5beb68a987fe48e5c5edef06ab260e14" id="r_ga5beb68a987fe48e5c5edef06ab260e14"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga5beb68a987fe48e5c5edef06ab260e14">hwloc_bitmap_taskset_snprintf</a> (char *restrict buf, size_t buflen, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 77 |
<tr class="memitem:ga391312513f17c985d871f18367c59512" id="r_ga391312513f17c985d871f18367c59512"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga391312513f17c985d871f18367c59512">hwloc_bitmap_taskset_asprintf</a> (char **strp, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 78 |
<tr class="memitem:ga4f23db5041240e03e348752f8bd6ec2d" id="r_ga4f23db5041240e03e348752f8bd6ec2d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga4f23db5041240e03e348752f8bd6ec2d">hwloc_bitmap_taskset_sscanf</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, const char *restrict string)</td></tr> |
| 79 |
<tr class="memitem:gaa97c5217613c8cae9862287170ea2132" id="r_gaa97c5217613c8cae9862287170ea2132"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaa97c5217613c8cae9862287170ea2132">hwloc_bitmap_zero</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap)</td></tr> |
| 80 |
<tr class="memitem:ga07b2de8786b3cdb22f21d9dd42588275" id="r_ga07b2de8786b3cdb22f21d9dd42588275"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga07b2de8786b3cdb22f21d9dd42588275">hwloc_bitmap_fill</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap)</td></tr> |
| 81 |
<tr class="memitem:ga10be0840cdeb7ce26d862819dd303baa" id="r_ga10be0840cdeb7ce26d862819dd303baa"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga10be0840cdeb7ce26d862819dd303baa">hwloc_bitmap_only</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, unsigned id)</td></tr> |
| 82 |
<tr class="memitem:ga06d505f8a1c0a536614f65f503ee6d93" id="r_ga06d505f8a1c0a536614f65f503ee6d93"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga06d505f8a1c0a536614f65f503ee6d93">hwloc_bitmap_allbut</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, unsigned id)</td></tr> |
| 83 |
<tr class="memitem:gad59b0ebeb29c1bfabbb2a379e55c1159" id="r_gad59b0ebeb29c1bfabbb2a379e55c1159"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gad59b0ebeb29c1bfabbb2a379e55c1159">hwloc_bitmap_from_ulong</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, unsigned long mask)</td></tr> |
| 84 |
<tr class="memitem:ga4947c46d47bcfcd3faf3f59569be3e37" id="r_ga4947c46d47bcfcd3faf3f59569be3e37"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga4947c46d47bcfcd3faf3f59569be3e37">hwloc_bitmap_from_ith_ulong</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, unsigned i, unsigned long mask)</td></tr> |
| 85 |
<tr class="memitem:gabcfef22f6fc4d4b33f068dd91a1c38f5" id="r_gabcfef22f6fc4d4b33f068dd91a1c38f5"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gabcfef22f6fc4d4b33f068dd91a1c38f5">hwloc_bitmap_from_ulongs</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, unsigned nr, const unsigned long *masks)</td></tr> |
| 86 |
<tr class="memitem:ga062dbff93baeff3b425a7260c5463646" id="r_ga062dbff93baeff3b425a7260c5463646"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga062dbff93baeff3b425a7260c5463646">hwloc_bitmap_set</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, unsigned id)</td></tr> |
| 87 |
<tr class="memitem:ga9c9a8433732fb9f24899e7aa4c014d7e" id="r_ga9c9a8433732fb9f24899e7aa4c014d7e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga9c9a8433732fb9f24899e7aa4c014d7e">hwloc_bitmap_set_range</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, unsigned begin, int end)</td></tr> |
| 88 |
<tr class="memitem:ga3daeed965c35c6d2fd4820a318219985" id="r_ga3daeed965c35c6d2fd4820a318219985"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga3daeed965c35c6d2fd4820a318219985">hwloc_bitmap_set_ith_ulong</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, unsigned i, unsigned long mask)</td></tr> |
| 89 |
<tr class="memitem:gaf20bb350b6844d08931a064a73f86743" id="r_gaf20bb350b6844d08931a064a73f86743"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaf20bb350b6844d08931a064a73f86743">hwloc_bitmap_clr</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, unsigned id)</td></tr> |
| 90 |
<tr class="memitem:ga833776709df94d727f8c22304b3388cf" id="r_ga833776709df94d727f8c22304b3388cf"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga833776709df94d727f8c22304b3388cf">hwloc_bitmap_clr_range</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap, unsigned begin, int end)</td></tr> |
| 91 |
<tr class="memitem:gaa611a77c092e679246afdf9a60d5db8b" id="r_gaa611a77c092e679246afdf9a60d5db8b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaa611a77c092e679246afdf9a60d5db8b">hwloc_bitmap_singlify</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> bitmap)</td></tr> |
| 92 |
<tr class="memitem:gab6a6bae22a33ec6adfc169a953c13e6c" id="r_gab6a6bae22a33ec6adfc169a953c13e6c"><td class="memItemLeft" align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="#gab6a6bae22a33ec6adfc169a953c13e6c">hwloc_bitmap_to_ulong</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 93 |
<tr class="memitem:gac92e6404f648d6b99d2c626b05b2ffa4" id="r_gac92e6404f648d6b99d2c626b05b2ffa4"><td class="memItemLeft" align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="#gac92e6404f648d6b99d2c626b05b2ffa4">hwloc_bitmap_to_ith_ulong</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap, unsigned i)</td></tr> |
| 94 |
<tr class="memitem:gacd215a2348732de25d94a4ecd76d528c" id="r_gacd215a2348732de25d94a4ecd76d528c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gacd215a2348732de25d94a4ecd76d528c">hwloc_bitmap_to_ulongs</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap, unsigned nr, unsigned long *masks)</td></tr> |
| 95 |
<tr class="memitem:gac0744734d761d65c977aece565364908" id="r_gac0744734d761d65c977aece565364908"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gac0744734d761d65c977aece565364908">hwloc_bitmap_nr_ulongs</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 96 |
<tr class="memitem:ga11340dd487f110bb84f0a6e4ae90bd06" id="r_ga11340dd487f110bb84f0a6e4ae90bd06"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga11340dd487f110bb84f0a6e4ae90bd06">hwloc_bitmap_isset</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap, unsigned id)</td></tr> |
| 97 |
<tr class="memitem:ga5b64be28f5a7176ed8ad0d6a90bdf108" id="r_ga5b64be28f5a7176ed8ad0d6a90bdf108"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga5b64be28f5a7176ed8ad0d6a90bdf108">hwloc_bitmap_iszero</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 98 |
<tr class="memitem:ga5fdcb8c19c336511c37076d649e74af4" id="r_ga5fdcb8c19c336511c37076d649e74af4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga5fdcb8c19c336511c37076d649e74af4">hwloc_bitmap_isfull</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 99 |
<tr class="memitem:ga3ec1ced43afadf8c0a7197320bc016ed" id="r_ga3ec1ced43afadf8c0a7197320bc016ed"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga3ec1ced43afadf8c0a7197320bc016ed">hwloc_bitmap_first</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 100 |
<tr class="memitem:gaab7240b4b644693b775dad17b44ffd68" id="r_gaab7240b4b644693b775dad17b44ffd68"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaab7240b4b644693b775dad17b44ffd68">hwloc_bitmap_next</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap, int prev)</td></tr> |
| 101 |
<tr class="memitem:ga3d9b08b060a59bbab5a4ea6d0a1ed7a6" id="r_ga3d9b08b060a59bbab5a4ea6d0a1ed7a6"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga3d9b08b060a59bbab5a4ea6d0a1ed7a6">hwloc_bitmap_last</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 102 |
<tr class="memitem:ga0200466842c0e1f5da75e84dde460b10" id="r_ga0200466842c0e1f5da75e84dde460b10"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga0200466842c0e1f5da75e84dde460b10">hwloc_bitmap_weight</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 103 |
<tr class="memitem:gae408841487b288e148a478ba0465c99e" id="r_gae408841487b288e148a478ba0465c99e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gae408841487b288e148a478ba0465c99e">hwloc_bitmap_first_unset</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 104 |
<tr class="memitem:ga9653af34d1460ef106b7df25af4cdca8" id="r_ga9653af34d1460ef106b7df25af4cdca8"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga9653af34d1460ef106b7df25af4cdca8">hwloc_bitmap_next_unset</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap, int prev)</td></tr> |
| 105 |
<tr class="memitem:ga45d49aeb45c7da631b1480a93dc3fc92" id="r_ga45d49aeb45c7da631b1480a93dc3fc92"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga45d49aeb45c7da631b1480a93dc3fc92">hwloc_bitmap_last_unset</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 106 |
<tr class="memitem:ga120b8aefb9ce7ef349929656359b1859" id="r_ga120b8aefb9ce7ef349929656359b1859"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga120b8aefb9ce7ef349929656359b1859">hwloc_bitmap_or</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> res, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap1, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap2)</td></tr> |
| 107 |
<tr class="memitem:ga674533016ffed922a28b4f0b49b82cd4" id="r_ga674533016ffed922a28b4f0b49b82cd4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga674533016ffed922a28b4f0b49b82cd4">hwloc_bitmap_and</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> res, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap1, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap2)</td></tr> |
| 108 |
<tr class="memitem:ga7ca5c72db65406b85aca032c8a990f9e" id="r_ga7ca5c72db65406b85aca032c8a990f9e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga7ca5c72db65406b85aca032c8a990f9e">hwloc_bitmap_andnot</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> res, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap1, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap2)</td></tr> |
| 109 |
<tr class="memitem:ga205508218e09cb9befd0687f16409f09" id="r_ga205508218e09cb9befd0687f16409f09"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga205508218e09cb9befd0687f16409f09">hwloc_bitmap_xor</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> res, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap1, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap2)</td></tr> |
| 110 |
<tr class="memitem:ga84cfdb4f8ab8c1f7e097728e613a2a3f" id="r_ga84cfdb4f8ab8c1f7e097728e613a2a3f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga84cfdb4f8ab8c1f7e097728e613a2a3f">hwloc_bitmap_not</a> (<a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> res, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap)</td></tr> |
| 111 |
<tr class="memitem:gaefa070f9232857ba5a57297ea9a08ea2" id="r_gaefa070f9232857ba5a57297ea9a08ea2"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaefa070f9232857ba5a57297ea9a08ea2">hwloc_bitmap_intersects</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap1, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap2)</td></tr> |
| 112 |
<tr class="memitem:ga0526e03db81956fb02acc8260b66d6a4" id="r_ga0526e03db81956fb02acc8260b66d6a4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga0526e03db81956fb02acc8260b66d6a4">hwloc_bitmap_isincluded</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> sub_bitmap, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> super_bitmap)</td></tr> |
| 113 |
<tr class="memitem:ga32376b1405e57472b73c3aa53bb39663" id="r_ga32376b1405e57472b73c3aa53bb39663"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga32376b1405e57472b73c3aa53bb39663">hwloc_bitmap_isequal</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap1, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap2)</td></tr> |
| 114 |
<tr class="memitem:gaa39cda1510ab721b5c012c76ead72365" id="r_gaa39cda1510ab721b5c012c76ead72365"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaa39cda1510ab721b5c012c76ead72365">hwloc_bitmap_compare_first</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap1, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap2)</td></tr> |
| 115 |
<tr class="memitem:ga14cdbc0ef0a705e84999bd48a2e649f3" id="r_ga14cdbc0ef0a705e84999bd48a2e649f3"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga14cdbc0ef0a705e84999bd48a2e649f3">hwloc_bitmap_compare</a> (<a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap1, <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> bitmap2)</td></tr> |
| 116 |
</table> |
| 117 |
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2> |
| 118 |
<p>The <a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84" title="Set of bits represented as an opaque pointer to an internal bitmap.">hwloc_bitmap_t</a> type represents a set of integers (positive or null). A bitmap may be of infinite size (all bits are set after some point). A bitmap may even be full if all bits are set.</p> |
| 119 |
<p>Bitmaps are used by hwloc for sets of OS processors (which may actually be hardware threads) as by <a class="el" href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801" title="A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.">hwloc_cpuset_t</a> (a typedef for <a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84" title="Set of bits represented as an opaque pointer to an internal bitmap.">hwloc_bitmap_t</a>), or sets of NUMA memory nodes as <a class="el" href="a00166.html#ga37e35730fa7e775b5bb0afe893d6d508" title="A node set is a bitmap whose bits are set according to NUMA memory node physical OS indexes.">hwloc_nodeset_t</a> (also a typedef for <a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84" title="Set of bits represented as an opaque pointer to an internal bitmap.">hwloc_bitmap_t</a>). Those are used for cpuset and nodeset fields in the <a class="el" href="a00224.html" title="Structure of a topology object.">hwloc_obj</a> structure, see <a class="el" href="a00166.html">Object Sets (hwloc_cpuset_t and hwloc_nodeset_t)</a>.</p> |
| 120 |
<p><em>Both CPU and node sets are always indexed by OS physical number.</em> However users should usually not build CPU and node sets manually (e.g. with <a class="el" href="#ga062dbff93baeff3b425a7260c5463646" title="Add index id in bitmap bitmap.">hwloc_bitmap_set()</a>). One should rather use existing object sets and combine them with <a class="el" href="#ga120b8aefb9ce7ef349929656359b1859" title="Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.">hwloc_bitmap_or()</a>, etc. For instance, binding the current thread on a pair of cores may be performed with: </p><div class="fragment"><div class="line"><a class="code hl_typedef" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> core1 = ... , core2 = ... ;</div> |
| 121 |
<div class="line"><a class="code hl_typedef" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> set = <a class="code hl_function" href="#gadece3d1eb5199fc2fb99bc7dcf1ccc05">hwloc_bitmap_alloc</a>();</div> |
| 122 |
<div class="line"><a class="code hl_function" href="#ga120b8aefb9ce7ef349929656359b1859">hwloc_bitmap_or</a>(set, core1-><a class="code hl_variable" href="a00224.html#a67925e0f2c47f50408fbdb9bddd0790f">cpuset</a>, core2->cpuset);</div> |
| 123 |
<div class="line"><a class="code hl_function" href="a00173.html#ga80bc07473a8edf840cae17bd7ec21d48">hwloc_set_cpubind</a>(topology, set, <a class="code hl_enumvalue" href="a00173.html#gga217dc8d373f8958cc93c154ebce1c71caf1b6bbad00d7b1017b918e3719f4d421">HWLOC_CPUBIND_THREAD</a>);</div> |
| 124 |
<div class="line"><a class="code hl_function" href="#ga156130d85b3a0674d6e0e6770fe68fbe">hwloc_bitmap_free</a>(set);</div> |
| 125 |
<div class="ttc" id="aa00168_html_ga79b8ab56877ef99ac59b833203391c7d"><div class="ttname"><a href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a></div><div class="ttdeci">struct hwloc_obj * hwloc_obj_t</div><div class="ttdoc">Convenience typedef; a pointer to a struct hwloc_obj.</div><div class="ttdef"><b>Definition</b> hwloc.h:637</div></div> |
| 126 |
<div class="ttc" id="aa00173_html_ga80bc07473a8edf840cae17bd7ec21d48"><div class="ttname"><a href="a00173.html#ga80bc07473a8edf840cae17bd7ec21d48">hwloc_set_cpubind</a></div><div class="ttdeci">int hwloc_set_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags)</div><div class="ttdoc">Bind current process or thread on CPUs given in physical bitmap set.</div></div> |
| 127 |
<div class="ttc" id="aa00173_html_gga217dc8d373f8958cc93c154ebce1c71caf1b6bbad00d7b1017b918e3719f4d421"><div class="ttname"><a href="a00173.html#gga217dc8d373f8958cc93c154ebce1c71caf1b6bbad00d7b1017b918e3719f4d421">HWLOC_CPUBIND_THREAD</a></div><div class="ttdeci">@ HWLOC_CPUBIND_THREAD</div><div class="ttdoc">Bind current thread of current process.</div><div class="ttdef"><b>Definition</b> hwloc.h:1262</div></div> |
| 128 |
<div class="ttc" id="aa00188_html_ga120b8aefb9ce7ef349929656359b1859"><div class="ttname"><a href="#ga120b8aefb9ce7ef349929656359b1859">hwloc_bitmap_or</a></div><div class="ttdeci">int hwloc_bitmap_or(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)</div><div class="ttdoc">Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.</div></div> |
| 129 |
<div class="ttc" id="aa00188_html_ga156130d85b3a0674d6e0e6770fe68fbe"><div class="ttname"><a href="#ga156130d85b3a0674d6e0e6770fe68fbe">hwloc_bitmap_free</a></div><div class="ttdeci">void hwloc_bitmap_free(hwloc_bitmap_t bitmap)</div><div class="ttdoc">Free bitmap bitmap.</div></div> |
| 130 |
<div class="ttc" id="aa00188_html_gaa3c2bf4c776d603dcebbb61b0c923d84"><div class="ttname"><a href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></div><div class="ttdeci">struct hwloc_bitmap_s * hwloc_bitmap_t</div><div class="ttdoc">Set of bits represented as an opaque pointer to an internal bitmap.</div><div class="ttdef"><b>Definition</b> bitmap.h:70</div></div> |
| 131 |
<div class="ttc" id="aa00188_html_gadece3d1eb5199fc2fb99bc7dcf1ccc05"><div class="ttname"><a href="#gadece3d1eb5199fc2fb99bc7dcf1ccc05">hwloc_bitmap_alloc</a></div><div class="ttdeci">hwloc_bitmap_t hwloc_bitmap_alloc(void)</div><div class="ttdoc">Allocate a new empty bitmap.</div></div> |
| 132 |
<div class="ttc" id="aa00224_html_a67925e0f2c47f50408fbdb9bddd0790f"><div class="ttname"><a href="a00224.html#a67925e0f2c47f50408fbdb9bddd0790f">hwloc_obj::cpuset</a></div><div class="ttdeci">hwloc_cpuset_t cpuset</div><div class="ttdoc">CPUs covered by this object.</div><div class="ttdef"><b>Definition</b> hwloc.h:553</div></div> |
| 133 |
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>Most functions below return 0 on success and -1 on error. The usual error case would be an internal failure to realloc/extend the storage of the bitmap (<code class="param">errno</code> would be set to <code>ENOMEM</code>). See also <a class="el" href="a00164.html">Error reporting in the API</a>.</dd> |
| 134 |
<dd> |
| 135 |
Several examples of using the bitmap API are available under the doc/examples/ directory in the source tree. Regression tests such as tests/hwloc/hwloc_bitmap*.c also make intensive use of this API. </dd></dl> |
| 136 |
<a name="doc-define-members" id="doc-define-members"></a><h2 id="header-doc-define-members" class="groupheader">Macro Definition Documentation</h2> |
| 137 |
<a id="ga3f6861045a8029ade373510ffa727d2a" name="ga3f6861045a8029ade373510ffa727d2a"></a> |
| 138 |
<h2 class="memtitle"><span class="permalink"><a href="#ga3f6861045a8029ade373510ffa727d2a">◆ </a></span>hwloc_bitmap_foreach_begin</h2> |
| 139 |
|
| 140 |
<div class="memitem"> |
| 141 |
<div class="memproto"> |
| 142 |
<table class="memname"> |
| 143 |
<tr> |
| 144 |
<td class="memname">#define hwloc_bitmap_foreach_begin</td> |
| 145 |
<td>(</td> |
| 146 |
<td class="paramtype"></td> <td class="paramname"><span class="paramname"><em>id</em></span>, </td> |
| 147 |
</tr> |
| 148 |
<tr> |
| 149 |
<td class="paramkey"></td> |
| 150 |
<td></td> |
| 151 |
<td class="paramtype"></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span> )</td> |
| 152 |
</tr> |
| 153 |
</table> |
| 154 |
</div><div class="memdoc"> |
| 155 |
|
| 156 |
<p>Loop macro iterating on bitmap <code class="param">bitmap</code>. </p> |
| 157 |
<p>The loop must start with <a class="el" href="#ga3f6861045a8029ade373510ffa727d2a" title="Loop macro iterating on bitmap bitmap.">hwloc_bitmap_foreach_begin()</a> and end with <a class="el" href="#gafcf3246db406218d4e155735b3fa6528" title="End of loop macro iterating on a bitmap.">hwloc_bitmap_foreach_end()</a> followed by a terminating ';'.</p> |
| 158 |
<p><code class="param">id</code> is the loop variable; it should be an unsigned int. The first iteration will set <code class="param">id</code> to the lowest index in the bitmap. Successive iterations will iterate through, in order, all remaining indexes set in the bitmap. To be specific: each iteration will return a value for <code class="param">id</code> such that hwloc_bitmap_isset(bitmap, id) is true.</p> |
| 159 |
<p>The assert prevents the loop from being infinite if the bitmap is infinitely set. </p> |
| 160 |
|
| 161 |
</div> |
| 162 |
</div> |
| 163 |
<a id="gafcf3246db406218d4e155735b3fa6528" name="gafcf3246db406218d4e155735b3fa6528"></a> |
| 164 |
<h2 class="memtitle"><span class="permalink"><a href="#gafcf3246db406218d4e155735b3fa6528">◆ </a></span>hwloc_bitmap_foreach_end</h2> |
| 165 |
|
| 166 |
<div class="memitem"> |
| 167 |
<div class="memproto"> |
| 168 |
<table class="memname"> |
| 169 |
<tr> |
| 170 |
<td class="memname">#define hwloc_bitmap_foreach_end</td> |
| 171 |
<td>(</td> |
| 172 |
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td> |
| 173 |
<td></td> |
| 174 |
</tr> |
| 175 |
</table> |
| 176 |
</div><div class="memdoc"> |
| 177 |
|
| 178 |
<p>End of loop macro iterating on a bitmap. </p> |
| 179 |
<p>Needs a terminating ';'.</p> |
| 180 |
<dl class="section see"><dt>See also</dt><dd><a class="el" href="#ga3f6861045a8029ade373510ffa727d2a" title="Loop macro iterating on bitmap bitmap.">hwloc_bitmap_foreach_begin()</a> </dd></dl> |
| 181 |
|
| 182 |
</div> |
| 183 |
</div> |
| 184 |
<a name="doc-typedef-members" id="doc-typedef-members"></a><h2 id="header-doc-typedef-members" class="groupheader">Typedef Documentation</h2> |
| 185 |
<a id="gaa3c2bf4c776d603dcebbb61b0c923d84" name="gaa3c2bf4c776d603dcebbb61b0c923d84"></a> |
| 186 |
<h2 class="memtitle"><span class="permalink"><a href="#gaa3c2bf4c776d603dcebbb61b0c923d84">◆ </a></span>hwloc_bitmap_t</h2> |
| 187 |
|
| 188 |
<div class="memitem"> |
| 189 |
<div class="memproto"> |
| 190 |
<table class="memname"> |
| 191 |
<tr> |
| 192 |
<td class="memname">typedef struct hwloc_bitmap_s* <a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> |
| 193 |
</tr> |
| 194 |
</table> |
| 195 |
</div><div class="memdoc"> |
| 196 |
|
| 197 |
<p>Set of bits represented as an opaque pointer to an internal bitmap. </p> |
| 198 |
|
| 199 |
</div> |
| 200 |
</div> |
| 201 |
<a id="gae991a108af01d408be2776c5b2c467b2" name="gae991a108af01d408be2776c5b2c467b2"></a> |
| 202 |
<h2 class="memtitle"><span class="permalink"><a href="#gae991a108af01d408be2776c5b2c467b2">◆ </a></span>hwloc_const_bitmap_t</h2> |
| 203 |
|
| 204 |
<div class="memitem"> |
| 205 |
<div class="memproto"> |
| 206 |
<table class="memname"> |
| 207 |
<tr> |
| 208 |
<td class="memname">typedef const struct hwloc_bitmap_s* <a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> |
| 209 |
</tr> |
| 210 |
</table> |
| 211 |
</div><div class="memdoc"> |
| 212 |
|
| 213 |
<p>a non-modifiable <a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84" title="Set of bits represented as an opaque pointer to an internal bitmap.">hwloc_bitmap_t</a> </p> |
| 214 |
|
| 215 |
</div> |
| 216 |
</div> |
| 217 |
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2> |
| 218 |
<a id="ga06d505f8a1c0a536614f65f503ee6d93" name="ga06d505f8a1c0a536614f65f503ee6d93"></a> |
| 219 |
<h2 class="memtitle"><span class="permalink"><a href="#ga06d505f8a1c0a536614f65f503ee6d93">◆ </a></span>hwloc_bitmap_allbut()</h2> |
| 220 |
|
| 221 |
<div class="memitem"> |
| 222 |
<div class="memproto"> |
| 223 |
<table class="memname"> |
| 224 |
<tr> |
| 225 |
<td class="memname">int hwloc_bitmap_allbut </td> |
| 226 |
<td>(</td> |
| 227 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 228 |
</tr> |
| 229 |
<tr> |
| 230 |
<td class="paramkey"></td> |
| 231 |
<td></td> |
| 232 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>id</em></span> )</td> |
| 233 |
</tr> |
| 234 |
</table> |
| 235 |
</div><div class="memdoc"> |
| 236 |
|
| 237 |
<p>Fill the bitmap <code class="param">and</code> clear the index <code class="param">id</code>. </p> |
| 238 |
|
| 239 |
</div> |
| 240 |
</div> |
| 241 |
<a id="gadece3d1eb5199fc2fb99bc7dcf1ccc05" name="gadece3d1eb5199fc2fb99bc7dcf1ccc05"></a> |
| 242 |
<h2 class="memtitle"><span class="permalink"><a href="#gadece3d1eb5199fc2fb99bc7dcf1ccc05">◆ </a></span>hwloc_bitmap_alloc()</h2> |
| 243 |
|
| 244 |
<div class="memitem"> |
| 245 |
<div class="memproto"> |
| 246 |
<table class="memname"> |
| 247 |
<tr> |
| 248 |
<td class="memname"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> hwloc_bitmap_alloc </td> |
| 249 |
<td>(</td> |
| 250 |
<td class="paramtype">void</td> <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td> |
| 251 |
<td></td> |
| 252 |
</tr> |
| 253 |
</table> |
| 254 |
</div><div class="memdoc"> |
| 255 |
|
| 256 |
<p>Allocate a new empty bitmap. </p> |
| 257 |
<dl class="section return"><dt>Returns</dt><dd>A valid bitmap or <code>NULL</code>.</dd></dl> |
| 258 |
<p>The bitmap should be freed by a corresponding call to <a class="el" href="#ga156130d85b3a0674d6e0e6770fe68fbe" title="Free bitmap bitmap.">hwloc_bitmap_free()</a>. </p> |
| 259 |
|
| 260 |
</div> |
| 261 |
</div> |
| 262 |
<a id="ga02853b4a224970587b9d7a0e20d857c0" name="ga02853b4a224970587b9d7a0e20d857c0"></a> |
| 263 |
<h2 class="memtitle"><span class="permalink"><a href="#ga02853b4a224970587b9d7a0e20d857c0">◆ </a></span>hwloc_bitmap_alloc_full()</h2> |
| 264 |
|
| 265 |
<div class="memitem"> |
| 266 |
<div class="memproto"> |
| 267 |
<table class="memname"> |
| 268 |
<tr> |
| 269 |
<td class="memname"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> hwloc_bitmap_alloc_full </td> |
| 270 |
<td>(</td> |
| 271 |
<td class="paramtype">void</td> <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td> |
| 272 |
<td></td> |
| 273 |
</tr> |
| 274 |
</table> |
| 275 |
</div><div class="memdoc"> |
| 276 |
|
| 277 |
<p>Allocate a new full bitmap. </p> |
| 278 |
<dl class="section return"><dt>Returns</dt><dd>A valid bitmap or <code>NULL</code>.</dd></dl> |
| 279 |
<p>The bitmap should be freed by a corresponding call to <a class="el" href="#ga156130d85b3a0674d6e0e6770fe68fbe" title="Free bitmap bitmap.">hwloc_bitmap_free()</a>. </p> |
| 280 |
|
| 281 |
</div> |
| 282 |
</div> |
| 283 |
<a id="ga674533016ffed922a28b4f0b49b82cd4" name="ga674533016ffed922a28b4f0b49b82cd4"></a> |
| 284 |
<h2 class="memtitle"><span class="permalink"><a href="#ga674533016ffed922a28b4f0b49b82cd4">◆ </a></span>hwloc_bitmap_and()</h2> |
| 285 |
|
| 286 |
<div class="memitem"> |
| 287 |
<div class="memproto"> |
| 288 |
<table class="memname"> |
| 289 |
<tr> |
| 290 |
<td class="memname">int hwloc_bitmap_and </td> |
| 291 |
<td>(</td> |
| 292 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>res</em></span>, </td> |
| 293 |
</tr> |
| 294 |
<tr> |
| 295 |
<td class="paramkey"></td> |
| 296 |
<td></td> |
| 297 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap1</em></span>, </td> |
| 298 |
</tr> |
| 299 |
<tr> |
| 300 |
<td class="paramkey"></td> |
| 301 |
<td></td> |
| 302 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap2</em></span> )</td> |
| 303 |
</tr> |
| 304 |
</table> |
| 305 |
</div><div class="memdoc"> |
| 306 |
|
| 307 |
<p>And bitmaps <code class="param">bitmap1</code> and <code class="param">bitmap2</code> and store the result in bitmap <code class="param">res</code>. </p> |
| 308 |
<p><code class="param">res</code> can be the same as <code class="param">bitmap1</code> or <code class="param">bitmap2</code> </p> |
| 309 |
|
| 310 |
</div> |
| 311 |
</div> |
| 312 |
<a id="ga7ca5c72db65406b85aca032c8a990f9e" name="ga7ca5c72db65406b85aca032c8a990f9e"></a> |
| 313 |
<h2 class="memtitle"><span class="permalink"><a href="#ga7ca5c72db65406b85aca032c8a990f9e">◆ </a></span>hwloc_bitmap_andnot()</h2> |
| 314 |
|
| 315 |
<div class="memitem"> |
| 316 |
<div class="memproto"> |
| 317 |
<table class="memname"> |
| 318 |
<tr> |
| 319 |
<td class="memname">int hwloc_bitmap_andnot </td> |
| 320 |
<td>(</td> |
| 321 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>res</em></span>, </td> |
| 322 |
</tr> |
| 323 |
<tr> |
| 324 |
<td class="paramkey"></td> |
| 325 |
<td></td> |
| 326 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap1</em></span>, </td> |
| 327 |
</tr> |
| 328 |
<tr> |
| 329 |
<td class="paramkey"></td> |
| 330 |
<td></td> |
| 331 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap2</em></span> )</td> |
| 332 |
</tr> |
| 333 |
</table> |
| 334 |
</div><div class="memdoc"> |
| 335 |
|
| 336 |
<p>And bitmap <code class="param">bitmap1</code> and the negation of <code class="param">bitmap2</code> and store the result in bitmap <code class="param">res</code>. </p> |
| 337 |
<p><code class="param">res</code> can be the same as <code class="param">bitmap1</code> or <code class="param">bitmap2</code> </p> |
| 338 |
|
| 339 |
</div> |
| 340 |
</div> |
| 341 |
<a id="ga0fece972134fdecf2da9bc7a11dd827e" name="ga0fece972134fdecf2da9bc7a11dd827e"></a> |
| 342 |
<h2 class="memtitle"><span class="permalink"><a href="#ga0fece972134fdecf2da9bc7a11dd827e">◆ </a></span>hwloc_bitmap_asprintf()</h2> |
| 343 |
|
| 344 |
<div class="memitem"> |
| 345 |
<div class="memproto"> |
| 346 |
<table class="memname"> |
| 347 |
<tr> |
| 348 |
<td class="memname">int hwloc_bitmap_asprintf </td> |
| 349 |
<td>(</td> |
| 350 |
<td class="paramtype">char **</td> <td class="paramname"><span class="paramname"><em>strp</em></span>, </td> |
| 351 |
</tr> |
| 352 |
<tr> |
| 353 |
<td class="paramkey"></td> |
| 354 |
<td></td> |
| 355 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span> )</td> |
| 356 |
</tr> |
| 357 |
</table> |
| 358 |
</div><div class="memdoc"> |
| 359 |
|
| 360 |
<p>Stringify a bitmap into a newly allocated string in the default hwloc format. </p> |
| 361 |
<p>Print the bits set inside a bitmap as a comma-separated list of hexadecimal 32-bit blocks. A bitmap containing bits 1, 33, 34, and all from 64 to 95 is printed as <span class="tt">"0xffffffff,0x00000006,0x00000002"</span>.</p> |
| 362 |
<dl class="section return"><dt>Returns</dt><dd>the number of characters that were written (not including the ending <code>\0</code>). </dd> |
| 363 |
<dd> |
| 364 |
-1 on error, for instance with <code class="param">errno</code> set to <code>ENOMEM</code> on failure to allocate the output string.</dd></dl> |
| 365 |
<dl class="section note"><dt>Note</dt><dd><b>If the bitmap is a CPU or nodeset, it contains physical indexes.</b> This should be clearly indicated when displaying such bitmaps to end users. See also <a class="el" href="a00386.html#faq_convert_indexes">How do I convert between logical and OS/physical indexes?</a> </dd></dl> |
| 366 |
|
| 367 |
</div> |
| 368 |
</div> |
| 369 |
<a id="gaf20bb350b6844d08931a064a73f86743" name="gaf20bb350b6844d08931a064a73f86743"></a> |
| 370 |
<h2 class="memtitle"><span class="permalink"><a href="#gaf20bb350b6844d08931a064a73f86743">◆ </a></span>hwloc_bitmap_clr()</h2> |
| 371 |
|
| 372 |
<div class="memitem"> |
| 373 |
<div class="memproto"> |
| 374 |
<table class="memname"> |
| 375 |
<tr> |
| 376 |
<td class="memname">int hwloc_bitmap_clr </td> |
| 377 |
<td>(</td> |
| 378 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 379 |
</tr> |
| 380 |
<tr> |
| 381 |
<td class="paramkey"></td> |
| 382 |
<td></td> |
| 383 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>id</em></span> )</td> |
| 384 |
</tr> |
| 385 |
</table> |
| 386 |
</div><div class="memdoc"> |
| 387 |
|
| 388 |
<p>Remove index <code class="param">id</code> from bitmap <code class="param">bitmap</code>. </p> |
| 389 |
|
| 390 |
</div> |
| 391 |
</div> |
| 392 |
<a id="ga833776709df94d727f8c22304b3388cf" name="ga833776709df94d727f8c22304b3388cf"></a> |
| 393 |
<h2 class="memtitle"><span class="permalink"><a href="#ga833776709df94d727f8c22304b3388cf">◆ </a></span>hwloc_bitmap_clr_range()</h2> |
| 394 |
|
| 395 |
<div class="memitem"> |
| 396 |
<div class="memproto"> |
| 397 |
<table class="memname"> |
| 398 |
<tr> |
| 399 |
<td class="memname">int hwloc_bitmap_clr_range </td> |
| 400 |
<td>(</td> |
| 401 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 402 |
</tr> |
| 403 |
<tr> |
| 404 |
<td class="paramkey"></td> |
| 405 |
<td></td> |
| 406 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>begin</em></span>, </td> |
| 407 |
</tr> |
| 408 |
<tr> |
| 409 |
<td class="paramkey"></td> |
| 410 |
<td></td> |
| 411 |
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>end</em></span> )</td> |
| 412 |
</tr> |
| 413 |
</table> |
| 414 |
</div><div class="memdoc"> |
| 415 |
|
| 416 |
<p>Remove indexes from <code class="param">begin</code> to <code class="param">end</code> in bitmap <code class="param">bitmap</code>. </p> |
| 417 |
<p>If <code class="param">end</code> is <code>-1</code>, the range is infinite. </p> |
| 418 |
|
| 419 |
</div> |
| 420 |
</div> |
| 421 |
<a id="ga14cdbc0ef0a705e84999bd48a2e649f3" name="ga14cdbc0ef0a705e84999bd48a2e649f3"></a> |
| 422 |
<h2 class="memtitle"><span class="permalink"><a href="#ga14cdbc0ef0a705e84999bd48a2e649f3">◆ </a></span>hwloc_bitmap_compare()</h2> |
| 423 |
|
| 424 |
<div class="memitem"> |
| 425 |
<div class="memproto"> |
| 426 |
<table class="memname"> |
| 427 |
<tr> |
| 428 |
<td class="memname">int hwloc_bitmap_compare </td> |
| 429 |
<td>(</td> |
| 430 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap1</em></span>, </td> |
| 431 |
</tr> |
| 432 |
<tr> |
| 433 |
<td class="paramkey"></td> |
| 434 |
<td></td> |
| 435 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap2</em></span> )</td> |
| 436 |
</tr> |
| 437 |
</table> |
| 438 |
</div><div class="memdoc"> |
| 439 |
|
| 440 |
<p>Compare bitmaps <code class="param">bitmap1</code> and <code class="param">bitmap2</code> in lexicographic order. </p> |
| 441 |
<p>Lexicographic comparison of bitmaps, starting for their highest indexes. Compare last indexes first, then second, etc. The empty bitmap is considered lower than anything.</p> |
| 442 |
<dl class="section return"><dt>Returns</dt><dd>-1 if <code class="param">bitmap1</code> is considered smaller than <code class="param">bitmap2</code>. </dd> |
| 443 |
<dd> |
| 444 |
1 if <code class="param">bitmap1</code> is considered larger than <code class="param">bitmap2</code>. </dd> |
| 445 |
<dd> |
| 446 |
0 if bitmaps are equal (contrary to <a class="el" href="#gaa39cda1510ab721b5c012c76ead72365" title="Compare bitmaps bitmap1 and bitmap2 using their lowest index.">hwloc_bitmap_compare_first()</a>).</dd></dl> |
| 447 |
<p>For instance comparing binary bitmaps 0011 and 0110 returns -1 (hence 0011 is considered smaller than 0110). Comparing 00101 and 01010 returns -1 too.</p> |
| 448 |
<dl class="section note"><dt>Note</dt><dd>This is different from the non-existing hwloc_bitmap_compare_last() which would only compare the highest index of each bitmap. </dd></dl> |
| 449 |
|
| 450 |
</div> |
| 451 |
</div> |
| 452 |
<a id="gaa39cda1510ab721b5c012c76ead72365" name="gaa39cda1510ab721b5c012c76ead72365"></a> |
| 453 |
<h2 class="memtitle"><span class="permalink"><a href="#gaa39cda1510ab721b5c012c76ead72365">◆ </a></span>hwloc_bitmap_compare_first()</h2> |
| 454 |
|
| 455 |
<div class="memitem"> |
| 456 |
<div class="memproto"> |
| 457 |
<table class="memname"> |
| 458 |
<tr> |
| 459 |
<td class="memname">int hwloc_bitmap_compare_first </td> |
| 460 |
<td>(</td> |
| 461 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap1</em></span>, </td> |
| 462 |
</tr> |
| 463 |
<tr> |
| 464 |
<td class="paramkey"></td> |
| 465 |
<td></td> |
| 466 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap2</em></span> )</td> |
| 467 |
</tr> |
| 468 |
</table> |
| 469 |
</div><div class="memdoc"> |
| 470 |
|
| 471 |
<p>Compare bitmaps <code class="param">bitmap1</code> and <code class="param">bitmap2</code> using their lowest index. </p> |
| 472 |
<p>A bitmap is considered smaller if its least significant bit is smaller. The empty bitmap is considered higher than anything (because its least significant bit does not exist).</p> |
| 473 |
<dl class="section return"><dt>Returns</dt><dd>-1 if <code class="param">bitmap1</code> is considered smaller than <code class="param">bitmap2</code>. </dd> |
| 474 |
<dd> |
| 475 |
1 if <code class="param">bitmap1</code> is considered larger than <code class="param">bitmap2</code>.</dd></dl> |
| 476 |
<p>For instance comparing binary bitmaps 0011 and 0110 returns -1 (hence 0011 is considered smaller than 0110) because least significant bit of 0011 (0001) is smaller than least significant bit of 0110 (0010). Comparing 01001 and 00110 would also return -1 for the same reason.</p> |
| 477 |
<dl class="section return"><dt>Returns</dt><dd>0 if bitmaps are considered equal, even if they are not strictly equal. They just need to have the same least significant bit. For instance, comparing binary bitmaps 0010 and 0110 returns 0 because they have the same least significant bit. </dd></dl> |
| 478 |
|
| 479 |
</div> |
| 480 |
</div> |
| 481 |
<a id="ga72a29824798b48784b8217471ec8f14c" name="ga72a29824798b48784b8217471ec8f14c"></a> |
| 482 |
<h2 class="memtitle"><span class="permalink"><a href="#ga72a29824798b48784b8217471ec8f14c">◆ </a></span>hwloc_bitmap_copy()</h2> |
| 483 |
|
| 484 |
<div class="memitem"> |
| 485 |
<div class="memproto"> |
| 486 |
<table class="memname"> |
| 487 |
<tr> |
| 488 |
<td class="memname">int hwloc_bitmap_copy </td> |
| 489 |
<td>(</td> |
| 490 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>dst</em></span>, </td> |
| 491 |
</tr> |
| 492 |
<tr> |
| 493 |
<td class="paramkey"></td> |
| 494 |
<td></td> |
| 495 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>src</em></span> )</td> |
| 496 |
</tr> |
| 497 |
</table> |
| 498 |
</div><div class="memdoc"> |
| 499 |
|
| 500 |
<p>Copy the contents of bitmap <code class="param">src</code> into the already allocated bitmap <code class="param">dst</code>. </p> |
| 501 |
|
| 502 |
</div> |
| 503 |
</div> |
| 504 |
<a id="gae679434c1a5f41d3560a8a7e2c1b0dee" name="gae679434c1a5f41d3560a8a7e2c1b0dee"></a> |
| 505 |
<h2 class="memtitle"><span class="permalink"><a href="#gae679434c1a5f41d3560a8a7e2c1b0dee">◆ </a></span>hwloc_bitmap_dup()</h2> |
| 506 |
|
| 507 |
<div class="memitem"> |
| 508 |
<div class="memproto"> |
| 509 |
<table class="memname"> |
| 510 |
<tr> |
| 511 |
<td class="memname"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> hwloc_bitmap_dup </td> |
| 512 |
<td>(</td> |
| 513 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 514 |
<td></td> |
| 515 |
</tr> |
| 516 |
</table> |
| 517 |
</div><div class="memdoc"> |
| 518 |
|
| 519 |
<p>Duplicate bitmap <code class="param">bitmap</code> by allocating a new bitmap and copying <code class="param">bitmap</code> contents. </p> |
| 520 |
<p>If <code class="param">bitmap</code> is <code>NULL</code>, <code>NULL</code> is returned. </p> |
| 521 |
|
| 522 |
</div> |
| 523 |
</div> |
| 524 |
<a id="ga07b2de8786b3cdb22f21d9dd42588275" name="ga07b2de8786b3cdb22f21d9dd42588275"></a> |
| 525 |
<h2 class="memtitle"><span class="permalink"><a href="#ga07b2de8786b3cdb22f21d9dd42588275">◆ </a></span>hwloc_bitmap_fill()</h2> |
| 526 |
|
| 527 |
<div class="memitem"> |
| 528 |
<div class="memproto"> |
| 529 |
<table class="memname"> |
| 530 |
<tr> |
| 531 |
<td class="memname">void hwloc_bitmap_fill </td> |
| 532 |
<td>(</td> |
| 533 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 534 |
<td></td> |
| 535 |
</tr> |
| 536 |
</table> |
| 537 |
</div><div class="memdoc"> |
| 538 |
|
| 539 |
<p>Fill bitmap <code class="param">bitmap</code> with all possible indexes (even if those objects don't exist or are otherwise unavailable). </p> |
| 540 |
|
| 541 |
</div> |
| 542 |
</div> |
| 543 |
<a id="ga3ec1ced43afadf8c0a7197320bc016ed" name="ga3ec1ced43afadf8c0a7197320bc016ed"></a> |
| 544 |
<h2 class="memtitle"><span class="permalink"><a href="#ga3ec1ced43afadf8c0a7197320bc016ed">◆ </a></span>hwloc_bitmap_first()</h2> |
| 545 |
|
| 546 |
<div class="memitem"> |
| 547 |
<div class="memproto"> |
| 548 |
<table class="memname"> |
| 549 |
<tr> |
| 550 |
<td class="memname">int hwloc_bitmap_first </td> |
| 551 |
<td>(</td> |
| 552 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 553 |
<td></td> |
| 554 |
</tr> |
| 555 |
</table> |
| 556 |
</div><div class="memdoc"> |
| 557 |
|
| 558 |
<p>Compute the first index (least significant bit) in bitmap <code class="param">bitmap</code>. </p> |
| 559 |
<dl class="section return"><dt>Returns</dt><dd>the first index set in <code class="param">bitmap</code>. </dd> |
| 560 |
<dd> |
| 561 |
-1 if <code class="param">bitmap</code> is empty. </dd></dl> |
| 562 |
|
| 563 |
</div> |
| 564 |
</div> |
| 565 |
<a id="gae408841487b288e148a478ba0465c99e" name="gae408841487b288e148a478ba0465c99e"></a> |
| 566 |
<h2 class="memtitle"><span class="permalink"><a href="#gae408841487b288e148a478ba0465c99e">◆ </a></span>hwloc_bitmap_first_unset()</h2> |
| 567 |
|
| 568 |
<div class="memitem"> |
| 569 |
<div class="memproto"> |
| 570 |
<table class="memname"> |
| 571 |
<tr> |
| 572 |
<td class="memname">int hwloc_bitmap_first_unset </td> |
| 573 |
<td>(</td> |
| 574 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 575 |
<td></td> |
| 576 |
</tr> |
| 577 |
</table> |
| 578 |
</div><div class="memdoc"> |
| 579 |
|
| 580 |
<p>Compute the first unset index (least significant bit) in bitmap <code class="param">bitmap</code>. </p> |
| 581 |
<dl class="section return"><dt>Returns</dt><dd>the first unset index in <code class="param">bitmap</code>. </dd> |
| 582 |
<dd> |
| 583 |
-1 if <code class="param">bitmap</code> is full. </dd></dl> |
| 584 |
|
| 585 |
</div> |
| 586 |
</div> |
| 587 |
<a id="ga156130d85b3a0674d6e0e6770fe68fbe" name="ga156130d85b3a0674d6e0e6770fe68fbe"></a> |
| 588 |
<h2 class="memtitle"><span class="permalink"><a href="#ga156130d85b3a0674d6e0e6770fe68fbe">◆ </a></span>hwloc_bitmap_free()</h2> |
| 589 |
|
| 590 |
<div class="memitem"> |
| 591 |
<div class="memproto"> |
| 592 |
<table class="memname"> |
| 593 |
<tr> |
| 594 |
<td class="memname">void hwloc_bitmap_free </td> |
| 595 |
<td>(</td> |
| 596 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 597 |
<td></td> |
| 598 |
</tr> |
| 599 |
</table> |
| 600 |
</div><div class="memdoc"> |
| 601 |
|
| 602 |
<p>Free bitmap <code class="param">bitmap</code>. </p> |
| 603 |
<p>If <code class="param">bitmap</code> is <code>NULL</code>, no operation is performed. </p> |
| 604 |
|
| 605 |
</div> |
| 606 |
</div> |
| 607 |
<a id="ga4947c46d47bcfcd3faf3f59569be3e37" name="ga4947c46d47bcfcd3faf3f59569be3e37"></a> |
| 608 |
<h2 class="memtitle"><span class="permalink"><a href="#ga4947c46d47bcfcd3faf3f59569be3e37">◆ </a></span>hwloc_bitmap_from_ith_ulong()</h2> |
| 609 |
|
| 610 |
<div class="memitem"> |
| 611 |
<div class="memproto"> |
| 612 |
<table class="memname"> |
| 613 |
<tr> |
| 614 |
<td class="memname">int hwloc_bitmap_from_ith_ulong </td> |
| 615 |
<td>(</td> |
| 616 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 617 |
</tr> |
| 618 |
<tr> |
| 619 |
<td class="paramkey"></td> |
| 620 |
<td></td> |
| 621 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>i</em></span>, </td> |
| 622 |
</tr> |
| 623 |
<tr> |
| 624 |
<td class="paramkey"></td> |
| 625 |
<td></td> |
| 626 |
<td class="paramtype">unsigned long</td> <td class="paramname"><span class="paramname"><em>mask</em></span> )</td> |
| 627 |
</tr> |
| 628 |
</table> |
| 629 |
</div><div class="memdoc"> |
| 630 |
|
| 631 |
<p>Setup bitmap <code class="param">bitmap</code> from unsigned long <code class="param">mask</code> used as <code class="param">i</code> -th subset. </p> |
| 632 |
|
| 633 |
</div> |
| 634 |
</div> |
| 635 |
<a id="gad59b0ebeb29c1bfabbb2a379e55c1159" name="gad59b0ebeb29c1bfabbb2a379e55c1159"></a> |
| 636 |
<h2 class="memtitle"><span class="permalink"><a href="#gad59b0ebeb29c1bfabbb2a379e55c1159">◆ </a></span>hwloc_bitmap_from_ulong()</h2> |
| 637 |
|
| 638 |
<div class="memitem"> |
| 639 |
<div class="memproto"> |
| 640 |
<table class="memname"> |
| 641 |
<tr> |
| 642 |
<td class="memname">int hwloc_bitmap_from_ulong </td> |
| 643 |
<td>(</td> |
| 644 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 645 |
</tr> |
| 646 |
<tr> |
| 647 |
<td class="paramkey"></td> |
| 648 |
<td></td> |
| 649 |
<td class="paramtype">unsigned long</td> <td class="paramname"><span class="paramname"><em>mask</em></span> )</td> |
| 650 |
</tr> |
| 651 |
</table> |
| 652 |
</div><div class="memdoc"> |
| 653 |
|
| 654 |
<p>Setup bitmap <code class="param">bitmap</code> from unsigned long <code class="param">mask</code>. </p> |
| 655 |
|
| 656 |
</div> |
| 657 |
</div> |
| 658 |
<a id="gabcfef22f6fc4d4b33f068dd91a1c38f5" name="gabcfef22f6fc4d4b33f068dd91a1c38f5"></a> |
| 659 |
<h2 class="memtitle"><span class="permalink"><a href="#gabcfef22f6fc4d4b33f068dd91a1c38f5">◆ </a></span>hwloc_bitmap_from_ulongs()</h2> |
| 660 |
|
| 661 |
<div class="memitem"> |
| 662 |
<div class="memproto"> |
| 663 |
<table class="memname"> |
| 664 |
<tr> |
| 665 |
<td class="memname">int hwloc_bitmap_from_ulongs </td> |
| 666 |
<td>(</td> |
| 667 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 668 |
</tr> |
| 669 |
<tr> |
| 670 |
<td class="paramkey"></td> |
| 671 |
<td></td> |
| 672 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>nr</em></span>, </td> |
| 673 |
</tr> |
| 674 |
<tr> |
| 675 |
<td class="paramkey"></td> |
| 676 |
<td></td> |
| 677 |
<td class="paramtype">const unsigned long *</td> <td class="paramname"><span class="paramname"><em>masks</em></span> )</td> |
| 678 |
</tr> |
| 679 |
</table> |
| 680 |
</div><div class="memdoc"> |
| 681 |
|
| 682 |
<p>Setup bitmap <code class="param">bitmap</code> from unsigned longs <code class="param">masks</code> used as first <code class="param">nr</code> subsets. </p> |
| 683 |
|
| 684 |
</div> |
| 685 |
</div> |
| 686 |
<a id="gaefa070f9232857ba5a57297ea9a08ea2" name="gaefa070f9232857ba5a57297ea9a08ea2"></a> |
| 687 |
<h2 class="memtitle"><span class="permalink"><a href="#gaefa070f9232857ba5a57297ea9a08ea2">◆ </a></span>hwloc_bitmap_intersects()</h2> |
| 688 |
|
| 689 |
<div class="memitem"> |
| 690 |
<div class="memproto"> |
| 691 |
<table class="memname"> |
| 692 |
<tr> |
| 693 |
<td class="memname">int hwloc_bitmap_intersects </td> |
| 694 |
<td>(</td> |
| 695 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap1</em></span>, </td> |
| 696 |
</tr> |
| 697 |
<tr> |
| 698 |
<td class="paramkey"></td> |
| 699 |
<td></td> |
| 700 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap2</em></span> )</td> |
| 701 |
</tr> |
| 702 |
</table> |
| 703 |
</div><div class="memdoc"> |
| 704 |
|
| 705 |
<p>Test whether bitmaps <code class="param">bitmap1</code> and <code class="param">bitmap2</code> intersects. </p> |
| 706 |
<dl class="section return"><dt>Returns</dt><dd>1 if bitmaps intersect, 0 otherwise.</dd></dl> |
| 707 |
<dl class="section note"><dt>Note</dt><dd>The empty bitmap does not intersect any other bitmap. </dd></dl> |
| 708 |
|
| 709 |
</div> |
| 710 |
</div> |
| 711 |
<a id="ga32376b1405e57472b73c3aa53bb39663" name="ga32376b1405e57472b73c3aa53bb39663"></a> |
| 712 |
<h2 class="memtitle"><span class="permalink"><a href="#ga32376b1405e57472b73c3aa53bb39663">◆ </a></span>hwloc_bitmap_isequal()</h2> |
| 713 |
|
| 714 |
<div class="memitem"> |
| 715 |
<div class="memproto"> |
| 716 |
<table class="memname"> |
| 717 |
<tr> |
| 718 |
<td class="memname">int hwloc_bitmap_isequal </td> |
| 719 |
<td>(</td> |
| 720 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap1</em></span>, </td> |
| 721 |
</tr> |
| 722 |
<tr> |
| 723 |
<td class="paramkey"></td> |
| 724 |
<td></td> |
| 725 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap2</em></span> )</td> |
| 726 |
</tr> |
| 727 |
</table> |
| 728 |
</div><div class="memdoc"> |
| 729 |
|
| 730 |
<p>Test whether bitmap <code class="param">bitmap1</code> is equal to bitmap <code class="param">bitmap2</code>. </p> |
| 731 |
<dl class="section return"><dt>Returns</dt><dd>1 if bitmaps are equal, 0 otherwise. </dd></dl> |
| 732 |
|
| 733 |
</div> |
| 734 |
</div> |
| 735 |
<a id="ga5fdcb8c19c336511c37076d649e74af4" name="ga5fdcb8c19c336511c37076d649e74af4"></a> |
| 736 |
<h2 class="memtitle"><span class="permalink"><a href="#ga5fdcb8c19c336511c37076d649e74af4">◆ </a></span>hwloc_bitmap_isfull()</h2> |
| 737 |
|
| 738 |
<div class="memitem"> |
| 739 |
<div class="memproto"> |
| 740 |
<table class="memname"> |
| 741 |
<tr> |
| 742 |
<td class="memname">int hwloc_bitmap_isfull </td> |
| 743 |
<td>(</td> |
| 744 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 745 |
<td></td> |
| 746 |
</tr> |
| 747 |
</table> |
| 748 |
</div><div class="memdoc"> |
| 749 |
|
| 750 |
<p>Test whether bitmap <code class="param">bitmap</code> is completely full. </p> |
| 751 |
<dl class="section return"><dt>Returns</dt><dd>1 if bitmap is full, 0 otherwise.</dd></dl> |
| 752 |
<dl class="section note"><dt>Note</dt><dd>A full bitmap is always infinitely set. </dd></dl> |
| 753 |
|
| 754 |
</div> |
| 755 |
</div> |
| 756 |
<a id="ga0526e03db81956fb02acc8260b66d6a4" name="ga0526e03db81956fb02acc8260b66d6a4"></a> |
| 757 |
<h2 class="memtitle"><span class="permalink"><a href="#ga0526e03db81956fb02acc8260b66d6a4">◆ </a></span>hwloc_bitmap_isincluded()</h2> |
| 758 |
|
| 759 |
<div class="memitem"> |
| 760 |
<div class="memproto"> |
| 761 |
<table class="memname"> |
| 762 |
<tr> |
| 763 |
<td class="memname">int hwloc_bitmap_isincluded </td> |
| 764 |
<td>(</td> |
| 765 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>sub_bitmap</em></span>, </td> |
| 766 |
</tr> |
| 767 |
<tr> |
| 768 |
<td class="paramkey"></td> |
| 769 |
<td></td> |
| 770 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>super_bitmap</em></span> )</td> |
| 771 |
</tr> |
| 772 |
</table> |
| 773 |
</div><div class="memdoc"> |
| 774 |
|
| 775 |
<p>Test whether bitmap <code class="param">sub_bitmap</code> is part of bitmap <code class="param">super_bitmap</code>. </p> |
| 776 |
<dl class="section return"><dt>Returns</dt><dd>1 if <code class="param">sub_bitmap</code> is included in <code class="param">super_bitmap</code>, 0 otherwise.</dd></dl> |
| 777 |
<dl class="section note"><dt>Note</dt><dd>The empty bitmap is considered included in any other bitmap. </dd></dl> |
| 778 |
|
| 779 |
</div> |
| 780 |
</div> |
| 781 |
<a id="ga11340dd487f110bb84f0a6e4ae90bd06" name="ga11340dd487f110bb84f0a6e4ae90bd06"></a> |
| 782 |
<h2 class="memtitle"><span class="permalink"><a href="#ga11340dd487f110bb84f0a6e4ae90bd06">◆ </a></span>hwloc_bitmap_isset()</h2> |
| 783 |
|
| 784 |
<div class="memitem"> |
| 785 |
<div class="memproto"> |
| 786 |
<table class="memname"> |
| 787 |
<tr> |
| 788 |
<td class="memname">int hwloc_bitmap_isset </td> |
| 789 |
<td>(</td> |
| 790 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 791 |
</tr> |
| 792 |
<tr> |
| 793 |
<td class="paramkey"></td> |
| 794 |
<td></td> |
| 795 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>id</em></span> )</td> |
| 796 |
</tr> |
| 797 |
</table> |
| 798 |
</div><div class="memdoc"> |
| 799 |
|
| 800 |
<p>Test whether index <code class="param">id</code> is part of bitmap <code class="param">bitmap</code>. </p> |
| 801 |
<dl class="section return"><dt>Returns</dt><dd>1 if the bit at index <code class="param">id</code> is set in bitmap <code class="param">bitmap</code>, 0 otherwise. </dd></dl> |
| 802 |
|
| 803 |
</div> |
| 804 |
</div> |
| 805 |
<a id="ga5b64be28f5a7176ed8ad0d6a90bdf108" name="ga5b64be28f5a7176ed8ad0d6a90bdf108"></a> |
| 806 |
<h2 class="memtitle"><span class="permalink"><a href="#ga5b64be28f5a7176ed8ad0d6a90bdf108">◆ </a></span>hwloc_bitmap_iszero()</h2> |
| 807 |
|
| 808 |
<div class="memitem"> |
| 809 |
<div class="memproto"> |
| 810 |
<table class="memname"> |
| 811 |
<tr> |
| 812 |
<td class="memname">int hwloc_bitmap_iszero </td> |
| 813 |
<td>(</td> |
| 814 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 815 |
<td></td> |
| 816 |
</tr> |
| 817 |
</table> |
| 818 |
</div><div class="memdoc"> |
| 819 |
|
| 820 |
<p>Test whether bitmap <code class="param">bitmap</code> is empty. </p> |
| 821 |
<dl class="section return"><dt>Returns</dt><dd>1 if bitmap is empty, 0 otherwise. </dd></dl> |
| 822 |
|
| 823 |
</div> |
| 824 |
</div> |
| 825 |
<a id="ga3d9b08b060a59bbab5a4ea6d0a1ed7a6" name="ga3d9b08b060a59bbab5a4ea6d0a1ed7a6"></a> |
| 826 |
<h2 class="memtitle"><span class="permalink"><a href="#ga3d9b08b060a59bbab5a4ea6d0a1ed7a6">◆ </a></span>hwloc_bitmap_last()</h2> |
| 827 |
|
| 828 |
<div class="memitem"> |
| 829 |
<div class="memproto"> |
| 830 |
<table class="memname"> |
| 831 |
<tr> |
| 832 |
<td class="memname">int hwloc_bitmap_last </td> |
| 833 |
<td>(</td> |
| 834 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 835 |
<td></td> |
| 836 |
</tr> |
| 837 |
</table> |
| 838 |
</div><div class="memdoc"> |
| 839 |
|
| 840 |
<p>Compute the last index (most significant bit) in bitmap <code class="param">bitmap</code>. </p> |
| 841 |
<dl class="section return"><dt>Returns</dt><dd>the last index set in <code class="param">bitmap</code>. </dd> |
| 842 |
<dd> |
| 843 |
-1 if <code class="param">bitmap</code> is empty, or if <code class="param">bitmap</code> is infinitely set. </dd></dl> |
| 844 |
|
| 845 |
</div> |
| 846 |
</div> |
| 847 |
<a id="ga45d49aeb45c7da631b1480a93dc3fc92" name="ga45d49aeb45c7da631b1480a93dc3fc92"></a> |
| 848 |
<h2 class="memtitle"><span class="permalink"><a href="#ga45d49aeb45c7da631b1480a93dc3fc92">◆ </a></span>hwloc_bitmap_last_unset()</h2> |
| 849 |
|
| 850 |
<div class="memitem"> |
| 851 |
<div class="memproto"> |
| 852 |
<table class="memname"> |
| 853 |
<tr> |
| 854 |
<td class="memname">int hwloc_bitmap_last_unset </td> |
| 855 |
<td>(</td> |
| 856 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 857 |
<td></td> |
| 858 |
</tr> |
| 859 |
</table> |
| 860 |
</div><div class="memdoc"> |
| 861 |
|
| 862 |
<p>Compute the last unset index (most significant bit) in bitmap <code class="param">bitmap</code>. </p> |
| 863 |
<dl class="section return"><dt>Returns</dt><dd>the last index unset in <code class="param">bitmap</code>. </dd> |
| 864 |
<dd> |
| 865 |
-1 if <code class="param">bitmap</code> is full, or if <code class="param">bitmap</code> is not infinitely set. </dd></dl> |
| 866 |
|
| 867 |
</div> |
| 868 |
</div> |
| 869 |
<a id="ga39c0f1b02053de66d205c9f8260b3665" name="ga39c0f1b02053de66d205c9f8260b3665"></a> |
| 870 |
<h2 class="memtitle"><span class="permalink"><a href="#ga39c0f1b02053de66d205c9f8260b3665">◆ </a></span>hwloc_bitmap_list_asprintf()</h2> |
| 871 |
|
| 872 |
<div class="memitem"> |
| 873 |
<div class="memproto"> |
| 874 |
<table class="memname"> |
| 875 |
<tr> |
| 876 |
<td class="memname">int hwloc_bitmap_list_asprintf </td> |
| 877 |
<td>(</td> |
| 878 |
<td class="paramtype">char **</td> <td class="paramname"><span class="paramname"><em>strp</em></span>, </td> |
| 879 |
</tr> |
| 880 |
<tr> |
| 881 |
<td class="paramkey"></td> |
| 882 |
<td></td> |
| 883 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span> )</td> |
| 884 |
</tr> |
| 885 |
</table> |
| 886 |
</div><div class="memdoc"> |
| 887 |
|
| 888 |
<p>Stringify a bitmap into a newly allocated list string. </p> |
| 889 |
<p>Lists are comma-separated indexes or ranges. Ranges are dash separated indexes. A bitmap containing bits 1, 33, 34, and all from 64 to 95 is printed as <span class="tt">"1,33-34,64-95"</span>. The last range may not have an ending index if the bitmap is infinitely set.</p> |
| 890 |
<dl class="section return"><dt>Returns</dt><dd>the number of characters that were written (not including the ending <code>\0</code>). </dd> |
| 891 |
<dd> |
| 892 |
-1 on error, for instance with <code class="param">errno</code> set to <code>ENOMEM</code> on failure to allocate the output string.</dd></dl> |
| 893 |
<dl class="section note"><dt>Note</dt><dd><b>If the bitmap is a CPU or nodeset, it contains physical indexes.</b> This should be clearly indicated when displaying such bitmaps to end users. See also <a class="el" href="a00386.html#faq_convert_indexes">How do I convert between logical and OS/physical indexes?</a> </dd></dl> |
| 894 |
|
| 895 |
</div> |
| 896 |
</div> |
| 897 |
<a id="ga3d06e6447edeb61e56a9ad83f31f0a37" name="ga3d06e6447edeb61e56a9ad83f31f0a37"></a> |
| 898 |
<h2 class="memtitle"><span class="permalink"><a href="#ga3d06e6447edeb61e56a9ad83f31f0a37">◆ </a></span>hwloc_bitmap_list_snprintf()</h2> |
| 899 |
|
| 900 |
<div class="memitem"> |
| 901 |
<div class="memproto"> |
| 902 |
<table class="memname"> |
| 903 |
<tr> |
| 904 |
<td class="memname">int hwloc_bitmap_list_snprintf </td> |
| 905 |
<td>(</td> |
| 906 |
<td class="paramtype">char *restrict</td> <td class="paramname"><span class="paramname"><em>buf</em></span>, </td> |
| 907 |
</tr> |
| 908 |
<tr> |
| 909 |
<td class="paramkey"></td> |
| 910 |
<td></td> |
| 911 |
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>buflen</em></span>, </td> |
| 912 |
</tr> |
| 913 |
<tr> |
| 914 |
<td class="paramkey"></td> |
| 915 |
<td></td> |
| 916 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span> )</td> |
| 917 |
</tr> |
| 918 |
</table> |
| 919 |
</div><div class="memdoc"> |
| 920 |
|
| 921 |
<p>Stringify a bitmap in the list format. </p> |
| 922 |
<p>Lists are comma-separated indexes or ranges. Ranges are dash separated indexes. A bitmap containing bits 1, 33, 34, and all from 64 to 95 is printed as <span class="tt">"1,33-34,64-95"</span>. The last range may not have an ending index if the bitmap is infinitely set.</p> |
| 923 |
<p>Up to <code class="param">buflen</code> characters may be written in buffer <code class="param">buf</code>.</p> |
| 924 |
<p>If <code class="param">buflen</code> is 0, <code class="param">buf</code> may safely be <code>NULL</code>.</p> |
| 925 |
<dl class="section return"><dt>Returns</dt><dd>the number of characters that were actually written if not truncating, or that would have been written (not including the ending <code>\0</code>). </dd> |
| 926 |
<dd> |
| 927 |
-1 on error.</dd></dl> |
| 928 |
<dl class="section note"><dt>Note</dt><dd><b>If the bitmap is a CPU or nodeset, it contains physical indexes.</b> This should be clearly indicated when displaying such bitmaps to end users. See also <a class="el" href="a00386.html#faq_convert_indexes">How do I convert between logical and OS/physical indexes?</a> </dd></dl> |
| 929 |
|
| 930 |
</div> |
| 931 |
</div> |
| 932 |
<a id="gaf9314311d482c621e17c6a53a9fe993e" name="gaf9314311d482c621e17c6a53a9fe993e"></a> |
| 933 |
<h2 class="memtitle"><span class="permalink"><a href="#gaf9314311d482c621e17c6a53a9fe993e">◆ </a></span>hwloc_bitmap_list_sscanf()</h2> |
| 934 |
|
| 935 |
<div class="memitem"> |
| 936 |
<div class="memproto"> |
| 937 |
<table class="memname"> |
| 938 |
<tr> |
| 939 |
<td class="memname">int hwloc_bitmap_list_sscanf </td> |
| 940 |
<td>(</td> |
| 941 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 942 |
</tr> |
| 943 |
<tr> |
| 944 |
<td class="paramkey"></td> |
| 945 |
<td></td> |
| 946 |
<td class="paramtype">const char *restrict</td> <td class="paramname"><span class="paramname"><em>string</em></span> )</td> |
| 947 |
</tr> |
| 948 |
</table> |
| 949 |
</div><div class="memdoc"> |
| 950 |
|
| 951 |
<p>Parse a list string and stores it in bitmap <code class="param">bitmap</code>. </p> |
| 952 |
<p>Lists are comma-separated indexes or ranges. Ranges are dash separated indexes. String <span class="tt">"1,33-34,64-95"</span> is parsed as a bitmap containing bits 1, 33, 34, and all from 64 to 95. The last range may not have an ending index if the bitmap is infinitely set.</p> |
| 953 |
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl> |
| 954 |
<dl class="section note"><dt>Note</dt><dd><b>If the bitmap is a CPU or nodeset, the input string must contain physical indexes.</b> </dd></dl> |
| 955 |
|
| 956 |
</div> |
| 957 |
</div> |
| 958 |
<a id="gaab7240b4b644693b775dad17b44ffd68" name="gaab7240b4b644693b775dad17b44ffd68"></a> |
| 959 |
<h2 class="memtitle"><span class="permalink"><a href="#gaab7240b4b644693b775dad17b44ffd68">◆ </a></span>hwloc_bitmap_next()</h2> |
| 960 |
|
| 961 |
<div class="memitem"> |
| 962 |
<div class="memproto"> |
| 963 |
<table class="memname"> |
| 964 |
<tr> |
| 965 |
<td class="memname">int hwloc_bitmap_next </td> |
| 966 |
<td>(</td> |
| 967 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 968 |
</tr> |
| 969 |
<tr> |
| 970 |
<td class="paramkey"></td> |
| 971 |
<td></td> |
| 972 |
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>prev</em></span> )</td> |
| 973 |
</tr> |
| 974 |
</table> |
| 975 |
</div><div class="memdoc"> |
| 976 |
|
| 977 |
<p>Compute the next index in bitmap <code class="param">bitmap</code> which is after index <code class="param">prev</code>. </p> |
| 978 |
<dl class="section return"><dt>Returns</dt><dd>the first index set in <code class="param">bitmap</code> if <code class="param">prev</code> is <code>-1</code>. </dd> |
| 979 |
<dd> |
| 980 |
the next index set in <code class="param">bitmap</code> if <code class="param">prev</code> is not <code>-1</code>. </dd> |
| 981 |
<dd> |
| 982 |
-1 if no index with higher index is set in <code class="param">bitmap</code>. </dd></dl> |
| 983 |
|
| 984 |
</div> |
| 985 |
</div> |
| 986 |
<a id="ga9653af34d1460ef106b7df25af4cdca8" name="ga9653af34d1460ef106b7df25af4cdca8"></a> |
| 987 |
<h2 class="memtitle"><span class="permalink"><a href="#ga9653af34d1460ef106b7df25af4cdca8">◆ </a></span>hwloc_bitmap_next_unset()</h2> |
| 988 |
|
| 989 |
<div class="memitem"> |
| 990 |
<div class="memproto"> |
| 991 |
<table class="memname"> |
| 992 |
<tr> |
| 993 |
<td class="memname">int hwloc_bitmap_next_unset </td> |
| 994 |
<td>(</td> |
| 995 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 996 |
</tr> |
| 997 |
<tr> |
| 998 |
<td class="paramkey"></td> |
| 999 |
<td></td> |
| 1000 |
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>prev</em></span> )</td> |
| 1001 |
</tr> |
| 1002 |
</table> |
| 1003 |
</div><div class="memdoc"> |
| 1004 |
|
| 1005 |
<p>Compute the next unset index in bitmap <code class="param">bitmap</code> which is after index <code class="param">prev</code>. </p> |
| 1006 |
<dl class="section return"><dt>Returns</dt><dd>the first index unset in <code class="param">bitmap</code> if <code class="param">prev</code> is <code>-1</code>. </dd> |
| 1007 |
<dd> |
| 1008 |
the next index unset in <code class="param">bitmap</code> if <code class="param">prev</code> is not <code>-1</code>. </dd> |
| 1009 |
<dd> |
| 1010 |
-1 if no index with higher index is unset in <code class="param">bitmap</code>. </dd></dl> |
| 1011 |
|
| 1012 |
</div> |
| 1013 |
</div> |
| 1014 |
<a id="ga84cfdb4f8ab8c1f7e097728e613a2a3f" name="ga84cfdb4f8ab8c1f7e097728e613a2a3f"></a> |
| 1015 |
<h2 class="memtitle"><span class="permalink"><a href="#ga84cfdb4f8ab8c1f7e097728e613a2a3f">◆ </a></span>hwloc_bitmap_not()</h2> |
| 1016 |
|
| 1017 |
<div class="memitem"> |
| 1018 |
<div class="memproto"> |
| 1019 |
<table class="memname"> |
| 1020 |
<tr> |
| 1021 |
<td class="memname">int hwloc_bitmap_not </td> |
| 1022 |
<td>(</td> |
| 1023 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>res</em></span>, </td> |
| 1024 |
</tr> |
| 1025 |
<tr> |
| 1026 |
<td class="paramkey"></td> |
| 1027 |
<td></td> |
| 1028 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span> )</td> |
| 1029 |
</tr> |
| 1030 |
</table> |
| 1031 |
</div><div class="memdoc"> |
| 1032 |
|
| 1033 |
<p>Negate bitmap <code class="param">bitmap</code> and store the result in bitmap <code class="param">res</code>. </p> |
| 1034 |
<p><code class="param">res</code> can be the same as <code class="param">bitmap</code> </p> |
| 1035 |
|
| 1036 |
</div> |
| 1037 |
</div> |
| 1038 |
<a id="gac0744734d761d65c977aece565364908" name="gac0744734d761d65c977aece565364908"></a> |
| 1039 |
<h2 class="memtitle"><span class="permalink"><a href="#gac0744734d761d65c977aece565364908">◆ </a></span>hwloc_bitmap_nr_ulongs()</h2> |
| 1040 |
|
| 1041 |
<div class="memitem"> |
| 1042 |
<div class="memproto"> |
| 1043 |
<table class="memname"> |
| 1044 |
<tr> |
| 1045 |
<td class="memname">int hwloc_bitmap_nr_ulongs </td> |
| 1046 |
<td>(</td> |
| 1047 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 1048 |
<td></td> |
| 1049 |
</tr> |
| 1050 |
</table> |
| 1051 |
</div><div class="memdoc"> |
| 1052 |
|
| 1053 |
<p>Return the number of unsigned longs required for storing bitmap <code class="param">bitmap</code> entirely. </p> |
| 1054 |
<p>This is the number of contiguous unsigned longs from the very first bit of the bitmap (even if unset) up to the last set bit. This is useful for knowing the <code class="param">nr</code> parameter to pass to <a class="el" href="#gacd215a2348732de25d94a4ecd76d528c" title="Convert the first nr subsets of bitmap bitmap into the array of nr unsigned long masks.">hwloc_bitmap_to_ulongs()</a> (or which calls to <a class="el" href="#gac92e6404f648d6b99d2c626b05b2ffa4" title="Convert the i -th subset of bitmap bitmap into unsigned long mask.">hwloc_bitmap_to_ith_ulong()</a> are needed) to entirely convert a bitmap into multiple unsigned longs.</p> |
| 1055 |
<p>When called on the output of <a class="el" href="a00185.html#ga79212faa07b70dd26588941b17d9fa82" title="Get topology CPU set.">hwloc_topology_get_topology_cpuset()</a>, the returned number is large enough for all cpusets of the topology.</p> |
| 1056 |
<dl class="section return"><dt>Returns</dt><dd>the number of unsigned longs required. </dd> |
| 1057 |
<dd> |
| 1058 |
-1 if <code class="param">bitmap</code> is infinite. </dd></dl> |
| 1059 |
|
| 1060 |
</div> |
| 1061 |
</div> |
| 1062 |
<a id="ga10be0840cdeb7ce26d862819dd303baa" name="ga10be0840cdeb7ce26d862819dd303baa"></a> |
| 1063 |
<h2 class="memtitle"><span class="permalink"><a href="#ga10be0840cdeb7ce26d862819dd303baa">◆ </a></span>hwloc_bitmap_only()</h2> |
| 1064 |
|
| 1065 |
<div class="memitem"> |
| 1066 |
<div class="memproto"> |
| 1067 |
<table class="memname"> |
| 1068 |
<tr> |
| 1069 |
<td class="memname">int hwloc_bitmap_only </td> |
| 1070 |
<td>(</td> |
| 1071 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 1072 |
</tr> |
| 1073 |
<tr> |
| 1074 |
<td class="paramkey"></td> |
| 1075 |
<td></td> |
| 1076 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>id</em></span> )</td> |
| 1077 |
</tr> |
| 1078 |
</table> |
| 1079 |
</div><div class="memdoc"> |
| 1080 |
|
| 1081 |
<p>Empty the bitmap <code class="param">bitmap</code> and add bit <code class="param">id</code>. </p> |
| 1082 |
|
| 1083 |
</div> |
| 1084 |
</div> |
| 1085 |
<a id="ga120b8aefb9ce7ef349929656359b1859" name="ga120b8aefb9ce7ef349929656359b1859"></a> |
| 1086 |
<h2 class="memtitle"><span class="permalink"><a href="#ga120b8aefb9ce7ef349929656359b1859">◆ </a></span>hwloc_bitmap_or()</h2> |
| 1087 |
|
| 1088 |
<div class="memitem"> |
| 1089 |
<div class="memproto"> |
| 1090 |
<table class="memname"> |
| 1091 |
<tr> |
| 1092 |
<td class="memname">int hwloc_bitmap_or </td> |
| 1093 |
<td>(</td> |
| 1094 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>res</em></span>, </td> |
| 1095 |
</tr> |
| 1096 |
<tr> |
| 1097 |
<td class="paramkey"></td> |
| 1098 |
<td></td> |
| 1099 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap1</em></span>, </td> |
| 1100 |
</tr> |
| 1101 |
<tr> |
| 1102 |
<td class="paramkey"></td> |
| 1103 |
<td></td> |
| 1104 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap2</em></span> )</td> |
| 1105 |
</tr> |
| 1106 |
</table> |
| 1107 |
</div><div class="memdoc"> |
| 1108 |
|
| 1109 |
<p>Or bitmaps <code class="param">bitmap1</code> and <code class="param">bitmap2</code> and store the result in bitmap <code class="param">res</code>. </p> |
| 1110 |
<p><code class="param">res</code> can be the same as <code class="param">bitmap1</code> or <code class="param">bitmap2</code> </p> |
| 1111 |
|
| 1112 |
</div> |
| 1113 |
</div> |
| 1114 |
<a id="ga062dbff93baeff3b425a7260c5463646" name="ga062dbff93baeff3b425a7260c5463646"></a> |
| 1115 |
<h2 class="memtitle"><span class="permalink"><a href="#ga062dbff93baeff3b425a7260c5463646">◆ </a></span>hwloc_bitmap_set()</h2> |
| 1116 |
|
| 1117 |
<div class="memitem"> |
| 1118 |
<div class="memproto"> |
| 1119 |
<table class="memname"> |
| 1120 |
<tr> |
| 1121 |
<td class="memname">int hwloc_bitmap_set </td> |
| 1122 |
<td>(</td> |
| 1123 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 1124 |
</tr> |
| 1125 |
<tr> |
| 1126 |
<td class="paramkey"></td> |
| 1127 |
<td></td> |
| 1128 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>id</em></span> )</td> |
| 1129 |
</tr> |
| 1130 |
</table> |
| 1131 |
</div><div class="memdoc"> |
| 1132 |
|
| 1133 |
<p>Add index <code class="param">id</code> in bitmap <code class="param">bitmap</code>. </p> |
| 1134 |
|
| 1135 |
</div> |
| 1136 |
</div> |
| 1137 |
<a id="ga3daeed965c35c6d2fd4820a318219985" name="ga3daeed965c35c6d2fd4820a318219985"></a> |
| 1138 |
<h2 class="memtitle"><span class="permalink"><a href="#ga3daeed965c35c6d2fd4820a318219985">◆ </a></span>hwloc_bitmap_set_ith_ulong()</h2> |
| 1139 |
|
| 1140 |
<div class="memitem"> |
| 1141 |
<div class="memproto"> |
| 1142 |
<table class="memname"> |
| 1143 |
<tr> |
| 1144 |
<td class="memname">int hwloc_bitmap_set_ith_ulong </td> |
| 1145 |
<td>(</td> |
| 1146 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 1147 |
</tr> |
| 1148 |
<tr> |
| 1149 |
<td class="paramkey"></td> |
| 1150 |
<td></td> |
| 1151 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>i</em></span>, </td> |
| 1152 |
</tr> |
| 1153 |
<tr> |
| 1154 |
<td class="paramkey"></td> |
| 1155 |
<td></td> |
| 1156 |
<td class="paramtype">unsigned long</td> <td class="paramname"><span class="paramname"><em>mask</em></span> )</td> |
| 1157 |
</tr> |
| 1158 |
</table> |
| 1159 |
</div><div class="memdoc"> |
| 1160 |
|
| 1161 |
<p>Replace <code class="param">i</code> -th subset of bitmap <code class="param">bitmap</code> with unsigned long <code class="param">mask</code>. </p> |
| 1162 |
|
| 1163 |
</div> |
| 1164 |
</div> |
| 1165 |
<a id="ga9c9a8433732fb9f24899e7aa4c014d7e" name="ga9c9a8433732fb9f24899e7aa4c014d7e"></a> |
| 1166 |
<h2 class="memtitle"><span class="permalink"><a href="#ga9c9a8433732fb9f24899e7aa4c014d7e">◆ </a></span>hwloc_bitmap_set_range()</h2> |
| 1167 |
|
| 1168 |
<div class="memitem"> |
| 1169 |
<div class="memproto"> |
| 1170 |
<table class="memname"> |
| 1171 |
<tr> |
| 1172 |
<td class="memname">int hwloc_bitmap_set_range </td> |
| 1173 |
<td>(</td> |
| 1174 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 1175 |
</tr> |
| 1176 |
<tr> |
| 1177 |
<td class="paramkey"></td> |
| 1178 |
<td></td> |
| 1179 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>begin</em></span>, </td> |
| 1180 |
</tr> |
| 1181 |
<tr> |
| 1182 |
<td class="paramkey"></td> |
| 1183 |
<td></td> |
| 1184 |
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>end</em></span> )</td> |
| 1185 |
</tr> |
| 1186 |
</table> |
| 1187 |
</div><div class="memdoc"> |
| 1188 |
|
| 1189 |
<p>Add indexes from <code class="param">begin</code> to <code class="param">end</code> in bitmap <code class="param">bitmap</code>. </p> |
| 1190 |
<p>If <code class="param">end</code> is <code>-1</code>, the range is infinite. </p> |
| 1191 |
|
| 1192 |
</div> |
| 1193 |
</div> |
| 1194 |
<a id="gaa611a77c092e679246afdf9a60d5db8b" name="gaa611a77c092e679246afdf9a60d5db8b"></a> |
| 1195 |
<h2 class="memtitle"><span class="permalink"><a href="#gaa611a77c092e679246afdf9a60d5db8b">◆ </a></span>hwloc_bitmap_singlify()</h2> |
| 1196 |
|
| 1197 |
<div class="memitem"> |
| 1198 |
<div class="memproto"> |
| 1199 |
<table class="memname"> |
| 1200 |
<tr> |
| 1201 |
<td class="memname">int hwloc_bitmap_singlify </td> |
| 1202 |
<td>(</td> |
| 1203 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 1204 |
<td></td> |
| 1205 |
</tr> |
| 1206 |
</table> |
| 1207 |
</div><div class="memdoc"> |
| 1208 |
|
| 1209 |
<p>Keep a single index among those set in bitmap <code class="param">bitmap</code>. </p> |
| 1210 |
<p>May be useful before binding so that the process does not have a chance of migrating between multiple processors in the original mask. Instead of running the task on any PU inside the given CPU set, the operating system scheduler will be forced to run it on a single of these PUs. It avoids a migration overhead and cache-line ping-pongs between PUs.</p> |
| 1211 |
<dl class="section note"><dt>Note</dt><dd>This function is NOT meant to distribute multiple processes within a single CPU set. It always return the same single bit when called multiple times on the same input set. <a class="el" href="a00184.html#gac14e61485402837e87293079fa0270f2" title="Distribute n items over the topology under roots.">hwloc_distrib()</a> may be used for generating CPU sets to distribute multiple tasks below a single multi-PU object.</dd> |
| 1212 |
<dd> |
| 1213 |
This function cannot be applied to an object set directly. It should be applied to a copy (which may be obtained with <a class="el" href="#gae679434c1a5f41d3560a8a7e2c1b0dee" title="Duplicate bitmap bitmap by allocating a new bitmap and copying bitmap contents.">hwloc_bitmap_dup()</a>). </dd></dl> |
| 1214 |
|
| 1215 |
</div> |
| 1216 |
</div> |
| 1217 |
<a id="ga9511644657030a021dce9941e3cda583" name="ga9511644657030a021dce9941e3cda583"></a> |
| 1218 |
<h2 class="memtitle"><span class="permalink"><a href="#ga9511644657030a021dce9941e3cda583">◆ </a></span>hwloc_bitmap_snprintf()</h2> |
| 1219 |
|
| 1220 |
<div class="memitem"> |
| 1221 |
<div class="memproto"> |
| 1222 |
<table class="memname"> |
| 1223 |
<tr> |
| 1224 |
<td class="memname">int hwloc_bitmap_snprintf </td> |
| 1225 |
<td>(</td> |
| 1226 |
<td class="paramtype">char *restrict</td> <td class="paramname"><span class="paramname"><em>buf</em></span>, </td> |
| 1227 |
</tr> |
| 1228 |
<tr> |
| 1229 |
<td class="paramkey"></td> |
| 1230 |
<td></td> |
| 1231 |
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>buflen</em></span>, </td> |
| 1232 |
</tr> |
| 1233 |
<tr> |
| 1234 |
<td class="paramkey"></td> |
| 1235 |
<td></td> |
| 1236 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span> )</td> |
| 1237 |
</tr> |
| 1238 |
</table> |
| 1239 |
</div><div class="memdoc"> |
| 1240 |
|
| 1241 |
<p>Stringify a bitmap in the default hwloc format. </p> |
| 1242 |
<p>Print the bits set inside a bitmap as a comma-separated list of hexadecimal 32-bit blocks. A bitmap containing bits 1, 33, 34, and all from 64 to 95 is printed as <span class="tt">"0xffffffff,0x00000006,0x00000002"</span>.</p> |
| 1243 |
<p>Up to <code class="param">buflen</code> characters may be written in buffer <code class="param">buf</code>.</p> |
| 1244 |
<p>If <code class="param">buflen</code> is 0, <code class="param">buf</code> may safely be <code>NULL</code>.</p> |
| 1245 |
<dl class="section return"><dt>Returns</dt><dd>the number of characters that were actually written if not truncating, or that would have been written (not including the ending <code>\0</code>). </dd> |
| 1246 |
<dd> |
| 1247 |
-1 on error.</dd></dl> |
| 1248 |
<dl class="section note"><dt>Note</dt><dd><b>If the bitmap is a CPU or nodeset, it contains physical indexes.</b> This should be clearly indicated when displaying such bitmaps to end users. See also <a class="el" href="a00386.html#faq_convert_indexes">How do I convert between logical and OS/physical indexes?</a> </dd></dl> |
| 1249 |
|
| 1250 |
</div> |
| 1251 |
</div> |
| 1252 |
<a id="ga064a85c643a364b60acbfa0f3663fc18" name="ga064a85c643a364b60acbfa0f3663fc18"></a> |
| 1253 |
<h2 class="memtitle"><span class="permalink"><a href="#ga064a85c643a364b60acbfa0f3663fc18">◆ </a></span>hwloc_bitmap_sscanf()</h2> |
| 1254 |
|
| 1255 |
<div class="memitem"> |
| 1256 |
<div class="memproto"> |
| 1257 |
<table class="memname"> |
| 1258 |
<tr> |
| 1259 |
<td class="memname">int hwloc_bitmap_sscanf </td> |
| 1260 |
<td>(</td> |
| 1261 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 1262 |
</tr> |
| 1263 |
<tr> |
| 1264 |
<td class="paramkey"></td> |
| 1265 |
<td></td> |
| 1266 |
<td class="paramtype">const char *restrict</td> <td class="paramname"><span class="paramname"><em>string</em></span> )</td> |
| 1267 |
</tr> |
| 1268 |
</table> |
| 1269 |
</div><div class="memdoc"> |
| 1270 |
|
| 1271 |
<p>Parse a bitmap string as the default hwloc format and stores it in bitmap <code class="param">bitmap</code>. </p> |
| 1272 |
<p>The input string should be a comma-separared list of hexadecimal 32-bit blocks. String <span class="tt">"0xffffffff,0x6,0x2"</span> is parsed as a bitmap containing all bits between 64 and 95, and bits 33, 34 and 1.</p> |
| 1273 |
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl> |
| 1274 |
<dl class="section note"><dt>Note</dt><dd><b>If the bitmap is a CPU or nodeset, the input string must contain physical indexes.</b> </dd></dl> |
| 1275 |
|
| 1276 |
</div> |
| 1277 |
</div> |
| 1278 |
<a id="ga391312513f17c985d871f18367c59512" name="ga391312513f17c985d871f18367c59512"></a> |
| 1279 |
<h2 class="memtitle"><span class="permalink"><a href="#ga391312513f17c985d871f18367c59512">◆ </a></span>hwloc_bitmap_taskset_asprintf()</h2> |
| 1280 |
|
| 1281 |
<div class="memitem"> |
| 1282 |
<div class="memproto"> |
| 1283 |
<table class="memname"> |
| 1284 |
<tr> |
| 1285 |
<td class="memname">int hwloc_bitmap_taskset_asprintf </td> |
| 1286 |
<td>(</td> |
| 1287 |
<td class="paramtype">char **</td> <td class="paramname"><span class="paramname"><em>strp</em></span>, </td> |
| 1288 |
</tr> |
| 1289 |
<tr> |
| 1290 |
<td class="paramkey"></td> |
| 1291 |
<td></td> |
| 1292 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span> )</td> |
| 1293 |
</tr> |
| 1294 |
</table> |
| 1295 |
</div><div class="memdoc"> |
| 1296 |
|
| 1297 |
<p>Stringify a bitmap into a newly allocated taskset-specific string. </p> |
| 1298 |
<p>The taskset program manipulates bitmap strings that contain a single (possible very long) hexadecimal number starting with 0x. A bitmap containing bits 1, 33, 34, and all from 64 to 95 is printed as <span class="tt">"0xffffffff0000000600000002"</span>.</p> |
| 1299 |
<dl class="section return"><dt>Returns</dt><dd>the number of characters that were written (not including the ending <code>\0</code>). </dd> |
| 1300 |
<dd> |
| 1301 |
-1 on error, for instance with <code class="param">errno</code> set to <code>ENOMEM</code> on failure to allocate the output string.</dd></dl> |
| 1302 |
<dl class="section note"><dt>Note</dt><dd><b>If the bitmap is a CPU or nodeset, it contains physical indexes.</b> This should be clearly indicated when displaying such bitmaps to end users. See also <a class="el" href="a00386.html#faq_convert_indexes">How do I convert between logical and OS/physical indexes?</a> </dd></dl> |
| 1303 |
|
| 1304 |
</div> |
| 1305 |
</div> |
| 1306 |
<a id="ga5beb68a987fe48e5c5edef06ab260e14" name="ga5beb68a987fe48e5c5edef06ab260e14"></a> |
| 1307 |
<h2 class="memtitle"><span class="permalink"><a href="#ga5beb68a987fe48e5c5edef06ab260e14">◆ </a></span>hwloc_bitmap_taskset_snprintf()</h2> |
| 1308 |
|
| 1309 |
<div class="memitem"> |
| 1310 |
<div class="memproto"> |
| 1311 |
<table class="memname"> |
| 1312 |
<tr> |
| 1313 |
<td class="memname">int hwloc_bitmap_taskset_snprintf </td> |
| 1314 |
<td>(</td> |
| 1315 |
<td class="paramtype">char *restrict</td> <td class="paramname"><span class="paramname"><em>buf</em></span>, </td> |
| 1316 |
</tr> |
| 1317 |
<tr> |
| 1318 |
<td class="paramkey"></td> |
| 1319 |
<td></td> |
| 1320 |
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>buflen</em></span>, </td> |
| 1321 |
</tr> |
| 1322 |
<tr> |
| 1323 |
<td class="paramkey"></td> |
| 1324 |
<td></td> |
| 1325 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span> )</td> |
| 1326 |
</tr> |
| 1327 |
</table> |
| 1328 |
</div><div class="memdoc"> |
| 1329 |
|
| 1330 |
<p>Stringify a bitmap in the taskset-specific format. </p> |
| 1331 |
<p>The taskset program manipulates bitmap strings that contain a single (possible very long) hexadecimal number starting with 0x. A bitmap containing bits 1, 33, 34, and all from 64 to 95 is printed as <span class="tt">"0xffffffff0000000600000002"</span>.</p> |
| 1332 |
<p>Up to <code class="param">buflen</code> characters may be written in buffer <code class="param">buf</code>.</p> |
| 1333 |
<p>If <code class="param">buflen</code> is 0, <code class="param">buf</code> may safely be <code>NULL</code>.</p> |
| 1334 |
<dl class="section return"><dt>Returns</dt><dd>the number of characters that were actually written if not truncating, or that would have been written (not including the ending <code>\0</code>). </dd> |
| 1335 |
<dd> |
| 1336 |
-1 on error.</dd></dl> |
| 1337 |
<dl class="section note"><dt>Note</dt><dd><b>If the bitmap is a CPU or nodeset, it contains physical indexes.</b> This should be clearly indicated when displaying such bitmaps to end users. See also <a class="el" href="a00386.html#faq_convert_indexes">How do I convert between logical and OS/physical indexes?</a> </dd></dl> |
| 1338 |
|
| 1339 |
</div> |
| 1340 |
</div> |
| 1341 |
<a id="ga4f23db5041240e03e348752f8bd6ec2d" name="ga4f23db5041240e03e348752f8bd6ec2d"></a> |
| 1342 |
<h2 class="memtitle"><span class="permalink"><a href="#ga4f23db5041240e03e348752f8bd6ec2d">◆ </a></span>hwloc_bitmap_taskset_sscanf()</h2> |
| 1343 |
|
| 1344 |
<div class="memitem"> |
| 1345 |
<div class="memproto"> |
| 1346 |
<table class="memname"> |
| 1347 |
<tr> |
| 1348 |
<td class="memname">int hwloc_bitmap_taskset_sscanf </td> |
| 1349 |
<td>(</td> |
| 1350 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 1351 |
</tr> |
| 1352 |
<tr> |
| 1353 |
<td class="paramkey"></td> |
| 1354 |
<td></td> |
| 1355 |
<td class="paramtype">const char *restrict</td> <td class="paramname"><span class="paramname"><em>string</em></span> )</td> |
| 1356 |
</tr> |
| 1357 |
</table> |
| 1358 |
</div><div class="memdoc"> |
| 1359 |
|
| 1360 |
<p>Parse a taskset-specific bitmap string and stores it in bitmap <code class="param">bitmap</code>. </p> |
| 1361 |
<p>The taskset program manipulates bitmap strings that contain a single (possible very long) hexadecimal number starting with 0x. String <span class="tt">"0xffffffff0000000600000002"</span> is parsed as a bitmap containing all bits between 64 and 95, and bits 33, 34 and 1.</p> |
| 1362 |
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl> |
| 1363 |
<dl class="section note"><dt>Note</dt><dd><b>If the bitmap is a CPU or nodeset, the input string must contain physical indexes.</b> </dd></dl> |
| 1364 |
|
| 1365 |
</div> |
| 1366 |
</div> |
| 1367 |
<a id="gac92e6404f648d6b99d2c626b05b2ffa4" name="gac92e6404f648d6b99d2c626b05b2ffa4"></a> |
| 1368 |
<h2 class="memtitle"><span class="permalink"><a href="#gac92e6404f648d6b99d2c626b05b2ffa4">◆ </a></span>hwloc_bitmap_to_ith_ulong()</h2> |
| 1369 |
|
| 1370 |
<div class="memitem"> |
| 1371 |
<div class="memproto"> |
| 1372 |
<table class="memname"> |
| 1373 |
<tr> |
| 1374 |
<td class="memname">unsigned long hwloc_bitmap_to_ith_ulong </td> |
| 1375 |
<td>(</td> |
| 1376 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 1377 |
</tr> |
| 1378 |
<tr> |
| 1379 |
<td class="paramkey"></td> |
| 1380 |
<td></td> |
| 1381 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>i</em></span> )</td> |
| 1382 |
</tr> |
| 1383 |
</table> |
| 1384 |
</div><div class="memdoc"> |
| 1385 |
|
| 1386 |
<p>Convert the <code class="param">i</code> -th subset of bitmap <code class="param">bitmap</code> into unsigned long mask. </p> |
| 1387 |
|
| 1388 |
</div> |
| 1389 |
</div> |
| 1390 |
<a id="gab6a6bae22a33ec6adfc169a953c13e6c" name="gab6a6bae22a33ec6adfc169a953c13e6c"></a> |
| 1391 |
<h2 class="memtitle"><span class="permalink"><a href="#gab6a6bae22a33ec6adfc169a953c13e6c">◆ </a></span>hwloc_bitmap_to_ulong()</h2> |
| 1392 |
|
| 1393 |
<div class="memitem"> |
| 1394 |
<div class="memproto"> |
| 1395 |
<table class="memname"> |
| 1396 |
<tr> |
| 1397 |
<td class="memname">unsigned long hwloc_bitmap_to_ulong </td> |
| 1398 |
<td>(</td> |
| 1399 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 1400 |
<td></td> |
| 1401 |
</tr> |
| 1402 |
</table> |
| 1403 |
</div><div class="memdoc"> |
| 1404 |
|
| 1405 |
<p>Convert the beginning part of bitmap <code class="param">bitmap</code> into unsigned long <code class="param">mask</code>. </p> |
| 1406 |
|
| 1407 |
</div> |
| 1408 |
</div> |
| 1409 |
<a id="gacd215a2348732de25d94a4ecd76d528c" name="gacd215a2348732de25d94a4ecd76d528c"></a> |
| 1410 |
<h2 class="memtitle"><span class="permalink"><a href="#gacd215a2348732de25d94a4ecd76d528c">◆ </a></span>hwloc_bitmap_to_ulongs()</h2> |
| 1411 |
|
| 1412 |
<div class="memitem"> |
| 1413 |
<div class="memproto"> |
| 1414 |
<table class="memname"> |
| 1415 |
<tr> |
| 1416 |
<td class="memname">int hwloc_bitmap_to_ulongs </td> |
| 1417 |
<td>(</td> |
| 1418 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span>, </td> |
| 1419 |
</tr> |
| 1420 |
<tr> |
| 1421 |
<td class="paramkey"></td> |
| 1422 |
<td></td> |
| 1423 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>nr</em></span>, </td> |
| 1424 |
</tr> |
| 1425 |
<tr> |
| 1426 |
<td class="paramkey"></td> |
| 1427 |
<td></td> |
| 1428 |
<td class="paramtype">unsigned long *</td> <td class="paramname"><span class="paramname"><em>masks</em></span> )</td> |
| 1429 |
</tr> |
| 1430 |
</table> |
| 1431 |
</div><div class="memdoc"> |
| 1432 |
|
| 1433 |
<p>Convert the first <code class="param">nr</code> subsets of bitmap <code class="param">bitmap</code> into the array of <code class="param">nr</code> unsigned long <code class="param">masks</code>. </p> |
| 1434 |
<p><code class="param">nr</code> may be determined earlier with <a class="el" href="#gac0744734d761d65c977aece565364908" title="Return the number of unsigned longs required for storing bitmap bitmap entirely.">hwloc_bitmap_nr_ulongs()</a>.</p> |
| 1435 |
<dl class="section return"><dt>Returns</dt><dd>0 </dd></dl> |
| 1436 |
|
| 1437 |
</div> |
| 1438 |
</div> |
| 1439 |
<a id="ga0200466842c0e1f5da75e84dde460b10" name="ga0200466842c0e1f5da75e84dde460b10"></a> |
| 1440 |
<h2 class="memtitle"><span class="permalink"><a href="#ga0200466842c0e1f5da75e84dde460b10">◆ </a></span>hwloc_bitmap_weight()</h2> |
| 1441 |
|
| 1442 |
<div class="memitem"> |
| 1443 |
<div class="memproto"> |
| 1444 |
<table class="memname"> |
| 1445 |
<tr> |
| 1446 |
<td class="memname">int hwloc_bitmap_weight </td> |
| 1447 |
<td>(</td> |
| 1448 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 1449 |
<td></td> |
| 1450 |
</tr> |
| 1451 |
</table> |
| 1452 |
</div><div class="memdoc"> |
| 1453 |
|
| 1454 |
<p>Compute the "weight" of bitmap <code class="param">bitmap</code> (i.e., number of indexes that are in the bitmap). </p> |
| 1455 |
<dl class="section return"><dt>Returns</dt><dd>the number of indexes that are in the bitmap. </dd> |
| 1456 |
<dd> |
| 1457 |
-1 if <code class="param">bitmap</code> is infinitely set. </dd></dl> |
| 1458 |
|
| 1459 |
</div> |
| 1460 |
</div> |
| 1461 |
<a id="ga205508218e09cb9befd0687f16409f09" name="ga205508218e09cb9befd0687f16409f09"></a> |
| 1462 |
<h2 class="memtitle"><span class="permalink"><a href="#ga205508218e09cb9befd0687f16409f09">◆ </a></span>hwloc_bitmap_xor()</h2> |
| 1463 |
|
| 1464 |
<div class="memitem"> |
| 1465 |
<div class="memproto"> |
| 1466 |
<table class="memname"> |
| 1467 |
<tr> |
| 1468 |
<td class="memname">int hwloc_bitmap_xor </td> |
| 1469 |
<td>(</td> |
| 1470 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>res</em></span>, </td> |
| 1471 |
</tr> |
| 1472 |
<tr> |
| 1473 |
<td class="paramkey"></td> |
| 1474 |
<td></td> |
| 1475 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap1</em></span>, </td> |
| 1476 |
</tr> |
| 1477 |
<tr> |
| 1478 |
<td class="paramkey"></td> |
| 1479 |
<td></td> |
| 1480 |
<td class="paramtype"><a class="el" href="#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap2</em></span> )</td> |
| 1481 |
</tr> |
| 1482 |
</table> |
| 1483 |
</div><div class="memdoc"> |
| 1484 |
|
| 1485 |
<p>Xor bitmaps <code class="param">bitmap1</code> and <code class="param">bitmap2</code> and store the result in bitmap <code class="param">res</code>. </p> |
| 1486 |
<p><code class="param">res</code> can be the same as <code class="param">bitmap1</code> or <code class="param">bitmap2</code> </p> |
| 1487 |
|
| 1488 |
</div> |
| 1489 |
</div> |
| 1490 |
<a id="gaa97c5217613c8cae9862287170ea2132" name="gaa97c5217613c8cae9862287170ea2132"></a> |
| 1491 |
<h2 class="memtitle"><span class="permalink"><a href="#gaa97c5217613c8cae9862287170ea2132">◆ </a></span>hwloc_bitmap_zero()</h2> |
| 1492 |
|
| 1493 |
<div class="memitem"> |
| 1494 |
<div class="memproto"> |
| 1495 |
<table class="memname"> |
| 1496 |
<tr> |
| 1497 |
<td class="memname">void hwloc_bitmap_zero </td> |
| 1498 |
<td>(</td> |
| 1499 |
<td class="paramtype"><a class="el" href="#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>bitmap</em></span></td><td>)</td> |
| 1500 |
<td></td> |
| 1501 |
</tr> |
| 1502 |
</table> |
| 1503 |
</div><div class="memdoc"> |
| 1504 |
|
| 1505 |
<p>Empty the bitmap <code class="param">bitmap</code>. </p> |
| 1506 |
|
| 1507 |
</div> |
| 1508 |
</div> |
| 1509 |
</div><!-- contents --> |
| 1510 |
<!-- start footer part --> |
| 1511 |
<hr class="footer"/><address class="footer"><small> |
| 1512 |
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.15.0 |
| 1513 |
</small></address> |
| 1514 |
</div><!-- doc-content --> |
| 1515 |
</body> |
| 1516 |
</html> |