\hypertarget{group__hwlocality__tinker}{\section{Tinker With Topologies.}
\label{group__hwlocality__tinker}\index{Tinker With Topologies.@{Tinker With Topologies.}}
}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{group__hwlocality__tinker_ga9d80f08eb25b7ac22f1b998dc8bf521f}{hwloc\+\_\+restrict\+\_\+flags\+\_\+e} \{ \hyperlink{group__hwlocality__tinker_gga9d80f08eb25b7ac22f1b998dc8bf521fa4d18407f5520793b50b9e892f5bb55d1}{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+D\+I\+S\+T\+A\+N\+C\+E\+S}, 
\hyperlink{group__hwlocality__tinker_gga9d80f08eb25b7ac22f1b998dc8bf521fa699969227a09bbc1a7de51dc9fb7be4b}{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+M\+I\+S\+C}, 
\hyperlink{group__hwlocality__tinker_gga9d80f08eb25b7ac22f1b998dc8bf521faa95d6985e36ec1e55f68b210297a85cb}{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+I\+O}
 \}
\begin{DoxyCompactList}\small\item\em Flags to be given to \hyperlink{group__hwlocality__tinker_gad75fa918e3eb54663bdeab25ed89b648}{hwloc\+\_\+topology\+\_\+restrict()}. \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__tinker_ga45578d725c66865cfef31d0585dcff70}{hwloc\+\_\+topology\+\_\+export\+\_\+xml} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, const char $\ast$xmlpath)
\begin{DoxyCompactList}\small\item\em Export the topology into an X\+M\+L file. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__tinker_ga739330e9402425315e44e5012631fb91}{hwloc\+\_\+topology\+\_\+export\+\_\+xmlbuffer} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, char $\ast$$\ast$xmlbuffer, int $\ast$buflen)
\begin{DoxyCompactList}\small\item\em Export the topology into a newly-\/allocated X\+M\+L memory buffer. \end{DoxyCompactList}\item 
\hypertarget{group__hwlocality__tinker_ga5e375acef034bebc1f20ead884697301}{H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{group__hwlocality__tinker_ga5e375acef034bebc1f20ead884697301}{hwloc\+\_\+free\+\_\+xmlbuffer} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, char $\ast$xmlbuffer)}\label{group__hwlocality__tinker_ga5e375acef034bebc1f20ead884697301}

\begin{DoxyCompactList}\small\item\em Free a buffer allocated by \hyperlink{group__hwlocality__tinker_ga739330e9402425315e44e5012631fb91}{hwloc\+\_\+topology\+\_\+export\+\_\+xmlbuffer()} \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{group__hwlocality__objects_ga79b8ab56877ef99ac59b833203391c7d}{hwloc\+\_\+obj\+\_\+t} \hyperlink{group__hwlocality__tinker_ga017a9ba16d554326c6e3812d545d7230}{hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+cpuset} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__sets_ga1f784433e9b606261f62d1134f6a3b25}{hwloc\+\_\+const\+\_\+cpuset\+\_\+t} cpuset, const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Add a M\+I\+S\+C object to the topology. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{group__hwlocality__objects_ga79b8ab56877ef99ac59b833203391c7d}{hwloc\+\_\+obj\+\_\+t} \hyperlink{group__hwlocality__tinker_gadacd7a3d21220fbb30c3256d8b22a294}{hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+parent} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__objects_ga79b8ab56877ef99ac59b833203391c7d}{hwloc\+\_\+obj\+\_\+t} parent, const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Add a M\+I\+S\+C object as a leaf of the topology. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__tinker_gad75fa918e3eb54663bdeab25ed89b648}{hwloc\+\_\+topology\+\_\+restrict} (\hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} \+\_\+\+\_\+hwloc\+\_\+restrict topology, \hyperlink{group__hwlocality__sets_ga1f784433e9b606261f62d1134f6a3b25}{hwloc\+\_\+const\+\_\+cpuset\+\_\+t} cpuset, unsigned long flags)
\begin{DoxyCompactList}\small\item\em Restrict the topology to the given C\+P\+U set. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}


\subsection{Enumeration Type Documentation}
\hypertarget{group__hwlocality__tinker_ga9d80f08eb25b7ac22f1b998dc8bf521f}{\index{Tinker With Topologies.@{Tinker With Topologies.}!hwloc\+\_\+restrict\+\_\+flags\+\_\+e@{hwloc\+\_\+restrict\+\_\+flags\+\_\+e}}
\index{hwloc\+\_\+restrict\+\_\+flags\+\_\+e@{hwloc\+\_\+restrict\+\_\+flags\+\_\+e}!Tinker With Topologies.@{Tinker With Topologies.}}
\subsubsection[{hwloc\+\_\+restrict\+\_\+flags\+\_\+e}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf hwloc\+\_\+restrict\+\_\+flags\+\_\+e}}}\label{group__hwlocality__tinker_ga9d80f08eb25b7ac22f1b998dc8bf521f}


Flags to be given to \hyperlink{group__hwlocality__tinker_gad75fa918e3eb54663bdeab25ed89b648}{hwloc\+\_\+topology\+\_\+restrict()}. 

\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+D\+I\+S\+T\+A\+N\+C\+E\+S@{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+D\+I\+S\+T\+A\+N\+C\+E\+S}!Tinker With Topologies.@{Tinker With Topologies.}}\index{Tinker With Topologies.@{Tinker With Topologies.}!H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+D\+I\+S\+T\+A\+N\+C\+E\+S@{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+D\+I\+S\+T\+A\+N\+C\+E\+S}}\item[{\em 
\hypertarget{group__hwlocality__tinker_gga9d80f08eb25b7ac22f1b998dc8bf521fa4d18407f5520793b50b9e892f5bb55d1}{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+D\+I\+S\+T\+A\+N\+C\+E\+S}\label{group__hwlocality__tinker_gga9d80f08eb25b7ac22f1b998dc8bf521fa4d18407f5520793b50b9e892f5bb55d1}
}]Adapt distance matrices according to objects being removed during restriction. If this flag is not set, distance matrices are removed. \index{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+M\+I\+S\+C@{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+M\+I\+S\+C}!Tinker With Topologies.@{Tinker With Topologies.}}\index{Tinker With Topologies.@{Tinker With Topologies.}!H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+M\+I\+S\+C@{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+M\+I\+S\+C}}\item[{\em 
\hypertarget{group__hwlocality__tinker_gga9d80f08eb25b7ac22f1b998dc8bf521fa699969227a09bbc1a7de51dc9fb7be4b}{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+M\+I\+S\+C}\label{group__hwlocality__tinker_gga9d80f08eb25b7ac22f1b998dc8bf521fa699969227a09bbc1a7de51dc9fb7be4b}
}]Move Misc objects to ancestors if their parents are removed during restriction. If this flag is not set, Misc objects are removed when their parents are removed. \index{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+I\+O@{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+I\+O}!Tinker With Topologies.@{Tinker With Topologies.}}\index{Tinker With Topologies.@{Tinker With Topologies.}!H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+I\+O@{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+I\+O}}\item[{\em 
\hypertarget{group__hwlocality__tinker_gga9d80f08eb25b7ac22f1b998dc8bf521faa95d6985e36ec1e55f68b210297a85cb}{H\+W\+L\+O\+C\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+\_\+\+F\+L\+A\+G\+\_\+\+A\+D\+A\+P\+T\+\_\+\+I\+O}\label{group__hwlocality__tinker_gga9d80f08eb25b7ac22f1b998dc8bf521faa95d6985e36ec1e55f68b210297a85cb}
}]Move I/\+O objects to ancestors if their parents are removed during restriction. If this flag is not set, I/\+O devices and bridges are removed when their parents are removed. \end{description}
\end{Desc}


\subsection{Function Documentation}
\hypertarget{group__hwlocality__tinker_ga45578d725c66865cfef31d0585dcff70}{\index{Tinker With Topologies.@{Tinker With Topologies.}!hwloc\+\_\+topology\+\_\+export\+\_\+xml@{hwloc\+\_\+topology\+\_\+export\+\_\+xml}}
\index{hwloc\+\_\+topology\+\_\+export\+\_\+xml@{hwloc\+\_\+topology\+\_\+export\+\_\+xml}!Tinker With Topologies.@{Tinker With Topologies.}}
\subsubsection[{hwloc\+\_\+topology\+\_\+export\+\_\+xml}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+topology\+\_\+export\+\_\+xml (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{const char $\ast$}]{xmlpath}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__tinker_ga45578d725c66865cfef31d0585dcff70}


Export the topology into an X\+M\+L file. 

This file may be loaded later through \hyperlink{group__hwlocality__configuration_ga93efcc8a962afe1ed23393700682173f}{hwloc\+\_\+topology\+\_\+set\+\_\+xml()}.

\begin{DoxyReturn}{Returns}
-\/1 if a failure occured. 
\end{DoxyReturn}
\hypertarget{group__hwlocality__tinker_ga739330e9402425315e44e5012631fb91}{\index{Tinker With Topologies.@{Tinker With Topologies.}!hwloc\+\_\+topology\+\_\+export\+\_\+xmlbuffer@{hwloc\+\_\+topology\+\_\+export\+\_\+xmlbuffer}}
\index{hwloc\+\_\+topology\+\_\+export\+\_\+xmlbuffer@{hwloc\+\_\+topology\+\_\+export\+\_\+xmlbuffer}!Tinker With Topologies.@{Tinker With Topologies.}}
\subsubsection[{hwloc\+\_\+topology\+\_\+export\+\_\+xmlbuffer}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+topology\+\_\+export\+\_\+xmlbuffer (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{char $\ast$$\ast$}]{xmlbuffer, }
\item[{int $\ast$}]{buflen}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__tinker_ga739330e9402425315e44e5012631fb91}


Export the topology into a newly-\/allocated X\+M\+L memory buffer. 

{\ttfamily xmlbuffer} is allocated by the callee and should be freed with \hyperlink{group__hwlocality__tinker_ga5e375acef034bebc1f20ead884697301}{hwloc\+\_\+free\+\_\+xmlbuffer()} later in the caller.

This memory buffer may be loaded later through \hyperlink{group__hwlocality__configuration_gae7e4bade144652a2b48f5eaf0309b4ec}{hwloc\+\_\+topology\+\_\+set\+\_\+xmlbuffer()}.

\begin{DoxyReturn}{Returns}
-\/1 if a failure occured. 
\end{DoxyReturn}
\hypertarget{group__hwlocality__tinker_ga017a9ba16d554326c6e3812d545d7230}{\index{Tinker With Topologies.@{Tinker With Topologies.}!hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+cpuset@{hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+cpuset}}
\index{hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+cpuset@{hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+cpuset}!Tinker With Topologies.@{Tinker With Topologies.}}
\subsubsection[{hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+cpuset}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C {\bf hwloc\+\_\+obj\+\_\+t} hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+cpuset (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{{\bf hwloc\+\_\+const\+\_\+cpuset\+\_\+t}}]{cpuset, }
\item[{const char $\ast$}]{name}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__tinker_ga017a9ba16d554326c6e3812d545d7230}


Add a M\+I\+S\+C object to the topology. 

A new M\+I\+S\+C object will be created and inserted into the topology at the position given by bitmap {\ttfamily cpuset}. This offers a way to add new intermediate levels to the topology hierarchy.

{\ttfamily cpuset} and {\ttfamily name} will be copied to setup the new object attributes.

\begin{DoxyReturn}{Returns}
the newly-\/created object. 

{\ttfamily N\+U\+L\+L} if the insertion conflicts with the existing topology tree. 
\end{DoxyReturn}
\hypertarget{group__hwlocality__tinker_gadacd7a3d21220fbb30c3256d8b22a294}{\index{Tinker With Topologies.@{Tinker With Topologies.}!hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+parent@{hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+parent}}
\index{hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+parent@{hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+parent}!Tinker With Topologies.@{Tinker With Topologies.}}
\subsubsection[{hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+parent}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C {\bf hwloc\+\_\+obj\+\_\+t} hwloc\+\_\+topology\+\_\+insert\+\_\+misc\+\_\+object\+\_\+by\+\_\+parent (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{{\bf hwloc\+\_\+obj\+\_\+t}}]{parent, }
\item[{const char $\ast$}]{name}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__tinker_gadacd7a3d21220fbb30c3256d8b22a294}


Add a M\+I\+S\+C object as a leaf of the topology. 

A new M\+I\+S\+C object will be created and inserted into the topology at the position given by parent. It is appended to the list of existing children, without ever adding any intermediate hierarchy level. This is useful for annotating the topology without actually changing the hierarchy.

{\ttfamily name} will be copied to the setup the new object attributes. However, the new leaf object will not have any {\ttfamily cpuset}.

\begin{DoxyReturn}{Returns}
the newly-\/created object 
\end{DoxyReturn}
\hypertarget{group__hwlocality__tinker_gad75fa918e3eb54663bdeab25ed89b648}{\index{Tinker With Topologies.@{Tinker With Topologies.}!hwloc\+\_\+topology\+\_\+restrict@{hwloc\+\_\+topology\+\_\+restrict}}
\index{hwloc\+\_\+topology\+\_\+restrict@{hwloc\+\_\+topology\+\_\+restrict}!Tinker With Topologies.@{Tinker With Topologies.}}
\subsubsection[{hwloc\+\_\+topology\+\_\+restrict}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+topology\+\_\+restrict (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+topology\+\_\+t} \+\_\+\+\_\+hwloc\+\_\+restrict}]{topology, }
\item[{{\bf hwloc\+\_\+const\+\_\+cpuset\+\_\+t}}]{cpuset, }
\item[{unsigned long}]{flags}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__tinker_gad75fa918e3eb54663bdeab25ed89b648}


Restrict the topology to the given C\+P\+U set. 

Topology {\ttfamily topology} is modified so as to remove all objects that are not included (or partially included) in the C\+P\+U set {\ttfamily cpuset}. All objects C\+P\+U and node sets are restricted accordingly.

{\ttfamily flags} is a O\+R'ed set of \hyperlink{group__hwlocality__tinker_ga9d80f08eb25b7ac22f1b998dc8bf521f}{hwloc\+\_\+restrict\+\_\+flags\+\_\+e}.

\begin{DoxyNote}{Note}
This call may not be reverted by restricting back to a larger cpuset. Once dropped during restriction, objects may not be brought back, except by reloading the entire topology with \hyperlink{group__hwlocality__creation_ga91e2e6427b95fb7339c99dbbef996e71}{hwloc\+\_\+topology\+\_\+load()}. 
\end{DoxyNote}
