\hypertarget{group__hwlocality__membinding}{\section{Memory binding}
\label{group__hwlocality__membinding}\index{Memory binding@{Memory binding}}
}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} \{ \\*
\hyperlink{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8a18675bb80ebc1bce5b652e9de8f3998c}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+D\+E\+F\+A\+U\+L\+T}, 
\hyperlink{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8a979c7aa78dd32780858f30f47a72cca0}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+F\+I\+R\+S\+T\+T\+O\+U\+C\+H}, 
\hyperlink{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8ad811fa4b2a6002c4d63695a408ffde2c}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+B\+I\+N\+D}, 
\hyperlink{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8ae370075e5af016d42310f87ea5af236b}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+I\+N\+T\+E\+R\+L\+E\+A\+V\+E}, 
\\*
\hyperlink{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8afb37480fe5f4236eb7dd4aef26f691e9}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+R\+E\+P\+L\+I\+C\+A\+T\+E}, 
\hyperlink{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8aecdd4164d647708fbb51a00d98dbb138}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+E\+X\+T\+T\+O\+U\+C\+H}, 
\hyperlink{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8a3185bd869b67817fb2bd5164bf360402}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D}
 \}
\begin{DoxyCompactList}\small\item\em Memory binding policy. \end{DoxyCompactList}\item 
enum \hyperlink{group__hwlocality__membinding_gab00475fd98815bf4fb9aaf752030e7d2}{hwloc\+\_\+membind\+\_\+flags\+\_\+t} \{ \\*
\hyperlink{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2a1b1b74aef138f64aff214a8cbdfe8eb4}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S}, 
\hyperlink{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2a1dc7dd5cdcd5796893a325a524555298}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D}, 
\hyperlink{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2a0335311a0ee04166df2888d52b4a42c6}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T}, 
\hyperlink{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2aa6e49e54f52827cb143cc869cfd748af}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+G\+R\+A\+T\+E}, 
\\*
\hyperlink{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2aad6b9eaf2ee324ca58dc8f58094b9997}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+O\+C\+P\+U\+B\+I\+N\+D}
 \}
\begin{DoxyCompactList}\small\item\em Memory binding flags. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_ga747962cbb16fd12ad6d126011c734a27}{hwloc\+\_\+set\+\_\+membind\+\_\+nodeset} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga2f5276235841ad66a79bedad16a5a10c}{hwloc\+\_\+const\+\_\+nodeset\+\_\+t} nodeset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} policy, int flags)
\begin{DoxyCompactList}\small\item\em Set the default memory binding policy of the current process or thread to prefer the N\+U\+M\+A node(s) specified by physical {\ttfamily nodeset}. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_ga8b6d1d90227aff8e44ef26bc1f8a8f95}{hwloc\+\_\+set\+\_\+membind} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga1f784433e9b606261f62d1134f6a3b25}{hwloc\+\_\+const\+\_\+cpuset\+\_\+t} cpuset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} policy, int flags)
\begin{DoxyCompactList}\small\item\em Set the default memory binding policy of the current process or thread to prefer the N\+U\+M\+A node(s) near the specified physical {\ttfamily cpuset}. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_ga7b46a4ca0b2db9723ca73b0c148ccd93}{hwloc\+\_\+get\+\_\+membind\+\_\+nodeset} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga37e35730fa7e775b5bb0afe893d6d508}{hwloc\+\_\+nodeset\+\_\+t} nodeset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$policy, int flags)
\begin{DoxyCompactList}\small\item\em Query the default memory binding policy and physical locality of the current process or thread. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_gab07aedba1119f99130e5f0b796b7d8a5}{hwloc\+\_\+get\+\_\+membind} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga4bbf39b68b6f568fb92739e7c0ea7801}{hwloc\+\_\+cpuset\+\_\+t} cpuset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$policy, int flags)
\begin{DoxyCompactList}\small\item\em Query the default memory binding policy and physical locality of the current process or thread (the locality is returned in {\ttfamily cpuset} as C\+P\+Us near the locality's actual N\+U\+M\+A node(s)). \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_gaf10d18cd4703ec980d7440a1c23fa07f}{hwloc\+\_\+set\+\_\+proc\+\_\+membind\+\_\+nodeset} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, hwloc\+\_\+pid\+\_\+t pid, \hyperlink{group__hwlocality__sets_ga2f5276235841ad66a79bedad16a5a10c}{hwloc\+\_\+const\+\_\+nodeset\+\_\+t} nodeset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} policy, int flags)
\begin{DoxyCompactList}\small\item\em Set the default memory binding policy of the specified process to prefer the N\+U\+M\+A node(s) specified by physical {\ttfamily nodeset}. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_gac63c4517e71b3f0d41b3dee3e83dc55c}{hwloc\+\_\+set\+\_\+proc\+\_\+membind} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, hwloc\+\_\+pid\+\_\+t pid, \hyperlink{group__hwlocality__sets_ga1f784433e9b606261f62d1134f6a3b25}{hwloc\+\_\+const\+\_\+cpuset\+\_\+t} cpuset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} policy, int flags)
\begin{DoxyCompactList}\small\item\em Set the default memory binding policy of the specified process to prefer the N\+U\+M\+A node(s) near the specified physical {\ttfamily cpuset}. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_ga22074ed072e1039f74f17f7b16e9e39d}{hwloc\+\_\+get\+\_\+proc\+\_\+membind\+\_\+nodeset} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, hwloc\+\_\+pid\+\_\+t pid, \hyperlink{group__hwlocality__sets_ga37e35730fa7e775b5bb0afe893d6d508}{hwloc\+\_\+nodeset\+\_\+t} nodeset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$policy, int flags)
\begin{DoxyCompactList}\small\item\em Query the default memory binding policy and physical locality of the specified process. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_gabaf9c13f1fa301d6895594cec52226e2}{hwloc\+\_\+get\+\_\+proc\+\_\+membind} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, hwloc\+\_\+pid\+\_\+t pid, \hyperlink{group__hwlocality__sets_ga4bbf39b68b6f568fb92739e7c0ea7801}{hwloc\+\_\+cpuset\+\_\+t} cpuset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$policy, int flags)
\begin{DoxyCompactList}\small\item\em Query the default memory binding policy and physical locality of the specified process (the locality is returned in {\ttfamily cpuset} as C\+P\+Us near the locality's actual N\+U\+M\+A node(s)). \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_gade5e2c28ea8475a479bf2b1df36c6ccd}{hwloc\+\_\+set\+\_\+area\+\_\+membind\+\_\+nodeset} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, const void $\ast$addr, size\+\_\+t len, \hyperlink{group__hwlocality__sets_ga2f5276235841ad66a79bedad16a5a10c}{hwloc\+\_\+const\+\_\+nodeset\+\_\+t} nodeset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} policy, int flags)
\begin{DoxyCompactList}\small\item\em Bind the already-\/allocated memory identified by (addr, len) to the N\+U\+M\+A node(s) in physical {\ttfamily nodeset}. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_ga06594edeb4728cb9e014aed924d1e74a}{hwloc\+\_\+set\+\_\+area\+\_\+membind} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, const void $\ast$addr, size\+\_\+t len, \hyperlink{group__hwlocality__sets_ga1f784433e9b606261f62d1134f6a3b25}{hwloc\+\_\+const\+\_\+cpuset\+\_\+t} cpuset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} policy, int flags)
\begin{DoxyCompactList}\small\item\em Bind the already-\/allocated memory identified by (addr, len) to the N\+U\+M\+A node(s) near physical {\ttfamily cpuset}. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_ga106e6fcd764d17be682faf7a5bc95720}{hwloc\+\_\+get\+\_\+area\+\_\+membind\+\_\+nodeset} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, const void $\ast$addr, size\+\_\+t len, \hyperlink{group__hwlocality__sets_ga37e35730fa7e775b5bb0afe893d6d508}{hwloc\+\_\+nodeset\+\_\+t} nodeset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$policy, int flags)
\begin{DoxyCompactList}\small\item\em Query the physical N\+U\+M\+A node(s) and binding policy of the memory identified by ({\ttfamily addr}, {\ttfamily len} ). \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_gac02ee8f7606382ea7855ae4e1656ed0f}{hwloc\+\_\+get\+\_\+area\+\_\+membind} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, const void $\ast$addr, size\+\_\+t len, \hyperlink{group__hwlocality__sets_ga4bbf39b68b6f568fb92739e7c0ea7801}{hwloc\+\_\+cpuset\+\_\+t} cpuset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$policy, int flags)
\begin{DoxyCompactList}\small\item\em Query the C\+P\+Us near the physical N\+U\+M\+A node(s) and binding policy of the memory identified by ({\ttfamily addr}, {\ttfamily len} ). \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void $\ast$ \hyperlink{group__hwlocality__membinding_gac5586e58cf25c3596b7d4aa31ce13259}{hwloc\+\_\+alloc} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, size\+\_\+t len)
\begin{DoxyCompactList}\small\item\em Allocate some memory. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void $\ast$ \hyperlink{group__hwlocality__membinding_gaeaa00714a9c4319bda0a74ca6f8720e8}{hwloc\+\_\+alloc\+\_\+membind\+\_\+nodeset} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, size\+\_\+t len, \hyperlink{group__hwlocality__sets_ga2f5276235841ad66a79bedad16a5a10c}{hwloc\+\_\+const\+\_\+nodeset\+\_\+t} nodeset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} policy, int flags) \+\_\+\+\_\+hwloc\+\_\+attribute\+\_\+malloc
\begin{DoxyCompactList}\small\item\em Allocate some memory on the given physical nodeset {\ttfamily nodeset}. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void $\ast$ \hyperlink{group__hwlocality__membinding_ga221a7edc5d436300374fa16463f607e5}{hwloc\+\_\+alloc\+\_\+membind} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, size\+\_\+t len, \hyperlink{group__hwlocality__sets_ga1f784433e9b606261f62d1134f6a3b25}{hwloc\+\_\+const\+\_\+cpuset\+\_\+t} cpuset, \hyperlink{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{hwloc\+\_\+membind\+\_\+policy\+\_\+t} policy, int flags) \+\_\+\+\_\+hwloc\+\_\+attribute\+\_\+malloc
\begin{DoxyCompactList}\small\item\em Allocate some memory on memory nodes near the given physical cpuset {\ttfamily cpuset}. \end{DoxyCompactList}\item 
\hypertarget{group__hwlocality__membinding_ga986d9b4cc76da592c4b937c6cb7d9d56}{H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__membinding_ga986d9b4cc76da592c4b937c6cb7d9d56}{hwloc\+\_\+free} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, void $\ast$addr, size\+\_\+t len)}\label{group__hwlocality__membinding_ga986d9b4cc76da592c4b937c6cb7d9d56}

\begin{DoxyCompactList}\small\item\em Free memory that was previously allocated by \hyperlink{group__hwlocality__membinding_gac5586e58cf25c3596b7d4aa31ce13259}{hwloc\+\_\+alloc()} or \hyperlink{group__hwlocality__membinding_ga221a7edc5d436300374fa16463f607e5}{hwloc\+\_\+alloc\+\_\+membind()}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\begin{DoxyNote}{Note}
Not all operating systems support all ways to bind existing allocated memory (e.\+g., migration), future memory allocation, explicit memory allocation, etc. Using a binding flag or policy that is not supported by the underlying O\+S will cause hwloc's binding functions to fail and return -\/1. errno will be set to E\+N\+O\+S\+Y\+S when the system does support the specified action or policy (e.\+g., some systems only allow binding memory on a per-\/thread basis, whereas other systems only allow binding memory for all threads in a process). errno will be set to E\+X\+D\+E\+V when the requested cpuset can not be enforced (e.\+g., some systems only allow binding memory to a single N\+U\+M\+A node).
\end{DoxyNote}
The most portable form that should be preferred over the others whenever possible is as follows\+:


\begin{DoxyCode}
\hyperlink{group__hwlocality__helper__binding_ga6178c6a9ec1dd88ec9f6a9fcdcc7d634}{hwloc\_alloc\_membind\_policy}(topology, size, set, 
                           \hyperlink{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8a18675bb80ebc1bce5b652e9de8f3998c}{HWLOC\_MEMBIND\_DEFAULT}, 0);
\end{DoxyCode}


This will allocate some memory hopefully bound to the specified set. To do so, hwloc will possibly have to change the current memory binding policy in order to actually get the memory bound, if the O\+S does not provide any other way to simply allocate bound memory without changing the policy for all allocations. That is the difference with \hyperlink{group__hwlocality__membinding_ga221a7edc5d436300374fa16463f607e5}{hwloc\+\_\+alloc\+\_\+membind()}, which will never change the current memory binding policy. Note that since H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T was not specified, failures to bind will not be reported -- generally, only memory allocation failures will be reported (e.\+g., even a plain malloc() would have failed with E\+N\+O\+M\+E\+M).

Each hwloc memory binding function is available in two forms\+: one that takes a C\+P\+U set argument and another that takes a N\+U\+M\+A memory node set argument (see \hyperlink{group__hwlocality__sets}{Object sets (hwloc\+\_\+cpuset\+\_\+t and hwloc\+\_\+nodeset\+\_\+t)} and \hyperlink{group__hwlocality__bitmap}{The bitmap A\+P\+I} for a discussion of C\+P\+U sets and N\+U\+M\+A memory node sets). The names of the latter form end with \+\_\+nodeset. It is also possible to convert between C\+P\+U set and node set using \hyperlink{group__hwlocality__helper__nodeset__convert_ga60ecc4ae480c28b5fbd34aca4fc37daa}{hwloc\+\_\+cpuset\+\_\+to\+\_\+nodeset()} or \hyperlink{group__hwlocality__helper__nodeset__convert_gaa677fd588304b5615de4ea78104adfb5}{hwloc\+\_\+cpuset\+\_\+from\+\_\+nodeset()}.

\begin{DoxyNote}{Note}
On some operating systems, memory binding affects the C\+P\+U binding; see \hyperlink{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2aad6b9eaf2ee324ca58dc8f58094b9997}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+O\+C\+P\+U\+B\+I\+N\+D} 
\end{DoxyNote}


\subsection{Enumeration Type Documentation}
\hypertarget{group__hwlocality__membinding_gab00475fd98815bf4fb9aaf752030e7d2}{\index{Memory binding@{Memory binding}!hwloc\+\_\+membind\+\_\+flags\+\_\+t@{hwloc\+\_\+membind\+\_\+flags\+\_\+t}}
\index{hwloc\+\_\+membind\+\_\+flags\+\_\+t@{hwloc\+\_\+membind\+\_\+flags\+\_\+t}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+membind\+\_\+flags\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf hwloc\+\_\+membind\+\_\+flags\+\_\+t}}}\label{group__hwlocality__membinding_gab00475fd98815bf4fb9aaf752030e7d2}


Memory binding flags. 

These flags can be used to refine the binding policy. All flags can be logically O\+R'ed together with the exception of H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S and H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D; these two flags are mutually exclusive.

\begin{DoxyNote}{Note}
Not all systems support all kinds of binding. See the \char`\"{}\+Detailed Description\char`\"{} section of \hyperlink{group__hwlocality__membinding}{Memory binding} for a description of errors that can occur. 
\end{DoxyNote}
\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2a1b1b74aef138f64aff214a8cbdfe8eb4}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S}\label{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2a1b1b74aef138f64aff214a8cbdfe8eb4}
}]Set policy for all threads of the specified (possibly multithreaded) process. This flag is mutually exclusive with H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D. \index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2a1dc7dd5cdcd5796893a325a524555298}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D}\label{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2a1dc7dd5cdcd5796893a325a524555298}
}]Set policy for a specific thread of the current process. This flag is mutually exclusive with H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S. \index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2a0335311a0ee04166df2888d52b4a42c6}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T}\label{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2a0335311a0ee04166df2888d52b4a42c6}
}]\hyperlink{classRequest}{Request} strict binding from the O\+S. The function will fail if the binding can not be guaranteed / completely enforced.

This flag has slightly different meanings depending on which function it is used with. \index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+G\+R\+A\+T\+E@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+G\+R\+A\+T\+E}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+G\+R\+A\+T\+E@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+G\+R\+A\+T\+E}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2aa6e49e54f52827cb143cc869cfd748af}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+G\+R\+A\+T\+E}\label{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2aa6e49e54f52827cb143cc869cfd748af}
}]Migrate existing allocated memory. If the memory cannot be migrated and the H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T flag is passed, an error will be returned. \index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+O\+C\+P\+U\+B\+I\+N\+D@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+O\+C\+P\+U\+B\+I\+N\+D}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+O\+C\+P\+U\+B\+I\+N\+D@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+O\+C\+P\+U\+B\+I\+N\+D}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2aad6b9eaf2ee324ca58dc8f58094b9997}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+O\+C\+P\+U\+B\+I\+N\+D}\label{group__hwlocality__membinding_ggab00475fd98815bf4fb9aaf752030e7d2aad6b9eaf2ee324ca58dc8f58094b9997}
}]Avoid any effect on C\+P\+U binding. On some operating systems, some underlying memory binding functions also bind the application to the corresponding C\+P\+U(s). Using this flag will cause hwloc to avoid using O\+S functions that could potentially affect C\+P\+U bindings. Note, however, that using N\+O\+C\+P\+U\+B\+I\+N\+D may reduce hwloc's overall memory binding support. Specifically\+: some of hwloc's memory binding functions may fail with errno set to E\+N\+O\+S\+Y\+S when used with N\+O\+C\+P\+U\+B\+I\+N\+D. \end{description}
\end{Desc}
\hypertarget{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}{\index{Memory binding@{Memory binding}!hwloc\+\_\+membind\+\_\+policy\+\_\+t@{hwloc\+\_\+membind\+\_\+policy\+\_\+t}}
\index{hwloc\+\_\+membind\+\_\+policy\+\_\+t@{hwloc\+\_\+membind\+\_\+policy\+\_\+t}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+membind\+\_\+policy\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t}}}\label{group__hwlocality__membinding_gac9764f79505775d06407b40f5e4661e8}


Memory binding policy. 

These constants can be used to choose the binding policy. Only one policy can be used at a time (i.\+e., the values cannot be O\+R'ed together).

\begin{DoxyNote}{Note}
Not all systems support all kinds of binding. See the \char`\"{}\+Detailed Description\char`\"{} section of \hyperlink{group__hwlocality__membinding}{Memory binding} for a description of errors that can occur. 
\end{DoxyNote}
\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+D\+E\+F\+A\+U\+L\+T@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+D\+E\+F\+A\+U\+L\+T}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+D\+E\+F\+A\+U\+L\+T@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+D\+E\+F\+A\+U\+L\+T}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8a18675bb80ebc1bce5b652e9de8f3998c}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+D\+E\+F\+A\+U\+L\+T}\label{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8a18675bb80ebc1bce5b652e9de8f3998c}
}]Reset the memory allocation policy to the system default. \index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+F\+I\+R\+S\+T\+T\+O\+U\+C\+H@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+F\+I\+R\+S\+T\+T\+O\+U\+C\+H}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+F\+I\+R\+S\+T\+T\+O\+U\+C\+H@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+F\+I\+R\+S\+T\+T\+O\+U\+C\+H}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8a979c7aa78dd32780858f30f47a72cca0}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+F\+I\+R\+S\+T\+T\+O\+U\+C\+H}\label{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8a979c7aa78dd32780858f30f47a72cca0}
}]Allocate memory but do not immediately bind it to a specific locality. Instead, each page in the allocation is bound only when it is first touched. Pages are individually bound to the local N\+U\+M\+A node of the first thread that touches it. \index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+B\+I\+N\+D@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+B\+I\+N\+D}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+B\+I\+N\+D@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+B\+I\+N\+D}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8ad811fa4b2a6002c4d63695a408ffde2c}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+B\+I\+N\+D}\label{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8ad811fa4b2a6002c4d63695a408ffde2c}
}]Allocate memory on the specified nodes. \index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+I\+N\+T\+E\+R\+L\+E\+A\+V\+E@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+I\+N\+T\+E\+R\+L\+E\+A\+V\+E}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+I\+N\+T\+E\+R\+L\+E\+A\+V\+E@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+I\+N\+T\+E\+R\+L\+E\+A\+V\+E}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8ae370075e5af016d42310f87ea5af236b}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+I\+N\+T\+E\+R\+L\+E\+A\+V\+E}\label{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8ae370075e5af016d42310f87ea5af236b}
}]Allocate memory on the given nodes in an interleaved / round-\/robin manner. The precise layout of the memory across multiple N\+U\+M\+A nodes is O\+S/system specific. Interleaving can be useful when threads distributed across the specified N\+U\+M\+A nodes will all be accessing the whole memory range concurrently, since the interleave will then balance the memory references. \index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+R\+E\+P\+L\+I\+C\+A\+T\+E@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+R\+E\+P\+L\+I\+C\+A\+T\+E}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+R\+E\+P\+L\+I\+C\+A\+T\+E@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+R\+E\+P\+L\+I\+C\+A\+T\+E}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8afb37480fe5f4236eb7dd4aef26f691e9}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+R\+E\+P\+L\+I\+C\+A\+T\+E}\label{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8afb37480fe5f4236eb7dd4aef26f691e9}
}]Replicate memory on the given nodes; reads from this memory will attempt to be serviced from the N\+U\+M\+A node local to the reading thread. Replicating can be useful when multiple threads from the specified N\+U\+M\+A nodes will be sharing the same read-\/only data.

This policy can only be used with existing memory allocations (i.\+e., the hwloc\+\_\+set\+\_\+$\ast$membind$\ast$() functions); it cannot be used with functions that allocate new memory (i.\+e., the hwloc\+\_\+alloc$\ast$() functions). \index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+E\+X\+T\+T\+O\+U\+C\+H@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+E\+X\+T\+T\+O\+U\+C\+H}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+E\+X\+T\+T\+O\+U\+C\+H@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+E\+X\+T\+T\+O\+U\+C\+H}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8aecdd4164d647708fbb51a00d98dbb138}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+N\+E\+X\+T\+T\+O\+U\+C\+H}\label{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8aecdd4164d647708fbb51a00d98dbb138}
}]For each page bound with this policy, by next time it is touched (and next time only), it is moved from its current location to the local N\+U\+M\+A node of the thread where the memory reference occurred (if it needs to be moved at all). \index{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D}!Memory binding@{Memory binding}}\index{Memory binding@{Memory binding}!H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D@{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D}}\item[{\em 
\hypertarget{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8a3185bd869b67817fb2bd5164bf360402}{H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D}\label{group__hwlocality__membinding_ggac9764f79505775d06407b40f5e4661e8a3185bd869b67817fb2bd5164bf360402}
}]Returned by hwloc\+\_\+get\+\_\+membind$\ast$() functions when multiple threads or parts of a memory area have differing memory binding policies. \end{description}
\end{Desc}


\subsection{Function Documentation}
\hypertarget{group__hwlocality__membinding_gac5586e58cf25c3596b7d4aa31ce13259}{\index{Memory binding@{Memory binding}!hwloc\+\_\+alloc@{hwloc\+\_\+alloc}}
\index{hwloc\+\_\+alloc@{hwloc\+\_\+alloc}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+alloc}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void$\ast$ hwloc\+\_\+alloc (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{size\+\_\+t}]{len}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_gac5586e58cf25c3596b7d4aa31ce13259}


Allocate some memory. 

This is equivalent to malloc(), except that it tries to allocate page-\/aligned memory from the O\+S.

\begin{DoxyNote}{Note}
The allocated memory should be freed with \hyperlink{group__hwlocality__membinding_ga986d9b4cc76da592c4b937c6cb7d9d56}{hwloc\+\_\+free()}. 
\end{DoxyNote}


Referenced by hwloc\+\_\+alloc\+\_\+membind(), hwloc\+\_\+alloc\+\_\+membind\+\_\+nodeset(), hwloc\+\_\+alloc\+\_\+membind\+\_\+policy(), and hwloc\+\_\+alloc\+\_\+membind\+\_\+policy\+\_\+nodeset().

\hypertarget{group__hwlocality__membinding_ga221a7edc5d436300374fa16463f607e5}{\index{Memory binding@{Memory binding}!hwloc\+\_\+alloc\+\_\+membind@{hwloc\+\_\+alloc\+\_\+membind}}
\index{hwloc\+\_\+alloc\+\_\+membind@{hwloc\+\_\+alloc\+\_\+membind}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+alloc\+\_\+membind}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void$\ast$ hwloc\+\_\+alloc\+\_\+membind (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{size\+\_\+t}]{len, }
\item[{{\bf hwloc\+\_\+const\+\_\+cpuset\+\_\+t}}]{cpuset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t}}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_ga221a7edc5d436300374fa16463f607e5}


Allocate some memory on memory nodes near the given physical cpuset {\ttfamily cpuset}. 

\begin{DoxyReturn}{Returns}
-\/1 with errno set to E\+N\+O\+S\+Y\+S if the action is not supported and H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is given 

-\/1 with errno set to E\+X\+D\+E\+V if the binding cannot be enforced and H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is given
\end{DoxyReturn}
\begin{DoxyNote}{Note}
The allocated memory should be freed with \hyperlink{group__hwlocality__membinding_ga986d9b4cc76da592c4b937c6cb7d9d56}{hwloc\+\_\+free()}. 
\end{DoxyNote}


References hwloc\+\_\+alloc(), hwloc\+\_\+alloc\+\_\+membind\+\_\+nodeset(), hwloc\+\_\+bitmap\+\_\+alloc(), hwloc\+\_\+bitmap\+\_\+free(), and H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T.



Referenced by hwloc\+\_\+alloc\+\_\+membind\+\_\+policy().

\hypertarget{group__hwlocality__membinding_gaeaa00714a9c4319bda0a74ca6f8720e8}{\index{Memory binding@{Memory binding}!hwloc\+\_\+alloc\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+alloc\+\_\+membind\+\_\+nodeset}}
\index{hwloc\+\_\+alloc\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+alloc\+\_\+membind\+\_\+nodeset}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+alloc\+\_\+membind\+\_\+nodeset}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void$\ast$ hwloc\+\_\+alloc\+\_\+membind\+\_\+nodeset (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{size\+\_\+t}]{len, }
\item[{{\bf hwloc\+\_\+const\+\_\+nodeset\+\_\+t}}]{nodeset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t}}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_gaeaa00714a9c4319bda0a74ca6f8720e8}


Allocate some memory on the given physical nodeset {\ttfamily nodeset}. 

\begin{DoxyReturn}{Returns}
-\/1 with errno set to E\+N\+O\+S\+Y\+S if the action is not supported and H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is given 

-\/1 with errno set to E\+X\+D\+E\+V if the binding cannot be enforced and H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is given
\end{DoxyReturn}
\begin{DoxyNote}{Note}
The allocated memory should be freed with \hyperlink{group__hwlocality__membinding_ga986d9b4cc76da592c4b937c6cb7d9d56}{hwloc\+\_\+free()}. 
\end{DoxyNote}


References hwloc\+\_\+alloc(), H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+G\+R\+A\+T\+E, and H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T.



Referenced by hwloc\+\_\+alloc\+\_\+membind(), and hwloc\+\_\+alloc\+\_\+membind\+\_\+policy\+\_\+nodeset().

\hypertarget{group__hwlocality__membinding_gac02ee8f7606382ea7855ae4e1656ed0f}{\index{Memory binding@{Memory binding}!hwloc\+\_\+get\+\_\+area\+\_\+membind@{hwloc\+\_\+get\+\_\+area\+\_\+membind}}
\index{hwloc\+\_\+get\+\_\+area\+\_\+membind@{hwloc\+\_\+get\+\_\+area\+\_\+membind}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+get\+\_\+area\+\_\+membind}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+get\+\_\+area\+\_\+membind (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{const void $\ast$}]{addr, }
\item[{size\+\_\+t}]{len, }
\item[{{\bf hwloc\+\_\+cpuset\+\_\+t}}]{cpuset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_gac02ee8f7606382ea7855ae4e1656ed0f}


Query the C\+P\+Us near the physical N\+U\+M\+A node(s) and binding policy of the memory identified by ({\ttfamily addr}, {\ttfamily len} ). 

This function has two output parameters\+: {\ttfamily cpuset} and {\ttfamily policy}. The values returned in these parameters depend on both the {\ttfamily flags} passed in and the memory binding policies and nodesets of the pages in the address range.

If H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is specified, the target pages are first checked to see if they all have the same memory binding policy and nodeset. If they do not, -\/1 is returned and errno is set to E\+X\+D\+E\+V. If they are identical across all pages, the policy is returned in {\ttfamily policy}. {\ttfamily cpuset} is set to the union of C\+P\+Us near the N\+U\+M\+A node(s) in the nodeset.

If H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is not specified, the union of all N\+U\+M\+A node(s) containing pages in the address range is calculated. {\ttfamily cpuset} is then set to the C\+P\+Us near the N\+U\+M\+A node(s) in this union. If all pages in the target have the same policy, it is returned in {\ttfamily policy}. Otherwise, {\ttfamily policy} is set to H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D.

If any other flags are specified, -\/1 is returned and errno is set to E\+I\+N\+V\+A\+L. 

References hwloc\+\_\+bitmap\+\_\+alloc(), hwloc\+\_\+bitmap\+\_\+free(), hwloc\+\_\+cpuset\+\_\+from\+\_\+nodeset(), hwloc\+\_\+get\+\_\+area\+\_\+membind\+\_\+nodeset(), and hwloc\+\_\+obj\+::nodeset.

\hypertarget{group__hwlocality__membinding_ga106e6fcd764d17be682faf7a5bc95720}{\index{Memory binding@{Memory binding}!hwloc\+\_\+get\+\_\+area\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+get\+\_\+area\+\_\+membind\+\_\+nodeset}}
\index{hwloc\+\_\+get\+\_\+area\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+get\+\_\+area\+\_\+membind\+\_\+nodeset}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+get\+\_\+area\+\_\+membind\+\_\+nodeset}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+get\+\_\+area\+\_\+membind\+\_\+nodeset (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{const void $\ast$}]{addr, }
\item[{size\+\_\+t}]{len, }
\item[{{\bf hwloc\+\_\+nodeset\+\_\+t}}]{nodeset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_ga106e6fcd764d17be682faf7a5bc95720}


Query the physical N\+U\+M\+A node(s) and binding policy of the memory identified by ({\ttfamily addr}, {\ttfamily len} ). 

This function has two output parameters\+: {\ttfamily nodeset} and {\ttfamily policy}. The values returned in these parameters depend on both the {\ttfamily flags} passed in and the memory binding policies and nodesets of the pages in the address range.

If H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is specified, the target pages are first checked to see if they all have the same memory binding policy and nodeset. If they do not, -\/1 is returned and errno is set to E\+X\+D\+E\+V. If they are identical across all pages, the nodeset and policy are returned in {\ttfamily nodeset} and {\ttfamily policy}, respectively.

If H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is not specified, {\ttfamily nodeset} is set to the union of all N\+U\+M\+A node(s) containing pages in the address range. If all pages in the target have the same policy, it is returned in {\ttfamily policy}. Otherwise, {\ttfamily policy} is set to H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D.

If any other flags are specified, -\/1 is returned and errno is set to E\+I\+N\+V\+A\+L. 

Referenced by hwloc\+\_\+get\+\_\+area\+\_\+membind().

\hypertarget{group__hwlocality__membinding_gab07aedba1119f99130e5f0b796b7d8a5}{\index{Memory binding@{Memory binding}!hwloc\+\_\+get\+\_\+membind@{hwloc\+\_\+get\+\_\+membind}}
\index{hwloc\+\_\+get\+\_\+membind@{hwloc\+\_\+get\+\_\+membind}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+get\+\_\+membind}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+get\+\_\+membind (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{{\bf hwloc\+\_\+cpuset\+\_\+t}}]{cpuset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_gab07aedba1119f99130e5f0b796b7d8a5}


Query the default memory binding policy and physical locality of the current process or thread (the locality is returned in {\ttfamily cpuset} as C\+P\+Us near the locality's actual N\+U\+M\+A node(s)). 

This function has two output parameters\+: {\ttfamily cpuset} and {\ttfamily policy}. The values returned in these parameters depend on both the {\ttfamily flags} passed in and the current memory binding policies and nodesets in the queried target.

Passing the H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S flag specifies that the query target is the current policies and nodesets for all the threads in the current process. Passing H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D specifies that the query target is the current policy and nodeset for only the thread invoking this function.

If neither of these flags are passed (which is the most portable method), the process is assumed to be single threaded. This allows hwloc to use either process-\/based O\+S functions or thread-\/based O\+S functions, depending on which are available.

H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is only meaningful when H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S is also specified. In this case, hwloc will check the default memory policies and nodesets for all threads in the process. If they are not identical, -\/1 is returned and errno is set to E\+X\+D\+E\+V. If they are identical, the policy is returned in {\ttfamily policy}. {\ttfamily cpuset} is set to the union of C\+P\+Us near the N\+U\+M\+A node(s) in the nodeset.

Otherwise, if H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S is specified (and H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is {\itshape not} specified), the default nodeset from each thread is logically O\+R'ed together. {\ttfamily cpuset} is set to the union of C\+P\+Us near the N\+U\+M\+A node(s) in the resulting nodeset. If all threads' default policies are the same, {\ttfamily policy} is set to that policy. If they are different, {\ttfamily policy} is set to H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D.

In the H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D case (or when neither H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S or H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D is specified), there is only one nodeset and policy. The policy is returned in {\ttfamily policy}; {\ttfamily cpuset} is set to the union of C\+P\+Us near the N\+U\+M\+A node(s) in the {\ttfamily nodeset}.

If any other flags are specified, -\/1 is returned and errno is set to E\+I\+N\+V\+A\+L. 

References hwloc\+\_\+bitmap\+\_\+alloc(), hwloc\+\_\+bitmap\+\_\+free(), hwloc\+\_\+cpuset\+\_\+from\+\_\+nodeset(), hwloc\+\_\+get\+\_\+membind\+\_\+nodeset(), and hwloc\+\_\+obj\+::nodeset.

\hypertarget{group__hwlocality__membinding_ga7b46a4ca0b2db9723ca73b0c148ccd93}{\index{Memory binding@{Memory binding}!hwloc\+\_\+get\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+get\+\_\+membind\+\_\+nodeset}}
\index{hwloc\+\_\+get\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+get\+\_\+membind\+\_\+nodeset}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+get\+\_\+membind\+\_\+nodeset}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+get\+\_\+membind\+\_\+nodeset (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{{\bf hwloc\+\_\+nodeset\+\_\+t}}]{nodeset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_ga7b46a4ca0b2db9723ca73b0c148ccd93}


Query the default memory binding policy and physical locality of the current process or thread. 

This function has two output parameters\+: {\ttfamily nodeset} and {\ttfamily policy}. The values returned in these parameters depend on both the {\ttfamily flags} passed in and the current memory binding policies and nodesets in the queried target.

Passing the H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S flag specifies that the query target is the current policies and nodesets for all the threads in the current process. Passing H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D specifies that the query target is the current policy and nodeset for only the thread invoking this function.

If neither of these flags are passed (which is the most portable method), the process is assumed to be single threaded. This allows hwloc to use either process-\/based O\+S functions or thread-\/based O\+S functions, depending on which are available.

H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is only meaningful when H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S is also specified. In this case, hwloc will check the default memory policies and nodesets for all threads in the process. If they are not identical, -\/1 is returned and errno is set to E\+X\+D\+E\+V. If they are identical, the values are returned in {\ttfamily nodeset} and {\ttfamily policy}.

Otherwise, if H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S is specified (and H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is {\itshape not} specified), {\ttfamily nodeset} is set to the logical O\+R of all threads' default nodeset. If all threads' default policies are the same, {\ttfamily policy} is set to that policy. If they are different, {\ttfamily policy} is set to H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D.

In the H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D case (or when neither H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S or H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D is specified), there is only one nodeset and policy; they are returned in {\ttfamily nodeset} and {\ttfamily policy}, respectively.

If any other flags are specified, -\/1 is returned and errno is set to E\+I\+N\+V\+A\+L. 

References H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S, and H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D.



Referenced by hwloc\+\_\+get\+\_\+membind().

\hypertarget{group__hwlocality__membinding_gabaf9c13f1fa301d6895594cec52226e2}{\index{Memory binding@{Memory binding}!hwloc\+\_\+get\+\_\+proc\+\_\+membind@{hwloc\+\_\+get\+\_\+proc\+\_\+membind}}
\index{hwloc\+\_\+get\+\_\+proc\+\_\+membind@{hwloc\+\_\+get\+\_\+proc\+\_\+membind}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+get\+\_\+proc\+\_\+membind}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+get\+\_\+proc\+\_\+membind (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{hwloc\+\_\+pid\+\_\+t}]{pid, }
\item[{{\bf hwloc\+\_\+cpuset\+\_\+t}}]{cpuset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_gabaf9c13f1fa301d6895594cec52226e2}


Query the default memory binding policy and physical locality of the specified process (the locality is returned in {\ttfamily cpuset} as C\+P\+Us near the locality's actual N\+U\+M\+A node(s)). 

This function has two output parameters\+: {\ttfamily cpuset} and {\ttfamily policy}. The values returned in these parameters depend on both the {\ttfamily flags} passed in and the current memory binding policies and nodesets in the queried target.

Passing the H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S flag specifies that the query target is the current policies and nodesets for all the threads in the specified process. If H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S is not specified (which is the most portable method), the process is assumed to be single threaded. This allows hwloc to use either process-\/based O\+S functions or thread-\/based O\+S functions, depending on which are available.

Note that it does not make sense to pass H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D to this function.

If H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is specified, hwloc will check the default memory policies and nodesets for all threads in the specified process. If they are not identical, -\/1 is returned and errno is set to E\+X\+D\+E\+V. If they are identical, the policy is returned in {\ttfamily policy}. {\ttfamily cpuset} is set to the union of C\+P\+Us near the N\+U\+M\+A node(s) in the nodeset.

Otherwise, the default nodeset from each thread is logically O\+R'ed together. {\ttfamily cpuset} is set to the union of C\+P\+Us near the N\+U\+M\+A node(s) in the resulting nodeset. If all threads' default policies are the same, {\ttfamily policy} is set to that policy. If they are different, {\ttfamily policy} is set to H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D.

If any other flags are specified, -\/1 is returned and errno is set to E\+I\+N\+V\+A\+L.

\begin{DoxyNote}{Note}
{\ttfamily hwloc\+\_\+pid\+\_\+t} is {\ttfamily pid\+\_\+t} on Unix platforms, and {\ttfamily H\+A\+N\+D\+L\+E} on native Windows platforms. 
\end{DoxyNote}


References hwloc\+\_\+bitmap\+\_\+alloc(), hwloc\+\_\+bitmap\+\_\+free(), hwloc\+\_\+cpuset\+\_\+from\+\_\+nodeset(), hwloc\+\_\+get\+\_\+proc\+\_\+membind\+\_\+nodeset(), and hwloc\+\_\+obj\+::nodeset.

\hypertarget{group__hwlocality__membinding_ga22074ed072e1039f74f17f7b16e9e39d}{\index{Memory binding@{Memory binding}!hwloc\+\_\+get\+\_\+proc\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+get\+\_\+proc\+\_\+membind\+\_\+nodeset}}
\index{hwloc\+\_\+get\+\_\+proc\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+get\+\_\+proc\+\_\+membind\+\_\+nodeset}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+get\+\_\+proc\+\_\+membind\+\_\+nodeset}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+get\+\_\+proc\+\_\+membind\+\_\+nodeset (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{hwloc\+\_\+pid\+\_\+t}]{pid, }
\item[{{\bf hwloc\+\_\+nodeset\+\_\+t}}]{nodeset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t} $\ast$}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_ga22074ed072e1039f74f17f7b16e9e39d}


Query the default memory binding policy and physical locality of the specified process. 

This function has two output parameters\+: {\ttfamily nodeset} and {\ttfamily policy}. The values returned in these parameters depend on both the {\ttfamily flags} passed in and the current memory binding policies and nodesets in the queried target.

Passing the H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S flag specifies that the query target is the current policies and nodesets for all the threads in the specified process. If H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S is not specified (which is the most portable method), the process is assumed to be single threaded. This allows hwloc to use either process-\/based O\+S functions or thread-\/based O\+S functions, depending on which are available.

Note that it does not make sense to pass H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D to this function.

If H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+S\+T\+R\+I\+C\+T is specified, hwloc will check the default memory policies and nodesets for all threads in the specified process. If they are not identical, -\/1 is returned and errno is set to E\+X\+D\+E\+V. If they are identical, the values are returned in {\ttfamily nodeset} and {\ttfamily policy}.

Otherwise, {\ttfamily nodeset} is set to the logical O\+R of all threads' default nodeset. If all threads' default policies are the same, {\ttfamily policy} is set to that policy. If they are different, {\ttfamily policy} is set to H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+M\+I\+X\+E\+D.

If any other flags are specified, -\/1 is returned and errno is set to E\+I\+N\+V\+A\+L.

\begin{DoxyNote}{Note}
{\ttfamily hwloc\+\_\+pid\+\_\+t} is {\ttfamily pid\+\_\+t} on Unix platforms, and {\ttfamily H\+A\+N\+D\+L\+E} on native Windows platforms. 
\end{DoxyNote}


Referenced by hwloc\+\_\+get\+\_\+proc\+\_\+membind().

\hypertarget{group__hwlocality__membinding_ga06594edeb4728cb9e014aed924d1e74a}{\index{Memory binding@{Memory binding}!hwloc\+\_\+set\+\_\+area\+\_\+membind@{hwloc\+\_\+set\+\_\+area\+\_\+membind}}
\index{hwloc\+\_\+set\+\_\+area\+\_\+membind@{hwloc\+\_\+set\+\_\+area\+\_\+membind}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+set\+\_\+area\+\_\+membind}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+set\+\_\+area\+\_\+membind (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{const void $\ast$}]{addr, }
\item[{size\+\_\+t}]{len, }
\item[{{\bf hwloc\+\_\+const\+\_\+cpuset\+\_\+t}}]{cpuset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t}}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_ga06594edeb4728cb9e014aed924d1e74a}


Bind the already-\/allocated memory identified by (addr, len) to the N\+U\+M\+A node(s) near physical {\ttfamily cpuset}. 

\begin{DoxyReturn}{Returns}
-\/1 with errno set to E\+N\+O\+S\+Y\+S if the action is not supported 

-\/1 with errno set to E\+X\+D\+E\+V if the binding cannot be enforced 
\end{DoxyReturn}


References hwloc\+\_\+bitmap\+\_\+alloc(), hwloc\+\_\+bitmap\+\_\+free(), and hwloc\+\_\+set\+\_\+area\+\_\+membind\+\_\+nodeset().

\hypertarget{group__hwlocality__membinding_gade5e2c28ea8475a479bf2b1df36c6ccd}{\index{Memory binding@{Memory binding}!hwloc\+\_\+set\+\_\+area\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+set\+\_\+area\+\_\+membind\+\_\+nodeset}}
\index{hwloc\+\_\+set\+\_\+area\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+set\+\_\+area\+\_\+membind\+\_\+nodeset}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+set\+\_\+area\+\_\+membind\+\_\+nodeset}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+set\+\_\+area\+\_\+membind\+\_\+nodeset (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{const void $\ast$}]{addr, }
\item[{size\+\_\+t}]{len, }
\item[{{\bf hwloc\+\_\+const\+\_\+nodeset\+\_\+t}}]{nodeset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t}}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_gade5e2c28ea8475a479bf2b1df36c6ccd}


Bind the already-\/allocated memory identified by (addr, len) to the N\+U\+M\+A node(s) in physical {\ttfamily nodeset}. 

\begin{DoxyReturn}{Returns}
-\/1 with errno set to E\+N\+O\+S\+Y\+S if the action is not supported 

-\/1 with errno set to E\+X\+D\+E\+V if the binding cannot be enforced 
\end{DoxyReturn}


Referenced by hwloc\+\_\+set\+\_\+area\+\_\+membind().

\hypertarget{group__hwlocality__membinding_ga8b6d1d90227aff8e44ef26bc1f8a8f95}{\index{Memory binding@{Memory binding}!hwloc\+\_\+set\+\_\+membind@{hwloc\+\_\+set\+\_\+membind}}
\index{hwloc\+\_\+set\+\_\+membind@{hwloc\+\_\+set\+\_\+membind}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+set\+\_\+membind}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+set\+\_\+membind (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{{\bf hwloc\+\_\+const\+\_\+cpuset\+\_\+t}}]{cpuset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t}}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_ga8b6d1d90227aff8e44ef26bc1f8a8f95}


Set the default memory binding policy of the current process or thread to prefer the N\+U\+M\+A node(s) near the specified physical {\ttfamily cpuset}. 

If neither H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S nor H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D is specified, the current process is assumed to be single-\/threaded. This is the most portable form as it permits hwloc to use either process-\/based O\+S functions or thread-\/based O\+S functions, depending on which are available.

\begin{DoxyReturn}{Returns}
-\/1 with errno set to E\+N\+O\+S\+Y\+S if the action is not supported 

-\/1 with errno set to E\+X\+D\+E\+V if the binding cannot be enforced 
\end{DoxyReturn}


References hwloc\+\_\+bitmap\+\_\+alloc(), hwloc\+\_\+bitmap\+\_\+free(), and hwloc\+\_\+set\+\_\+membind\+\_\+nodeset().



Referenced by hwloc\+\_\+alloc\+\_\+membind\+\_\+policy().

\hypertarget{group__hwlocality__membinding_ga747962cbb16fd12ad6d126011c734a27}{\index{Memory binding@{Memory binding}!hwloc\+\_\+set\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+set\+\_\+membind\+\_\+nodeset}}
\index{hwloc\+\_\+set\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+set\+\_\+membind\+\_\+nodeset}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+set\+\_\+membind\+\_\+nodeset}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+set\+\_\+membind\+\_\+nodeset (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{{\bf hwloc\+\_\+const\+\_\+nodeset\+\_\+t}}]{nodeset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t}}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_ga747962cbb16fd12ad6d126011c734a27}


Set the default memory binding policy of the current process or thread to prefer the N\+U\+M\+A node(s) specified by physical {\ttfamily nodeset}. 

If neither H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S nor H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D is specified, the current process is assumed to be single-\/threaded. This is the most portable form as it permits hwloc to use either process-\/based O\+S functions or thread-\/based O\+S functions, depending on which are available.

\begin{DoxyReturn}{Returns}
-\/1 with errno set to E\+N\+O\+S\+Y\+S if the action is not supported 

-\/1 with errno set to E\+X\+D\+E\+V if the binding cannot be enforced 
\end{DoxyReturn}


References H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+P\+R\+O\+C\+E\+S\+S, and H\+W\+L\+O\+C\+\_\+\+M\+E\+M\+B\+I\+N\+D\+\_\+\+T\+H\+R\+E\+A\+D.



Referenced by hwloc\+\_\+alloc\+\_\+membind\+\_\+policy\+\_\+nodeset(), and hwloc\+\_\+set\+\_\+membind().

\hypertarget{group__hwlocality__membinding_gac63c4517e71b3f0d41b3dee3e83dc55c}{\index{Memory binding@{Memory binding}!hwloc\+\_\+set\+\_\+proc\+\_\+membind@{hwloc\+\_\+set\+\_\+proc\+\_\+membind}}
\index{hwloc\+\_\+set\+\_\+proc\+\_\+membind@{hwloc\+\_\+set\+\_\+proc\+\_\+membind}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+set\+\_\+proc\+\_\+membind}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+set\+\_\+proc\+\_\+membind (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{hwloc\+\_\+pid\+\_\+t}]{pid, }
\item[{{\bf hwloc\+\_\+const\+\_\+cpuset\+\_\+t}}]{cpuset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t}}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_gac63c4517e71b3f0d41b3dee3e83dc55c}


Set the default memory binding policy of the specified process to prefer the N\+U\+M\+A node(s) near the specified physical {\ttfamily cpuset}. 

\begin{DoxyReturn}{Returns}
-\/1 with errno set to E\+N\+O\+S\+Y\+S if the action is not supported 

-\/1 with errno set to E\+X\+D\+E\+V if the binding cannot be enforced
\end{DoxyReturn}
\begin{DoxyNote}{Note}
{\ttfamily hwloc\+\_\+pid\+\_\+t} is {\ttfamily pid\+\_\+t} on Unix platforms, and {\ttfamily H\+A\+N\+D\+L\+E} on native Windows platforms. 
\end{DoxyNote}


References hwloc\+\_\+bitmap\+\_\+alloc(), hwloc\+\_\+bitmap\+\_\+free(), and hwloc\+\_\+set\+\_\+proc\+\_\+membind\+\_\+nodeset().

\hypertarget{group__hwlocality__membinding_gaf10d18cd4703ec980d7440a1c23fa07f}{\index{Memory binding@{Memory binding}!hwloc\+\_\+set\+\_\+proc\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+set\+\_\+proc\+\_\+membind\+\_\+nodeset}}
\index{hwloc\+\_\+set\+\_\+proc\+\_\+membind\+\_\+nodeset@{hwloc\+\_\+set\+\_\+proc\+\_\+membind\+\_\+nodeset}!Memory binding@{Memory binding}}
\subsubsection[{hwloc\+\_\+set\+\_\+proc\+\_\+membind\+\_\+nodeset}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+set\+\_\+proc\+\_\+membind\+\_\+nodeset (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{hwloc\+\_\+pid\+\_\+t}]{pid, }
\item[{{\bf hwloc\+\_\+const\+\_\+nodeset\+\_\+t}}]{nodeset, }
\item[{{\bf hwloc\+\_\+membind\+\_\+policy\+\_\+t}}]{policy, }
\item[{int}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__membinding_gaf10d18cd4703ec980d7440a1c23fa07f}


Set the default memory binding policy of the specified process to prefer the N\+U\+M\+A node(s) specified by physical {\ttfamily nodeset}. 

\begin{DoxyReturn}{Returns}
-\/1 with errno set to E\+N\+O\+S\+Y\+S if the action is not supported 

-\/1 with errno set to E\+X\+D\+E\+V if the binding cannot be enforced
\end{DoxyReturn}
\begin{DoxyNote}{Note}
{\ttfamily hwloc\+\_\+pid\+\_\+t} is {\ttfamily pid\+\_\+t} on Unix platforms, and {\ttfamily H\+A\+N\+D\+L\+E} on native Windows platforms. 
\end{DoxyNote}


Referenced by hwloc\+\_\+set\+\_\+proc\+\_\+membind().

