\hypertarget{opal__bitmap_8h}{\section{opal/class/opal\+\_\+bitmap.h File Reference}
\label{opal__bitmap_8h}\index{opal/class/opal\+\_\+bitmap.\+h@{opal/class/opal\+\_\+bitmap.\+h}}
}


A bitmap implementation.  


{\ttfamily \#include \char`\"{}opal\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include $<$string.\+h$>$}\\*
{\ttfamily \#include \char`\"{}opal/class/opal\+\_\+object.\+h\char`\"{}}\\*
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t}
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{opal__bitmap_8h_a7adfcf46b7f8aed7a7349c0887effff8}{typedef struct \hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} {\bfseries opal\+\_\+bitmap\+\_\+t}}\label{opal__bitmap_8h_a7adfcf46b7f8aed7a7349c0887effff8}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{opal__bitmap_8h_aa2a6263b4f1464cab13b8dfec5959d01}{O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C {\bfseries O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t})}\label{opal__bitmap_8h_aa2a6263b4f1464cab13b8dfec5959d01}

\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_aa8b7fd9d3f04e12e1b9dcad5b46f42be}{opal\+\_\+bitmap\+\_\+set\+\_\+max\+\_\+size} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bm, int max\+\_\+size)
\begin{DoxyCompactList}\small\item\em Set the maximum size of the bitmap. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_a46098570f053ec3f4a362a02cb3514c5}{opal\+\_\+bitmap\+\_\+init} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bm, int size)
\begin{DoxyCompactList}\small\item\em Initializes the bitmap and sets its size. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_a421adc7aa9cf6907ed19598bae8d5f63}{opal\+\_\+bitmap\+\_\+set\+\_\+bit} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bm, int bit)
\begin{DoxyCompactList}\small\item\em Set a bit of the bitmap. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_afd189ce9320c6682afe665be3b79ae3f}{opal\+\_\+bitmap\+\_\+clear\+\_\+bit} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bm, int bit)
\begin{DoxyCompactList}\small\item\em Clear/unset a bit of the bitmap. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C bool \hyperlink{opal__bitmap_8h_a102c4a78b6028d1a9dc90dc076e3b9fb}{opal\+\_\+bitmap\+\_\+is\+\_\+set\+\_\+bit} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bm, int bit)
\begin{DoxyCompactList}\small\item\em Find out if a bit is set in the bitmap. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_a0f77c8302095dc04724734d40a71e826}{opal\+\_\+bitmap\+\_\+find\+\_\+and\+\_\+set\+\_\+first\+\_\+unset\+\_\+bit} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bm, int $\ast$position)
\begin{DoxyCompactList}\small\item\em Find the first clear bit in the bitmap and set it. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_a07dd8455cb6f3b54df3dae45c3058ade}{opal\+\_\+bitmap\+\_\+clear\+\_\+all\+\_\+bits} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bm)
\begin{DoxyCompactList}\small\item\em Clear all bits in the bitmap. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_a9cd778b40b27c689b3e824d39d51ede7}{opal\+\_\+bitmap\+\_\+set\+\_\+all\+\_\+bits} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bm)
\begin{DoxyCompactList}\small\item\em Set all bits in the bitmap. \end{DoxyCompactList}\item 
static int \hyperlink{opal__bitmap_8h_ab8420fd23edf0d8611820601f3dc1300}{opal\+\_\+bitmap\+\_\+size} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bm)
\begin{DoxyCompactList}\small\item\em Gives the current size (number of bits) in the bitmap. \end{DoxyCompactList}\item 
static void \hyperlink{opal__bitmap_8h_afac91eada8ce90adf2946614706bf608}{opal\+\_\+bitmap\+\_\+copy} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$dest, \hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$src)
\begin{DoxyCompactList}\small\item\em Copy a bitmap. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_a44f66773109ceaf7e58227ccfd9eae0c}{opal\+\_\+bitmap\+\_\+bitwise\+\_\+and\+\_\+inplace} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$dest, \hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$right)
\begin{DoxyCompactList}\small\item\em Bitwise A\+N\+D operator (inplace) \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_a0bd3c402c7de2de335eb0d2f901e56a5}{opal\+\_\+bitmap\+\_\+bitwise\+\_\+or\+\_\+inplace} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$dest, \hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$right)
\begin{DoxyCompactList}\small\item\em Bitwise O\+R operator (inplace) \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_aee2873666325105633a23cdb66284de8}{opal\+\_\+bitmap\+\_\+bitwise\+\_\+xor\+\_\+inplace} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$dest, \hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$right)
\begin{DoxyCompactList}\small\item\em Bitwise X\+O\+R operator (inplace) \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C bool \hyperlink{opal__bitmap_8h_a2fc699bb9dffcc89098cd30896b4d8c2}{opal\+\_\+bitmap\+\_\+are\+\_\+different} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$left, \hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$right)
\begin{DoxyCompactList}\small\item\em If the bitmaps are different. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char $\ast$ \hyperlink{opal__bitmap_8h_a99c9ba0d958d88b64ea75ab7c00d0ac0}{opal\+\_\+bitmap\+\_\+get\+\_\+string} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bitmap)
\begin{DoxyCompactList}\small\item\em Get a string representation of the bitmap. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_a4155a5eca450e030763893b502913d67}{opal\+\_\+bitmap\+\_\+num\+\_\+unset\+\_\+bits} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bm, int len)
\begin{DoxyCompactList}\small\item\em Return the number of 'unset' bits, upto the specified length. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__bitmap_8h_a4b75ca2af1c74aef29ba76b85c6c5d35}{opal\+\_\+bitmap\+\_\+num\+\_\+set\+\_\+bits} (\hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$bm, int len)
\begin{DoxyCompactList}\small\item\em Return the number of 'set' bits, upto the specified length. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A bitmap implementation. 

The bits start off with 0, so this bitmap has bits numbered as bit 0, bit 1, bit 2 and so on. This bitmap has auto-\/expansion capabilities, that is once the size is set during init, it can be automatically expanded by setting the bit beyond the current size. But note, this is allowed just when the bit is set -- so the valid functions are set\+\_\+bit and find\+\_\+and\+\_\+set\+\_\+bit. Other functions like clear, if passed a bit outside the initialized range will result in an error.

To allow these bitmaps to track fortran handles (which M\+P\+I defines to be Fortran I\+N\+T\+E\+G\+E\+R), we offer a opal\+\_\+bitmap\+\_\+set\+\_\+max\+\_\+size, so that the upper layer can ask to never have more than O\+M\+P\+I\+\_\+\+F\+O\+R\+T\+R\+A\+N\+\_\+\+H\+A\+N\+D\+L\+E\+\_\+\+M\+A\+X, which is min(\+I\+N\+T\+\_\+\+M\+A\+X, fortran I\+N\+T\+E\+G\+E\+R max). Currently the only user of this is \hyperlink{attribute_8c}{ompi/attribute/attribute.\+c} 

\subsection{Function Documentation}
\hypertarget{opal__bitmap_8h_a2fc699bb9dffcc89098cd30896b4d8c2}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+are\+\_\+different@{opal\+\_\+bitmap\+\_\+are\+\_\+different}}
\index{opal\+\_\+bitmap\+\_\+are\+\_\+different@{opal\+\_\+bitmap\+\_\+are\+\_\+different}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+are\+\_\+different}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C bool opal\+\_\+bitmap\+\_\+are\+\_\+different (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{left, }
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{right}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a2fc699bb9dffcc89098cd30896b4d8c2}


If the bitmaps are different. 


\begin{DoxyParams}{Parameters}
{\em left} & Pointer to a bitmap \\
\hline
{\em right} & Pointer to another bitmap \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if different, false if the same 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, opal\+\_\+bitmap\+\_\+t\+::bitmap, and opal\+\_\+bitmap\+\_\+size().

\hypertarget{opal__bitmap_8h_a44f66773109ceaf7e58227ccfd9eae0c}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+bitwise\+\_\+and\+\_\+inplace@{opal\+\_\+bitmap\+\_\+bitwise\+\_\+and\+\_\+inplace}}
\index{opal\+\_\+bitmap\+\_\+bitwise\+\_\+and\+\_\+inplace@{opal\+\_\+bitmap\+\_\+bitwise\+\_\+and\+\_\+inplace}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+bitwise\+\_\+and\+\_\+inplace}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+bitwise\+\_\+and\+\_\+inplace (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{dest, }
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{right}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a44f66773109ceaf7e58227ccfd9eae0c}


Bitwise A\+N\+D operator (inplace) 


\begin{DoxyParams}{Parameters}
{\em dest} & Pointer to the bitmap that should be modified \\
\hline
{\em right} & Point to the other bitmap in the operation \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L error code if the length of the two bitmaps is not equal or one is N\+U\+L\+L. 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, and opal\+\_\+bitmap\+\_\+t\+::bitmap.

\hypertarget{opal__bitmap_8h_a0bd3c402c7de2de335eb0d2f901e56a5}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+bitwise\+\_\+or\+\_\+inplace@{opal\+\_\+bitmap\+\_\+bitwise\+\_\+or\+\_\+inplace}}
\index{opal\+\_\+bitmap\+\_\+bitwise\+\_\+or\+\_\+inplace@{opal\+\_\+bitmap\+\_\+bitwise\+\_\+or\+\_\+inplace}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+bitwise\+\_\+or\+\_\+inplace}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+bitwise\+\_\+or\+\_\+inplace (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{dest, }
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{right}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a0bd3c402c7de2de335eb0d2f901e56a5}


Bitwise O\+R operator (inplace) 


\begin{DoxyParams}{Parameters}
{\em dest} & Pointer to the bitmap that should be modified \\
\hline
{\em right} & Point to the other bitmap in the operation \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L error code if the length of the two bitmaps is not equal or one is N\+U\+L\+L. 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, and opal\+\_\+bitmap\+\_\+t\+::bitmap.

\hypertarget{opal__bitmap_8h_aee2873666325105633a23cdb66284de8}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+bitwise\+\_\+xor\+\_\+inplace@{opal\+\_\+bitmap\+\_\+bitwise\+\_\+xor\+\_\+inplace}}
\index{opal\+\_\+bitmap\+\_\+bitwise\+\_\+xor\+\_\+inplace@{opal\+\_\+bitmap\+\_\+bitwise\+\_\+xor\+\_\+inplace}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+bitwise\+\_\+xor\+\_\+inplace}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+bitwise\+\_\+xor\+\_\+inplace (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{dest, }
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{right}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_aee2873666325105633a23cdb66284de8}


Bitwise X\+O\+R operator (inplace) 


\begin{DoxyParams}{Parameters}
{\em dest} & Pointer to the bitmap that should be modified \\
\hline
{\em right} & Point to the other bitmap in the operation \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L error code if the length of the two bitmaps is not equal or one is N\+U\+L\+L. 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, and opal\+\_\+bitmap\+\_\+t\+::bitmap.

\hypertarget{opal__bitmap_8h_a07dd8455cb6f3b54df3dae45c3058ade}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+clear\+\_\+all\+\_\+bits@{opal\+\_\+bitmap\+\_\+clear\+\_\+all\+\_\+bits}}
\index{opal\+\_\+bitmap\+\_\+clear\+\_\+all\+\_\+bits@{opal\+\_\+bitmap\+\_\+clear\+\_\+all\+\_\+bits}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+clear\+\_\+all\+\_\+bits}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+clear\+\_\+all\+\_\+bits (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bm}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a07dd8455cb6f3b54df3dae45c3058ade}


Clear all bits in the bitmap. 


\begin{DoxyParams}{Parameters}
{\em bitmap} & The input bitmap (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L error code if bm is N\+U\+L\+L 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, and opal\+\_\+bitmap\+\_\+t\+::bitmap.



Referenced by opal\+\_\+bitmap\+\_\+init().

\hypertarget{opal__bitmap_8h_afd189ce9320c6682afe665be3b79ae3f}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+clear\+\_\+bit@{opal\+\_\+bitmap\+\_\+clear\+\_\+bit}}
\index{opal\+\_\+bitmap\+\_\+clear\+\_\+bit@{opal\+\_\+bitmap\+\_\+clear\+\_\+bit}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+clear\+\_\+bit}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+clear\+\_\+bit (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bm, }
\item[{int}]{bit}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_afd189ce9320c6682afe665be3b79ae3f}


Clear/unset a bit of the bitmap. 

If the bit is beyond the current size of the bitmap, an error is returned


\begin{DoxyParams}{Parameters}
{\em bitmap} & The input bitmap (I\+N) \\
\hline
{\em bit} & The bit which is to be cleared (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L error code if the bit is out of range, else success 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, and opal\+\_\+bitmap\+\_\+t\+::bitmap.

\hypertarget{opal__bitmap_8h_afac91eada8ce90adf2946614706bf608}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+copy@{opal\+\_\+bitmap\+\_\+copy}}
\index{opal\+\_\+bitmap\+\_\+copy@{opal\+\_\+bitmap\+\_\+copy}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+copy}]{\setlength{\rightskip}{0pt plus 5cm}static void opal\+\_\+bitmap\+\_\+copy (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{dest, }
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{src}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{opal__bitmap_8h_afac91eada8ce90adf2946614706bf608}


Copy a bitmap. 


\begin{DoxyParams}{Parameters}
{\em dest} & Pointer to the destination bitmap \\
\hline
{\em src} & Pointer to the source bitmap @ return O\+P\+A\+L error code if something goes wrong \\
\hline
\end{DoxyParams}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, and opal\+\_\+bitmap\+\_\+t\+::bitmap.

\hypertarget{opal__bitmap_8h_a0f77c8302095dc04724734d40a71e826}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+find\+\_\+and\+\_\+set\+\_\+first\+\_\+unset\+\_\+bit@{opal\+\_\+bitmap\+\_\+find\+\_\+and\+\_\+set\+\_\+first\+\_\+unset\+\_\+bit}}
\index{opal\+\_\+bitmap\+\_\+find\+\_\+and\+\_\+set\+\_\+first\+\_\+unset\+\_\+bit@{opal\+\_\+bitmap\+\_\+find\+\_\+and\+\_\+set\+\_\+first\+\_\+unset\+\_\+bit}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+find\+\_\+and\+\_\+set\+\_\+first\+\_\+unset\+\_\+bit}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+find\+\_\+and\+\_\+set\+\_\+first\+\_\+unset\+\_\+bit (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bm, }
\item[{int $\ast$}]{position}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a0f77c8302095dc04724734d40a71e826}


Find the first clear bit in the bitmap and set it. 


\begin{DoxyParams}{Parameters}
{\em bitmap} & The input bitmap (I\+N) \\
\hline
{\em position} & Position of the first clear bit (O\+U\+T)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
err O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S on success 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, opal\+\_\+bitmap\+\_\+t\+::bitmap, and opal\+\_\+bitmap\+\_\+set\+\_\+bit().

\hypertarget{opal__bitmap_8h_a99c9ba0d958d88b64ea75ab7c00d0ac0}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+get\+\_\+string@{opal\+\_\+bitmap\+\_\+get\+\_\+string}}
\index{opal\+\_\+bitmap\+\_\+get\+\_\+string@{opal\+\_\+bitmap\+\_\+get\+\_\+string}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+get\+\_\+string}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char$\ast$ opal\+\_\+bitmap\+\_\+get\+\_\+string (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bitmap}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a99c9ba0d958d88b64ea75ab7c00d0ac0}


Get a string representation of the bitmap. 

Useful for debugging.


\begin{DoxyParams}{Parameters}
{\em bitmap} & Point to the bitmap to represent \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Pointer to the string (caller must free if not N\+U\+L\+L) 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, and opal\+\_\+bitmap\+\_\+is\+\_\+set\+\_\+bit().

\hypertarget{opal__bitmap_8h_a46098570f053ec3f4a362a02cb3514c5}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+init@{opal\+\_\+bitmap\+\_\+init}}
\index{opal\+\_\+bitmap\+\_\+init@{opal\+\_\+bitmap\+\_\+init}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+init}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+init (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bm, }
\item[{int}]{size}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a46098570f053ec3f4a362a02cb3514c5}


Initializes the bitmap and sets its size. 

This must be called before the bitmap can be actually used


\begin{DoxyParams}{Parameters}
{\em bitmap} & The input bitmap (I\+N) \\
\hline
{\em size} & The initial size of the bitmap in terms of bits (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L error code or success 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, opal\+\_\+bitmap\+\_\+t\+::bitmap, opal\+\_\+bitmap\+\_\+t\+::max\+\_\+size, and opal\+\_\+bitmap\+\_\+clear\+\_\+all\+\_\+bits().



Referenced by ompi\+\_\+attr\+\_\+init().

\hypertarget{opal__bitmap_8h_a102c4a78b6028d1a9dc90dc076e3b9fb}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+is\+\_\+set\+\_\+bit@{opal\+\_\+bitmap\+\_\+is\+\_\+set\+\_\+bit}}
\index{opal\+\_\+bitmap\+\_\+is\+\_\+set\+\_\+bit@{opal\+\_\+bitmap\+\_\+is\+\_\+set\+\_\+bit}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+is\+\_\+set\+\_\+bit}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C bool opal\+\_\+bitmap\+\_\+is\+\_\+set\+\_\+bit (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bm, }
\item[{int}]{bit}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a102c4a78b6028d1a9dc90dc076e3b9fb}


Find out if a bit is set in the bitmap. 


\begin{DoxyParams}{Parameters}
{\em bitmap} & The input bitmap (I\+N) \\
\hline
{\em bit} & The bit which is to be checked (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the bit is set false if the bit is not set O\+R the index is outside the bounds of the provided bitmap 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, and opal\+\_\+bitmap\+\_\+t\+::bitmap.



Referenced by opal\+\_\+bitmap\+\_\+get\+\_\+string().

\hypertarget{opal__bitmap_8h_a4b75ca2af1c74aef29ba76b85c6c5d35}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+num\+\_\+set\+\_\+bits@{opal\+\_\+bitmap\+\_\+num\+\_\+set\+\_\+bits}}
\index{opal\+\_\+bitmap\+\_\+num\+\_\+set\+\_\+bits@{opal\+\_\+bitmap\+\_\+num\+\_\+set\+\_\+bits}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+num\+\_\+set\+\_\+bits}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+num\+\_\+set\+\_\+bits (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bm, }
\item[{int}]{len}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a4b75ca2af1c74aef29ba76b85c6c5d35}


Return the number of 'set' bits, upto the specified length. 


\begin{DoxyParams}{Parameters}
{\em bitmap} & Pointer to the bitmap \\
\hline
{\em len} & Number of bits to check \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Integer 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, and opal\+\_\+bitmap\+\_\+t\+::bitmap.



Referenced by opal\+\_\+bitmap\+\_\+num\+\_\+unset\+\_\+bits().

\hypertarget{opal__bitmap_8h_a4155a5eca450e030763893b502913d67}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+num\+\_\+unset\+\_\+bits@{opal\+\_\+bitmap\+\_\+num\+\_\+unset\+\_\+bits}}
\index{opal\+\_\+bitmap\+\_\+num\+\_\+unset\+\_\+bits@{opal\+\_\+bitmap\+\_\+num\+\_\+unset\+\_\+bits}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+num\+\_\+unset\+\_\+bits}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+num\+\_\+unset\+\_\+bits (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bm, }
\item[{int}]{len}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a4155a5eca450e030763893b502913d67}


Return the number of 'unset' bits, upto the specified length. 


\begin{DoxyParams}{Parameters}
{\em bitmap} & Pointer to the bitmap \\
\hline
{\em len} & Number of bits to check \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Integer 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+num\+\_\+set\+\_\+bits().

\hypertarget{opal__bitmap_8h_a9cd778b40b27c689b3e824d39d51ede7}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+set\+\_\+all\+\_\+bits@{opal\+\_\+bitmap\+\_\+set\+\_\+all\+\_\+bits}}
\index{opal\+\_\+bitmap\+\_\+set\+\_\+all\+\_\+bits@{opal\+\_\+bitmap\+\_\+set\+\_\+all\+\_\+bits}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+set\+\_\+all\+\_\+bits}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+set\+\_\+all\+\_\+bits (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bm}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a9cd778b40b27c689b3e824d39d51ede7}


Set all bits in the bitmap. 


\begin{DoxyParams}{Parameters}
{\em bitmap} & The input bitmap (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L error code if bm is N\+U\+L\+L 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, and opal\+\_\+bitmap\+\_\+t\+::bitmap.

\hypertarget{opal__bitmap_8h_a421adc7aa9cf6907ed19598bae8d5f63}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+set\+\_\+bit@{opal\+\_\+bitmap\+\_\+set\+\_\+bit}}
\index{opal\+\_\+bitmap\+\_\+set\+\_\+bit@{opal\+\_\+bitmap\+\_\+set\+\_\+bit}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+set\+\_\+bit}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+set\+\_\+bit (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bm, }
\item[{int}]{bit}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_a421adc7aa9cf6907ed19598bae8d5f63}


Set a bit of the bitmap. 

If the bit asked for is beyond the current size of the bitmap, then the bitmap is extended to accomodate the bit


\begin{DoxyParams}{Parameters}
{\em bitmap} & The input bitmap (I\+N) \\
\hline
{\em bit} & The bit which is to be set (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L error code or success 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size, opal\+\_\+bitmap\+\_\+t\+::bitmap, and opal\+\_\+bitmap\+\_\+t\+::max\+\_\+size.



Referenced by mca\+\_\+btl\+\_\+gm\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+mx\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+sctp\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+self\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+sm\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+smcuda\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+tcp\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+template\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+ud\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+udapl\+\_\+add\+\_\+procs(), and opal\+\_\+bitmap\+\_\+find\+\_\+and\+\_\+set\+\_\+first\+\_\+unset\+\_\+bit().

\hypertarget{opal__bitmap_8h_aa8b7fd9d3f04e12e1b9dcad5b46f42be}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+set\+\_\+max\+\_\+size@{opal\+\_\+bitmap\+\_\+set\+\_\+max\+\_\+size}}
\index{opal\+\_\+bitmap\+\_\+set\+\_\+max\+\_\+size@{opal\+\_\+bitmap\+\_\+set\+\_\+max\+\_\+size}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+set\+\_\+max\+\_\+size}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+bitmap\+\_\+set\+\_\+max\+\_\+size (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bm, }
\item[{int}]{max\+\_\+size}
\end{DoxyParamCaption}
)}}\label{opal__bitmap_8h_aa8b7fd9d3f04e12e1b9dcad5b46f42be}


Set the maximum size of the bitmap. 

May be reset any time, but H\+A\+S T\+O B\+E S\+E\+T B\+E\+F\+O\+R\+E opal\+\_\+bitmap\+\_\+init!


\begin{DoxyParams}{Parameters}
{\em bitmap} & The input bitmap (I\+N) \\
\hline
{\em max\+\_\+size} & The maximum size of the bitmap in terms of bits (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L error code or success 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::max\+\_\+size.



Referenced by ompi\+\_\+attr\+\_\+init().

\hypertarget{opal__bitmap_8h_ab8420fd23edf0d8611820601f3dc1300}{\index{opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}!opal\+\_\+bitmap\+\_\+size@{opal\+\_\+bitmap\+\_\+size}}
\index{opal\+\_\+bitmap\+\_\+size@{opal\+\_\+bitmap\+\_\+size}!opal\+\_\+bitmap.\+h@{opal\+\_\+bitmap.\+h}}
\subsubsection[{opal\+\_\+bitmap\+\_\+size}]{\setlength{\rightskip}{0pt plus 5cm}static int opal\+\_\+bitmap\+\_\+size (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+bitmap\+\_\+t} $\ast$}]{bm}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{opal__bitmap_8h_ab8420fd23edf0d8611820601f3dc1300}


Gives the current size (number of bits) in the bitmap. 

This is the legal (accessible) number of bits


\begin{DoxyParams}{Parameters}
{\em bitmap} & The input bitmap (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L error code if bm is N\+U\+L\+L 
\end{DoxyReturn}


References opal\+\_\+bitmap\+\_\+t\+::array\+\_\+size.



Referenced by opal\+\_\+bitmap\+\_\+are\+\_\+different().

