\hypertarget{group__hwlocality__conversion}{\section{Object/\+String Conversion}
\label{group__hwlocality__conversion}\index{Object/\+String Conversion@{Object/\+String Conversion}}
}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__hwlocality__conversion_ga7c61920feca6fd9006d930dabfc09058}{H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C const char $\ast$ \hyperlink{group__hwlocality__conversion_ga7c61920feca6fd9006d930dabfc09058}{hwloc\+\_\+obj\+\_\+type\+\_\+string} (\hyperlink{group__hwlocality__types_gacd37bb612667dc437d66bfb175a8dc55}{hwloc\+\_\+obj\+\_\+type\+\_\+t} type) \+\_\+\+\_\+hwloc\+\_\+attribute\+\_\+const}\label{group__hwlocality__conversion_ga7c61920feca6fd9006d930dabfc09058}

\begin{DoxyCompactList}\small\item\em Return a stringified topology object type. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{group__hwlocality__types_gacd37bb612667dc437d66bfb175a8dc55}{hwloc\+\_\+obj\+\_\+type\+\_\+t} \hyperlink{group__hwlocality__conversion_gade722091ae392fdc79557e797a16c370}{hwloc\+\_\+obj\+\_\+type\+\_\+of\+\_\+string} (const char $\ast$string) \+\_\+\+\_\+hwloc\+\_\+attribute\+\_\+pure
\begin{DoxyCompactList}\small\item\em Return an object type from the string. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__conversion_ga3ad856e8f3487d340c82a23b8a2a0351}{hwloc\+\_\+obj\+\_\+type\+\_\+snprintf} (char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict string, size\+\_\+t size, \hyperlink{group__hwlocality__objects_ga79b8ab56877ef99ac59b833203391c7d}{hwloc\+\_\+obj\+\_\+t} obj, int verbose)
\begin{DoxyCompactList}\small\item\em Stringify the type of a given topology object into a human-\/readable form. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__conversion_ga0db8286d7f3ceda8defd76e3e1e2b284}{hwloc\+\_\+obj\+\_\+attr\+\_\+snprintf} (char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict string, size\+\_\+t size, \hyperlink{group__hwlocality__objects_ga79b8ab56877ef99ac59b833203391c7d}{hwloc\+\_\+obj\+\_\+t} obj, const char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict separator, int verbose)
\begin{DoxyCompactList}\small\item\em Stringify the attributes of a given topology object into a human-\/readable form. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__conversion_ga5c6a61a83f4790b421e2f62e9088446f}{hwloc\+\_\+obj\+\_\+snprintf} (char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict string, size\+\_\+t size, \hyperlink{group__hwlocality__topology_ga9d1e76ee15a7dee158b786c30b6a6e38}{hwloc\+\_\+topology\+\_\+t} topology, \hyperlink{group__hwlocality__objects_ga79b8ab56877ef99ac59b833203391c7d}{hwloc\+\_\+obj\+\_\+t} obj, const char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict indexprefix, int verbose)
\begin{DoxyCompactList}\small\item\em Stringify a given topology object into a human-\/readable form. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{group__hwlocality__conversion_gabbfb92224c992c0e2ecef6b6e45260f2}{hwloc\+\_\+obj\+\_\+cpuset\+\_\+snprintf} (char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict str, size\+\_\+t size, size\+\_\+t nobj, const \hyperlink{group__hwlocality__objects_ga79b8ab56877ef99ac59b833203391c7d}{hwloc\+\_\+obj\+\_\+t} $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict objs)
\begin{DoxyCompactList}\small\item\em Stringify the cpuset containing a set of objects. \end{DoxyCompactList}\item 
static \+\_\+\+\_\+hwloc\+\_\+inline const \\*
char $\ast$\+\_\+\+\_\+hwloc\+\_\+attribute\+\_\+pure \hyperlink{group__hwlocality__conversion_gaa54b108ea2310ef53f6437358e865656}{hwloc\+\_\+obj\+\_\+get\+\_\+info\+\_\+by\+\_\+name} (\hyperlink{group__hwlocality__objects_ga79b8ab56877ef99ac59b833203391c7d}{hwloc\+\_\+obj\+\_\+t} obj, const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Search the given key name in object infos and return the corresponding value. \end{DoxyCompactList}\item 
H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{group__hwlocality__conversion_gaba3afe636940872772ed6dfaf0b3552e}{hwloc\+\_\+obj\+\_\+add\+\_\+info} (\hyperlink{group__hwlocality__objects_ga79b8ab56877ef99ac59b833203391c7d}{hwloc\+\_\+obj\+\_\+t} obj, const char $\ast$name, const char $\ast$value)
\begin{DoxyCompactList}\small\item\em Add the given info name and value pair to the given object. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}


\subsection{Function Documentation}
\hypertarget{group__hwlocality__conversion_gaba3afe636940872772ed6dfaf0b3552e}{\index{Object/\+String Conversion@{Object/\+String Conversion}!hwloc\+\_\+obj\+\_\+add\+\_\+info@{hwloc\+\_\+obj\+\_\+add\+\_\+info}}
\index{hwloc\+\_\+obj\+\_\+add\+\_\+info@{hwloc\+\_\+obj\+\_\+add\+\_\+info}!Object/\+String Conversion@{Object/\+String Conversion}}
\subsubsection[{hwloc\+\_\+obj\+\_\+add\+\_\+info}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void hwloc\+\_\+obj\+\_\+add\+\_\+info (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+obj\+\_\+t}}]{obj, }
\item[{const char $\ast$}]{name, }
\item[{const char $\ast$}]{value}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__conversion_gaba3afe636940872772ed6dfaf0b3552e}


Add the given info name and value pair to the given object. 

The info is appended to the existing info array even if another key with the same name already exists.

The input strings are copied before being added in the object infos. 

References hwloc\+\_\+obj\+::infos, hwloc\+\_\+obj\+::infos\+\_\+count, hwloc\+\_\+obj\+\_\+info\+\_\+s\+::name, and hwloc\+\_\+obj\+\_\+info\+\_\+s\+::value.

\hypertarget{group__hwlocality__conversion_ga0db8286d7f3ceda8defd76e3e1e2b284}{\index{Object/\+String Conversion@{Object/\+String Conversion}!hwloc\+\_\+obj\+\_\+attr\+\_\+snprintf@{hwloc\+\_\+obj\+\_\+attr\+\_\+snprintf}}
\index{hwloc\+\_\+obj\+\_\+attr\+\_\+snprintf@{hwloc\+\_\+obj\+\_\+attr\+\_\+snprintf}!Object/\+String Conversion@{Object/\+String Conversion}}
\subsubsection[{hwloc\+\_\+obj\+\_\+attr\+\_\+snprintf}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+obj\+\_\+attr\+\_\+snprintf (
\begin{DoxyParamCaption}
\item[{char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict}]{string, }
\item[{size\+\_\+t}]{size, }
\item[{{\bf hwloc\+\_\+obj\+\_\+t}}]{obj, }
\item[{const char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict}]{separator, }
\item[{int}]{verbose}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__conversion_ga0db8286d7f3ceda8defd76e3e1e2b284}


Stringify the attributes of a given topology object into a human-\/readable form. 

Attribute values are separated by {\ttfamily separator}.

Only the major attributes are printed in non-\/verbose mode.

If {\ttfamily size} is 0, {\ttfamily string} may safely be {\ttfamily N\+U\+L\+L}.

\begin{DoxyReturn}{Returns}
the number of character that were actually written if not truncating, or that would have been written (not including the ending \textbackslash{}0). 
\end{DoxyReturn}
\hypertarget{group__hwlocality__conversion_gabbfb92224c992c0e2ecef6b6e45260f2}{\index{Object/\+String Conversion@{Object/\+String Conversion}!hwloc\+\_\+obj\+\_\+cpuset\+\_\+snprintf@{hwloc\+\_\+obj\+\_\+cpuset\+\_\+snprintf}}
\index{hwloc\+\_\+obj\+\_\+cpuset\+\_\+snprintf@{hwloc\+\_\+obj\+\_\+cpuset\+\_\+snprintf}!Object/\+String Conversion@{Object/\+String Conversion}}
\subsubsection[{hwloc\+\_\+obj\+\_\+cpuset\+\_\+snprintf}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+obj\+\_\+cpuset\+\_\+snprintf (
\begin{DoxyParamCaption}
\item[{char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict}]{str, }
\item[{size\+\_\+t}]{size, }
\item[{size\+\_\+t}]{nobj, }
\item[{const {\bf hwloc\+\_\+obj\+\_\+t} $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict}]{objs}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__conversion_gabbfb92224c992c0e2ecef6b6e45260f2}


Stringify the cpuset containing a set of objects. 

If {\ttfamily size} is 0, {\ttfamily string} may safely be {\ttfamily N\+U\+L\+L}.

\begin{DoxyReturn}{Returns}
the number of character that were actually written if not truncating, or that would have been written (not including the ending \textbackslash{}0). 
\end{DoxyReturn}
\hypertarget{group__hwlocality__conversion_gaa54b108ea2310ef53f6437358e865656}{\index{Object/\+String Conversion@{Object/\+String Conversion}!hwloc\+\_\+obj\+\_\+get\+\_\+info\+\_\+by\+\_\+name@{hwloc\+\_\+obj\+\_\+get\+\_\+info\+\_\+by\+\_\+name}}
\index{hwloc\+\_\+obj\+\_\+get\+\_\+info\+\_\+by\+\_\+name@{hwloc\+\_\+obj\+\_\+get\+\_\+info\+\_\+by\+\_\+name}!Object/\+String Conversion@{Object/\+String Conversion}}
\subsubsection[{hwloc\+\_\+obj\+\_\+get\+\_\+info\+\_\+by\+\_\+name}]{\setlength{\rightskip}{0pt plus 5cm}static \+\_\+\+\_\+hwloc\+\_\+inline const char$\ast$ \+\_\+\+\_\+hwloc\+\_\+attribute\+\_\+pure hwloc\+\_\+obj\+\_\+get\+\_\+info\+\_\+by\+\_\+name (
\begin{DoxyParamCaption}
\item[{{\bf hwloc\+\_\+obj\+\_\+t}}]{obj, }
\item[{const char $\ast$}]{name}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{group__hwlocality__conversion_gaa54b108ea2310ef53f6437358e865656}


Search the given key name in object infos and return the corresponding value. 

If multiple keys match the given name, only the first one is returned.

\begin{DoxyReturn}{Returns}
{\ttfamily N\+U\+L\+L} if no such key exists. 
\end{DoxyReturn}


References hwloc\+\_\+obj\+::infos, hwloc\+\_\+obj\+::infos\+\_\+count, hwloc\+\_\+obj\+\_\+info\+\_\+s\+::name, and hwloc\+\_\+obj\+\_\+info\+\_\+s\+::value.

\hypertarget{group__hwlocality__conversion_ga5c6a61a83f4790b421e2f62e9088446f}{\index{Object/\+String Conversion@{Object/\+String Conversion}!hwloc\+\_\+obj\+\_\+snprintf@{hwloc\+\_\+obj\+\_\+snprintf}}
\index{hwloc\+\_\+obj\+\_\+snprintf@{hwloc\+\_\+obj\+\_\+snprintf}!Object/\+String Conversion@{Object/\+String Conversion}}
\subsubsection[{hwloc\+\_\+obj\+\_\+snprintf}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+obj\+\_\+snprintf (
\begin{DoxyParamCaption}
\item[{char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict}]{string, }
\item[{size\+\_\+t}]{size, }
\item[{{\bf hwloc\+\_\+topology\+\_\+t}}]{topology, }
\item[{{\bf hwloc\+\_\+obj\+\_\+t}}]{obj, }
\item[{const char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict}]{indexprefix, }
\item[{int}]{verbose}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__conversion_ga5c6a61a83f4790b421e2f62e9088446f}


Stringify a given topology object into a human-\/readable form. 

\begin{DoxyNote}{Note}
This function is deprecated in favor of \hyperlink{group__hwlocality__conversion_ga3ad856e8f3487d340c82a23b8a2a0351}{hwloc\+\_\+obj\+\_\+type\+\_\+snprintf()} and \hyperlink{group__hwlocality__conversion_ga0db8286d7f3ceda8defd76e3e1e2b284}{hwloc\+\_\+obj\+\_\+attr\+\_\+snprintf()} since it is not very flexible and only prints physical/\+O\+S indexes.
\end{DoxyNote}
Fill string {\ttfamily string} up to {\ttfamily size} characters with the description of topology object {\ttfamily obj} in topology {\ttfamily topology}.

If {\ttfamily verbose} is set, a longer description is used. Otherwise a short description is used.

{\ttfamily indexprefix} is used to prefix the {\ttfamily os\+\_\+index} attribute number of the object in the description. If {\ttfamily N\+U\+L\+L}, the {\ttfamily \#} character is used.

If {\ttfamily size} is 0, {\ttfamily string} may safely be {\ttfamily N\+U\+L\+L}.

\begin{DoxyReturn}{Returns}
the number of character that were actually written if not truncating, or that would have been written (not including the ending \textbackslash{}0). 
\end{DoxyReturn}
\hypertarget{group__hwlocality__conversion_gade722091ae392fdc79557e797a16c370}{\index{Object/\+String Conversion@{Object/\+String Conversion}!hwloc\+\_\+obj\+\_\+type\+\_\+of\+\_\+string@{hwloc\+\_\+obj\+\_\+type\+\_\+of\+\_\+string}}
\index{hwloc\+\_\+obj\+\_\+type\+\_\+of\+\_\+string@{hwloc\+\_\+obj\+\_\+type\+\_\+of\+\_\+string}!Object/\+String Conversion@{Object/\+String Conversion}}
\subsubsection[{hwloc\+\_\+obj\+\_\+type\+\_\+of\+\_\+string}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C {\bf hwloc\+\_\+obj\+\_\+type\+\_\+t} hwloc\+\_\+obj\+\_\+type\+\_\+of\+\_\+string (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{string}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__conversion_gade722091ae392fdc79557e797a16c370}


Return an object type from the string. 

\begin{DoxyReturn}{Returns}
-\/1 if unrecognized. 
\end{DoxyReturn}


References H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+B\+R\+I\+D\+G\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+C\+A\+C\+H\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+C\+O\+R\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+G\+R\+O\+U\+P, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+M\+A\+C\+H\+I\+N\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+M\+I\+S\+C, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+N\+O\+D\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+O\+S\+\_\+\+D\+E\+V\+I\+C\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+P\+C\+I\+\_\+\+D\+E\+V\+I\+C\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+P\+U, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+S\+O\+C\+K\+E\+T, and H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+S\+Y\+S\+T\+E\+M.

\hypertarget{group__hwlocality__conversion_ga3ad856e8f3487d340c82a23b8a2a0351}{\index{Object/\+String Conversion@{Object/\+String Conversion}!hwloc\+\_\+obj\+\_\+type\+\_\+snprintf@{hwloc\+\_\+obj\+\_\+type\+\_\+snprintf}}
\index{hwloc\+\_\+obj\+\_\+type\+\_\+snprintf@{hwloc\+\_\+obj\+\_\+type\+\_\+snprintf}!Object/\+String Conversion@{Object/\+String Conversion}}
\subsubsection[{hwloc\+\_\+obj\+\_\+type\+\_\+snprintf}]{\setlength{\rightskip}{0pt plus 5cm}H\+W\+L\+O\+C\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int hwloc\+\_\+obj\+\_\+type\+\_\+snprintf (
\begin{DoxyParamCaption}
\item[{char $\ast$\+\_\+\+\_\+hwloc\+\_\+restrict}]{string, }
\item[{size\+\_\+t}]{size, }
\item[{{\bf hwloc\+\_\+obj\+\_\+t}}]{obj, }
\item[{int}]{verbose}
\end{DoxyParamCaption}
)}}\label{group__hwlocality__conversion_ga3ad856e8f3487d340c82a23b8a2a0351}


Stringify the type of a given topology object into a human-\/readable form. 

It differs from \hyperlink{group__hwlocality__conversion_ga7c61920feca6fd9006d930dabfc09058}{hwloc\+\_\+obj\+\_\+type\+\_\+string()} because it prints type attributes such as cache depth.

If {\ttfamily size} is 0, {\ttfamily string} may safely be {\ttfamily N\+U\+L\+L}.

\begin{DoxyReturn}{Returns}
the number of character that were actually written if not truncating, or that would have been written (not including the ending \textbackslash{}0). 
\end{DoxyReturn}


References hwloc\+\_\+obj\+::attr, hwloc\+\_\+obj\+\_\+attr\+\_\+u\+::hwloc\+\_\+cache\+\_\+attr\+\_\+s\+::depth, hwloc\+\_\+obj\+\_\+attr\+\_\+u\+::hwloc\+\_\+group\+\_\+attr\+\_\+s\+::depth, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+B\+R\+I\+D\+G\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+B\+R\+I\+D\+G\+E\+\_\+\+P\+C\+I, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+C\+A\+C\+H\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+C\+O\+R\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+G\+R\+O\+U\+P, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+M\+A\+C\+H\+I\+N\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+M\+I\+S\+C, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+N\+O\+D\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+O\+S\+\_\+\+D\+E\+V\+I\+C\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+O\+S\+D\+E\+V\+\_\+\+B\+L\+O\+C\+K, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+O\+S\+D\+E\+V\+\_\+\+D\+M\+A, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+O\+S\+D\+E\+V\+\_\+\+G\+P\+U, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+O\+S\+D\+E\+V\+\_\+\+N\+E\+T\+W\+O\+R\+K, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+O\+S\+D\+E\+V\+\_\+\+O\+P\+E\+N\+F\+A\+B\+R\+I\+C\+S, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+P\+C\+I\+\_\+\+D\+E\+V\+I\+C\+E, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+P\+U, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+S\+O\+C\+K\+E\+T, H\+W\+L\+O\+C\+\_\+\+O\+B\+J\+\_\+\+S\+Y\+S\+T\+E\+M, hwloc\+\_\+obj\+\_\+type\+\_\+string(), and hwloc\+\_\+obj\+::type.

