\hypertarget{group__hwlocality__helper__binding}{\section{Binding Helpers}
\label{group__hwlocality__helper__binding}\index{Binding Helpers@{Binding Helpers}}
}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static \+\_\+\+\_\+hwloc\+\_\+inline void \hyperlink{group__hwlocality__helper__binding_gaf057d7c5e3cb3df897ce527258537619}{hwloc\+\_\+distributev} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__objects_ga79b8ab56877ef99ac59b833203391c7d}{hwloc\+\_\+obj\+\_\+t} $\ast$root, unsigned n\+\_\+roots, \hyperlink{group__hwlocality__sets_ga4bbf39b68b6f568fb92739e7c0ea7801}{hwloc\+\_\+cpuset\+\_\+t} $\ast$cpuset, unsigned n, unsigned until)
\begin{DoxyCompactList}\small\item\em Distribute {\ttfamily n} items over the topology under {\ttfamily root}. \end{DoxyCompactList}\item 
\hypertarget{group__hwlocality__helper__binding_ga6d5c88292ad5aa062c1bebc99369c042}{static \+\_\+\+\_\+hwloc\+\_\+inline void {\bfseries hwloc\+\_\+distribute} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__objects_ga79b8ab56877ef99ac59b833203391c7d}{hwloc\+\_\+obj\+\_\+t} root, \hyperlink{group__hwlocality__sets_ga4bbf39b68b6f568fb92739e7c0ea7801}{hwloc\+\_\+cpuset\+\_\+t} $\ast$cpuset, unsigned n, unsigned until)}\label{group__hwlocality__helper__binding_ga6d5c88292ad5aa062c1bebc99369c042}

\item 
static \+\_\+\+\_\+hwloc\+\_\+inline void $\ast$ \hyperlink{group__hwlocality__helper__binding_ga3e772fbc4de626ed80f13d332b7d4d03}{hwloc\+\_\+alloc\+\_\+membind\+\_\+policy\+\_\+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)
\begin{DoxyCompactList}\small\item\em Allocate some memory on the given nodeset {\ttfamily nodeset}. \end{DoxyCompactList}\item 
static \+\_\+\+\_\+hwloc\+\_\+inline void $\ast$ \hyperlink{group__hwlocality__helper__binding_ga6178c6a9ec1dd88ec9f6a9fcdcc7d634}{hwloc\+\_\+alloc\+\_\+membind\+\_\+policy} (\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)
\begin{DoxyCompactList}\small\item\em Allocate some memory on the memory nodes near given cpuset {\ttfamily cpuset}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}


\subsection{Function Documentation}
\hypertarget{group__hwlocality__helper__binding_ga6178c6a9ec1dd88ec9f6a9fcdcc7d634}{\index{Binding Helpers@{Binding Helpers}!hwloc\+\_\+alloc\+\_\+membind\+\_\+policy@{hwloc\+\_\+alloc\+\_\+membind\+\_\+policy}}
\index{hwloc\+\_\+alloc\+\_\+membind\+\_\+policy@{hwloc\+\_\+alloc\+\_\+membind\+\_\+policy}!Binding Helpers@{Binding Helpers}}
\subsubsection[{hwloc\+\_\+alloc\+\_\+membind\+\_\+policy}]{\setlength{\rightskip}{0pt plus 5cm}static \+\_\+\+\_\+hwloc\+\_\+inline void$\ast$ hwloc\+\_\+alloc\+\_\+membind\+\_\+policy (
\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}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{group__hwlocality__helper__binding_ga6178c6a9ec1dd88ec9f6a9fcdcc7d634}


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

This is similar to hwloc\+\_\+alloc\+\_\+membind\+\_\+policy\+\_\+nodeset, but for a given cpuset. 

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

\hypertarget{group__hwlocality__helper__binding_ga3e772fbc4de626ed80f13d332b7d4d03}{\index{Binding Helpers@{Binding Helpers}!hwloc\+\_\+alloc\+\_\+membind\+\_\+policy\+\_\+nodeset@{hwloc\+\_\+alloc\+\_\+membind\+\_\+policy\+\_\+nodeset}}
\index{hwloc\+\_\+alloc\+\_\+membind\+\_\+policy\+\_\+nodeset@{hwloc\+\_\+alloc\+\_\+membind\+\_\+policy\+\_\+nodeset}!Binding Helpers@{Binding Helpers}}
\subsubsection[{hwloc\+\_\+alloc\+\_\+membind\+\_\+policy\+\_\+nodeset}]{\setlength{\rightskip}{0pt plus 5cm}static \+\_\+\+\_\+hwloc\+\_\+inline void$\ast$ hwloc\+\_\+alloc\+\_\+membind\+\_\+policy\+\_\+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}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{group__hwlocality__helper__binding_ga3e772fbc4de626ed80f13d332b7d4d03}


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

This is similar to hwloc\+\_\+alloc\+\_\+membind except that it is allowed to change the current memory binding policy, thus providing more binding support, at the expense of changing the current state. 

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

\hypertarget{group__hwlocality__helper__binding_gaf057d7c5e3cb3df897ce527258537619}{\index{Binding Helpers@{Binding Helpers}!hwloc\+\_\+distributev@{hwloc\+\_\+distributev}}
\index{hwloc\+\_\+distributev@{hwloc\+\_\+distributev}!Binding Helpers@{Binding Helpers}}
\subsubsection[{hwloc\+\_\+distributev}]{\setlength{\rightskip}{0pt plus 5cm}static \+\_\+\+\_\+hwloc\+\_\+inline void hwloc\+\_\+distributev (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{{\bf hwloc\+\_\+obj\+\_\+t} $\ast$}]{roots, }
\item[{unsigned}]{n\+\_\+roots, }
\item[{{\bf hwloc\+\_\+cpuset\+\_\+t} $\ast$}]{cpuset, }
\item[{unsigned}]{n, }
\item[{unsigned}]{until}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{group__hwlocality__helper__binding_gaf057d7c5e3cb3df897ce527258537619}


Distribute {\ttfamily n} items over the topology under {\ttfamily root}. 

Distribute {\ttfamily n} items over the topology under {\ttfamily roots}.

Array {\ttfamily cpuset} will be filled with {\ttfamily n} cpusets recursively distributed linearly over the topology under {\ttfamily root}, down to depth {\ttfamily until} (which can be I\+N\+T\+\_\+\+M\+A\+X to distribute down to the finest level).

This is typically useful when an application wants to distribute {\ttfamily n} threads over a machine, giving each of them as much private cache as possible and keeping them locally in number order.

The caller may typically want to also call \hyperlink{group__hwlocality__bitmap_ga4630aa1b7e08eac5b41be126194e84a1}{hwloc\+\_\+bitmap\+\_\+singlify()} before binding a thread so that it does not move at all.

This is the same as hwloc\+\_\+distribute, but takes an array of roots instead of just one root. 

References hwloc\+\_\+obj\+::cpuset, and hwloc\+\_\+bitmap\+\_\+weight().

