\hypertarget{rcache__rb__tree_8c}{\section{ompi/mca/rcache/rb/rcache\+\_\+rb\+\_\+tree.c File Reference}
\label{rcache__rb__tree_8c}\index{ompi/mca/rcache/rb/rcache\+\_\+rb\+\_\+tree.\+c@{ompi/mca/rcache/rb/rcache\+\_\+rb\+\_\+tree.\+c}}
}


Copyright (c) 2004-\/2005 The Trustees of Indiana University and Indiana University Research and Technology Corporation.  


{\ttfamily \#include \char`\"{}ompi\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/mca/mca.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}rcache\+\_\+rb\+\_\+tree.\+h\char`\"{}}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{rcache__rb__tree_8c_a47265e8f6feaaa168cce0e6e086371ad}{{\bfseries O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E} (\hyperlink{structmca__rcache__rb__tree__item__t}{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+item\+\_\+t}, \hyperlink{structompi__free__list__item__t}{ompi\+\_\+free\+\_\+list\+\_\+item\+\_\+t}, N\+U\+L\+L, N\+U\+L\+L)}\label{rcache__rb__tree_8c_a47265e8f6feaaa168cce0e6e086371ad}

\item 
int \hyperlink{rcache__rb__tree_8c_a4ed0d82692b9d3818d33202eb3bdf60e}{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+node\+\_\+compare} (void $\ast$key1, void $\ast$key2)
\begin{DoxyCompactList}\small\item\em Memory Pool Registration. \end{DoxyCompactList}\item 
\hypertarget{rcache__rb__tree_8c_a369ca7d2afde68e887a340e47c273c96}{int {\bfseries mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+init} (\hyperlink{structmca__rcache__rb__module__t}{mca\+\_\+rcache\+\_\+rb\+\_\+module\+\_\+t} $\ast$rcache)}\label{rcache__rb__tree_8c_a369ca7d2afde68e887a340e47c273c96}

\item 
struct \hyperlink{structmca__rcache__rb__tree__item__t}{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+item\+\_\+t} $\ast$ \hyperlink{rcache__rb__tree_8c_a007c0906f2e8a992cfc3e1b166618459}{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+find} (\hyperlink{structmca__rcache__rb__module__t}{mca\+\_\+rcache\+\_\+rb\+\_\+module\+\_\+t} $\ast$rcache, void $\ast$base)
\begin{DoxyCompactList}\small\item\em Searches the mpool to see if it has allocated the memory that is passed in. \end{DoxyCompactList}\item 
\hypertarget{rcache__rb__tree_8c_a3ded5caab740b94bca9868e5e8ce45e7}{int {\bfseries mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+insert} (\hyperlink{structmca__rcache__rb__module__t}{mca\+\_\+rcache\+\_\+rb\+\_\+module\+\_\+t} $\ast$rb\+\_\+module, \hyperlink{structmca__mpool__base__registration__t}{mca\+\_\+mpool\+\_\+base\+\_\+registration\+\_\+t} $\ast$reg)}\label{rcache__rb__tree_8c_a3ded5caab740b94bca9868e5e8ce45e7}

\item 
int \hyperlink{rcache__rb__tree_8c_a2fbd364bce8b4b27240f8068fb891af4}{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+delete} (\hyperlink{structmca__rcache__rb__module__t}{mca\+\_\+rcache\+\_\+rb\+\_\+module\+\_\+t} $\ast$rb\+\_\+module, \hyperlink{structmca__mpool__base__registration__t}{mca\+\_\+mpool\+\_\+base\+\_\+registration\+\_\+t} $\ast$reg)
\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} to remove previously memory from the tree without freeing it. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Copyright (c) 2004-\/2005 The Trustees of Indiana University and Indiana University Research and Technology Corporation. 

All rights reserved. Copyright (c) 2004-\/2006 The University of Tennessee and The University of Tennessee Research Foundation. All rights reserved. Copyright (c) 2004-\/2005 High Performance Computing Center Stuttgart, University of Stuttgart. All rights reserved. Copyright (c) 2004-\/2005 The Regents of the University of California. All rights reserved.\+5\+A \$\+C\+O\+P\+Y\+R\+I\+G\+H\+T\$

Additional copyrights may follow

\$\+H\+E\+A\+D\+E\+R\$

Description of the Registration Cache framework 

\subsection{Function Documentation}
\hypertarget{rcache__rb__tree_8c_a2fbd364bce8b4b27240f8068fb891af4}{\index{rcache\+\_\+rb\+\_\+tree.\+c@{rcache\+\_\+rb\+\_\+tree.\+c}!mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+delete@{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+delete}}
\index{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+delete@{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+delete}!rcache\+\_\+rb\+\_\+tree.\+c@{rcache\+\_\+rb\+\_\+tree.\+c}}
\subsubsection[{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+delete}]{\setlength{\rightskip}{0pt plus 5cm}int mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+delete (
\begin{DoxyParamCaption}
\item[{{\bf mca\+\_\+rcache\+\_\+rb\+\_\+module\+\_\+t} $\ast$}]{rb\+\_\+module, }
\item[{{\bf mca\+\_\+mpool\+\_\+base\+\_\+registration\+\_\+t} $\ast$}]{reg}
\end{DoxyParamCaption}
)}}\label{rcache__rb__tree_8c_a2fbd364bce8b4b27240f8068fb891af4}


\hyperlink{structFunction}{Function} to remove previously memory from the tree without freeing it. 


\begin{DoxyParams}{Parameters}
{\em base} & pointer to the memory to free\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S} & \\
\hline
{\em O\+M\+P\+I\+\_\+\+E\+R\+R\+\_\+\+B\+A\+D\+\_\+\+P\+A\+R\+A\+M} & if the passed base pointer was invalid \\
\hline
\end{DoxyRetVals}


References mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+item\+\_\+t\+::key, mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+find(), ompi\+\_\+rb\+\_\+tree\+\_\+delete(), and mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+item\+\_\+t\+::reg.

\hypertarget{rcache__rb__tree_8c_a007c0906f2e8a992cfc3e1b166618459}{\index{rcache\+\_\+rb\+\_\+tree.\+c@{rcache\+\_\+rb\+\_\+tree.\+c}!mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+find@{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+find}}
\index{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+find@{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+find}!rcache\+\_\+rb\+\_\+tree.\+c@{rcache\+\_\+rb\+\_\+tree.\+c}}
\subsubsection[{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+find}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+item\+\_\+t}$\ast$ mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+find (
\begin{DoxyParamCaption}
\item[{{\bf mca\+\_\+rcache\+\_\+rb\+\_\+module\+\_\+t} $\ast$}]{rcache, }
\item[{void $\ast$}]{base}
\end{DoxyParamCaption}
)}}\label{rcache__rb__tree_8c_a007c0906f2e8a992cfc3e1b166618459}


Searches the mpool to see if it has allocated the memory that is passed in. 

Returns the item in the rb tree.

If so it returns an array of mpools the memory is registered with.


\begin{DoxyParams}{Parameters}
{\em base} & pointer to the memory to lookup\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em N\+U\+L\+L} & if the memory is not in any mpool \\
\hline
{\em pointer} & to an array of type mca\+\_\+mpool\+\_\+base\+\_\+reg\+\_\+mpool\+\_\+t \\
\hline
\end{DoxyRetVals}


References mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+key\+\_\+t\+::base, mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+key\+\_\+t\+::bound, mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+item\+\_\+t\+::key, ompi\+\_\+rb\+\_\+tree\+\_\+find(), and mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+item\+\_\+t\+::reg.



Referenced by mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+delete().

\hypertarget{rcache__rb__tree_8c_a4ed0d82692b9d3818d33202eb3bdf60e}{\index{rcache\+\_\+rb\+\_\+tree.\+c@{rcache\+\_\+rb\+\_\+tree.\+c}!mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+node\+\_\+compare@{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+node\+\_\+compare}}
\index{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+node\+\_\+compare@{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+node\+\_\+compare}!rcache\+\_\+rb\+\_\+tree.\+c@{rcache\+\_\+rb\+\_\+tree.\+c}}
\subsubsection[{mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+node\+\_\+compare}]{\setlength{\rightskip}{0pt plus 5cm}int mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+node\+\_\+compare (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{key1, }
\item[{void $\ast$}]{key2}
\end{DoxyParamCaption}
)}}\label{rcache__rb__tree_8c_a4ed0d82692b9d3818d33202eb3bdf60e}


Memory Pool Registration. 

\hyperlink{structFunction}{Function} for the red black tree to compare 2 keys


\begin{DoxyParams}{Parameters}
{\em key1} & a pointer to the 1st key \\
\hline
{\em key2} & a pointer to the second key\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & if key1 is below key2 \\
\hline
{\em 1} & if key 1 is above key2 \\
\hline
{\em 0} & if the keys are the same \\
\hline
\end{DoxyRetVals}
