\hypertarget{linux-libnuma_8h}{\section{opal/mca/hwloc/hwloc132/hwloc/include/hwloc/linux-\/libnuma.h File Reference}
\label{linux-libnuma_8h}\index{opal/mca/hwloc/hwloc132/hwloc/include/hwloc/linux-\/libnuma.\+h@{opal/mca/hwloc/hwloc132/hwloc/include/hwloc/linux-\/libnuma.\+h}}
}


Macros to help interaction between hwloc and Linux libnuma.  


{\ttfamily \#include $<$hwloc.\+h$>$}\\*
{\ttfamily \#include $<$numa.\+h$>$}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static \+\_\+\+\_\+hwloc\+\_\+inline int \hyperlink{group__hwlocality__linux__libnuma__ulongs_ga018e57a42a780ce2ba2e35ef975d8888}{hwloc\+\_\+cpuset\+\_\+to\+\_\+linux\+\_\+libnuma\+\_\+ulongs} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga1f784433e9b606261f62d1134f6a3b25}{hwloc\+\_\+const\+\_\+cpuset\+\_\+t} cpuset, unsigned long $\ast$mask, unsigned long $\ast$maxnode)
\begin{DoxyCompactList}\small\item\em Convert hwloc C\+P\+U set {\ttfamily cpuset} into the array of unsigned long {\ttfamily mask}. \end{DoxyCompactList}\item 
static \+\_\+\+\_\+hwloc\+\_\+inline int \hyperlink{group__hwlocality__linux__libnuma__ulongs_gaf213df50d229c5d17a5a56b5d8f10b74}{hwloc\+\_\+nodeset\+\_\+to\+\_\+linux\+\_\+libnuma\+\_\+ulongs} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga2f5276235841ad66a79bedad16a5a10c}{hwloc\+\_\+const\+\_\+nodeset\+\_\+t} nodeset, unsigned long $\ast$mask, unsigned long $\ast$maxnode)
\begin{DoxyCompactList}\small\item\em Convert hwloc N\+U\+M\+A node set {\ttfamily nodeset} into the array of unsigned long {\ttfamily mask}. \end{DoxyCompactList}\item 
static \+\_\+\+\_\+hwloc\+\_\+inline int \hyperlink{group__hwlocality__linux__libnuma__ulongs_gafa60816dde33d69149497bcf6c7818e0}{hwloc\+\_\+cpuset\+\_\+from\+\_\+linux\+\_\+libnuma\+\_\+ulongs} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga4bbf39b68b6f568fb92739e7c0ea7801}{hwloc\+\_\+cpuset\+\_\+t} cpuset, const unsigned long $\ast$mask, unsigned long maxnode)
\begin{DoxyCompactList}\small\item\em Convert the array of unsigned long {\ttfamily mask} into hwloc C\+P\+U set. \end{DoxyCompactList}\item 
static \+\_\+\+\_\+hwloc\+\_\+inline int \hyperlink{group__hwlocality__linux__libnuma__ulongs_ga5b51a4a96a0c3ad9f4c0da308bbf4d8f}{hwloc\+\_\+nodeset\+\_\+from\+\_\+linux\+\_\+libnuma\+\_\+ulongs} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga37e35730fa7e775b5bb0afe893d6d508}{hwloc\+\_\+nodeset\+\_\+t} nodeset, const unsigned long $\ast$mask, unsigned long maxnode)
\begin{DoxyCompactList}\small\item\em Convert the array of unsigned long {\ttfamily mask} into hwloc N\+U\+M\+A node set. \end{DoxyCompactList}\item 
static \+\_\+\+\_\+hwloc\+\_\+inline struct \\*
bitmask \\*
$\ast$\+\_\+\+\_\+hwloc\+\_\+attribute\+\_\+malloc \hyperlink{group__hwlocality__linux__libnuma__bitmask_ga067ec565345a346bfd9d721cff5901ae}{hwloc\+\_\+cpuset\+\_\+to\+\_\+linux\+\_\+libnuma\+\_\+bitmask} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga1f784433e9b606261f62d1134f6a3b25}{hwloc\+\_\+const\+\_\+cpuset\+\_\+t} cpuset)
\begin{DoxyCompactList}\small\item\em Convert hwloc C\+P\+U set {\ttfamily cpuset} into the returned libnuma bitmask. \end{DoxyCompactList}\item 
static \+\_\+\+\_\+hwloc\+\_\+inline struct \\*
bitmask \\*
$\ast$\+\_\+\+\_\+hwloc\+\_\+attribute\+\_\+malloc \hyperlink{group__hwlocality__linux__libnuma__bitmask_gaa2c4cb4075422a19e07c450dc7092e69}{hwloc\+\_\+nodeset\+\_\+to\+\_\+linux\+\_\+libnuma\+\_\+bitmask} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga2f5276235841ad66a79bedad16a5a10c}{hwloc\+\_\+const\+\_\+nodeset\+\_\+t} nodeset)
\begin{DoxyCompactList}\small\item\em Convert hwloc N\+U\+M\+A node set {\ttfamily nodeset} into the returned libnuma bitmask. \end{DoxyCompactList}\item 
static \+\_\+\+\_\+hwloc\+\_\+inline int \hyperlink{group__hwlocality__linux__libnuma__bitmask_ga47747968f12c2674d2840dfbacce4940}{hwloc\+\_\+cpuset\+\_\+from\+\_\+linux\+\_\+libnuma\+\_\+bitmask} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga4bbf39b68b6f568fb92739e7c0ea7801}{hwloc\+\_\+cpuset\+\_\+t} cpuset, const struct bitmask $\ast$bitmask)
\begin{DoxyCompactList}\small\item\em Convert libnuma bitmask {\ttfamily bitmask} into hwloc C\+P\+U set {\ttfamily cpuset}. \end{DoxyCompactList}\item 
static \+\_\+\+\_\+hwloc\+\_\+inline int \hyperlink{group__hwlocality__linux__libnuma__bitmask_ga5a1d17375cc7b65cd155330008cbdb6a}{hwloc\+\_\+nodeset\+\_\+from\+\_\+linux\+\_\+libnuma\+\_\+bitmask} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga37e35730fa7e775b5bb0afe893d6d508}{hwloc\+\_\+nodeset\+\_\+t} nodeset, const struct bitmask $\ast$bitmask)
\begin{DoxyCompactList}\small\item\em Convert libnuma bitmask {\ttfamily bitmask} into hwloc N\+U\+M\+A node set {\ttfamily nodeset}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Macros to help interaction between hwloc and Linux libnuma. 

Applications that use both Linux libnuma and hwloc may want to include this file so as to ease conversion between their respective types.

This helper also offers a consistent behavior on non-\/\+N\+U\+M\+A machines or non-\/\+N\+U\+M\+A-\/aware kernels by assuming that the machines have a single N\+U\+M\+A node.

\begin{DoxyNote}{Note}
The behavior of libnuma is undefined if the kernel is not N\+U\+M\+A-\/aware. (when C\+O\+N\+F\+I\+G\+\_\+\+N\+U\+M\+A is not set in the kernel configuration). This helper and libnuma may thus not be strictly compatible in this case, which may be detected by checking whether numa\+\_\+available() returns -\/1. 
\end{DoxyNote}
