\hypertarget{ompi_2mca_2coll_2base_2base_8h}{\section{ompi/mca/coll/base/base.h File Reference}
\label{ompi_2mca_2coll_2base_2base_8h}\index{ompi/mca/coll/base/base.\+h@{ompi/mca/coll/base/base.\+h}}
}


M\+C\+A coll base framework public interface functions.  


{\ttfamily \#include \char`\"{}ompi\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}mpi.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/class/opal\+\_\+list.\+h\char`\"{}}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{ompi_2mca_2coll_2base_2base_8h_aaa9238dfd016d15bf70dccb410633c2f}{mca\+\_\+coll\+\_\+base\+\_\+open} (void)
\begin{DoxyCompactList}\small\item\em Initialize the coll M\+C\+A framework. \end{DoxyCompactList}\item 
int \hyperlink{ompi_2mca_2coll_2base_2base_8h_a479ec44eba428a8506a82d60262060d7}{mca\+\_\+coll\+\_\+base\+\_\+find\+\_\+available} (bool enable\+\_\+progress\+\_\+threads, bool enable\+\_\+mpi\+\_\+threads)
\begin{DoxyCompactList}\small\item\em Create list of available coll components. \end{DoxyCompactList}\item 
int \hyperlink{ompi_2mca_2coll_2base_2base_8h_af68d3e57646d558f68050d82d4415a9c}{mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+select} (struct \hyperlink{structompi__communicator__t}{ompi\+\_\+communicator\+\_\+t} $\ast$comm)
\begin{DoxyCompactList}\small\item\em Select an available component for a new communicator. \end{DoxyCompactList}\item 
int \hyperlink{ompi_2mca_2coll_2base_2base_8h_a0769136448b1d7c2b7d6b5cca4fc6e45}{mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+unselect} (struct \hyperlink{structompi__communicator__t}{ompi\+\_\+communicator\+\_\+t} $\ast$comm)
\begin{DoxyCompactList}\small\item\em Finalize a coll component on a specific communicator. \end{DoxyCompactList}\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{ompi_2mca_2coll_2base_2base_8h_ac04f9a0ce772b87f0c897e01c90d7450}{mca\+\_\+coll\+\_\+base\+\_\+close} (void)
\begin{DoxyCompactList}\small\item\em Shut down the coll M\+C\+A framework. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\hypertarget{ompi_2mca_2coll_2base_2base_8h_a7751e973b1ad5d4921b5e51e5387cc0a}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{ompi_2mca_2coll_2base_2base_8h_a7751e973b1ad5d4921b5e51e5387cc0a}{mca\+\_\+coll\+\_\+base\+\_\+output}}\label{ompi_2mca_2coll_2base_2base_8h_a7751e973b1ad5d4921b5e51e5387cc0a}

\begin{DoxyCompactList}\small\item\em Coll framework debugging stream I\+D used with \hyperlink{output_8h_a3405da348d8cc528b921c8a1d8302be7}{opal\+\_\+output()} and \hyperlink{output_8h_a0864d696ef030700e849021731a358e0}{opal\+\_\+output\+\_\+verbose()}. \end{DoxyCompactList}\item 
\hypertarget{ompi_2mca_2coll_2base_2base_8h_ac396bb90031f7a5c181319c70e71a39f}{bool \hyperlink{ompi_2mca_2coll_2base_2base_8h_ac396bb90031f7a5c181319c70e71a39f}{mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+opened\+\_\+valid}}\label{ompi_2mca_2coll_2base_2base_8h_ac396bb90031f7a5c181319c70e71a39f}

\begin{DoxyCompactList}\small\item\em Indicator as to whether the list of opened coll components is valid or not. \end{DoxyCompactList}\item 
\hypertarget{ompi_2mca_2coll_2base_2base_8h_a066ddfe604af77e0a116315e76fe8471}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structopal__list__t}{opal\+\_\+list\+\_\+t} \hyperlink{ompi_2mca_2coll_2base_2base_8h_a066ddfe604af77e0a116315e76fe8471}{mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+opened}}\label{ompi_2mca_2coll_2base_2base_8h_a066ddfe604af77e0a116315e76fe8471}

\begin{DoxyCompactList}\small\item\em List of all opened components; created when the coll framework is initialized and destroyed when we reduce the list to all available coll components. \end{DoxyCompactList}\item 
\hypertarget{ompi_2mca_2coll_2base_2base_8h_aa374a410c0be6ef6f29dce307ac1e735}{bool \hyperlink{ompi_2mca_2coll_2base_2base_8h_aa374a410c0be6ef6f29dce307ac1e735}{mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+available\+\_\+valid}}\label{ompi_2mca_2coll_2base_2base_8h_aa374a410c0be6ef6f29dce307ac1e735}

\begin{DoxyCompactList}\small\item\em Indicator as to whether the list of available coll components is valid or not. \end{DoxyCompactList}\item 
\hypertarget{ompi_2mca_2coll_2base_2base_8h_a5e0b543deb7914234a3630f2132155ba}{\hyperlink{structopal__list__t}{opal\+\_\+list\+\_\+t} \hyperlink{ompi_2mca_2coll_2base_2base_8h_a5e0b543deb7914234a3630f2132155ba}{mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+available}}\label{ompi_2mca_2coll_2base_2base_8h_a5e0b543deb7914234a3630f2132155ba}

\begin{DoxyCompactList}\small\item\em List of all available components; created by reducing the list of open components to all those who indicate that they may run during this process. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
M\+C\+A coll base framework public interface functions. 

These functions are normally invoked by the back-\/ends of\+:


\begin{DoxyItemize}
\item The back-\/ends of M\+P\+I\+\_\+\+Init() and M\+P\+I\+\_\+\+Finalize()
\item Communuicactor constructors (e.\+g., M\+P\+I\+\_\+\+Comm\+\_\+split()) and destructors (e.\+g., M\+P\+I\+\_\+\+Comm\+\_\+free())
\item The laminfo command 
\end{DoxyItemize}

\subsection{Function Documentation}
\hypertarget{ompi_2mca_2coll_2base_2base_8h_ac04f9a0ce772b87f0c897e01c90d7450}{\index{ompi/mca/coll/base/base.\+h@{ompi/mca/coll/base/base.\+h}!mca\+\_\+coll\+\_\+base\+\_\+close@{mca\+\_\+coll\+\_\+base\+\_\+close}}
\index{mca\+\_\+coll\+\_\+base\+\_\+close@{mca\+\_\+coll\+\_\+base\+\_\+close}!ompi/mca/coll/base/base.\+h@{ompi/mca/coll/base/base.\+h}}
\subsubsection[{mca\+\_\+coll\+\_\+base\+\_\+close}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int mca\+\_\+coll\+\_\+base\+\_\+close (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{ompi_2mca_2coll_2base_2base_8h_ac04f9a0ce772b87f0c897e01c90d7450}


Shut down the coll M\+C\+A framework. 


\begin{DoxyRetVals}{Return values}
{\em O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S} & Always\\
\hline
\end{DoxyRetVals}
This function shuts down everything in the coll M\+C\+A framework, and is called during \hyperlink{mpiruntime_8h_a657cd1789f5cbe7dbb711f6c836398e6}{ompi\+\_\+mpi\+\_\+finalize()} and the special case of the laminfo command.

It must be the last function invoked on the coll M\+C\+A framework. 

References mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+available, mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+available\+\_\+valid, mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+opened, mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+opened\+\_\+valid, mca\+\_\+coll\+\_\+base\+\_\+output, and O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T.



Referenced by ompi\+\_\+mpi\+\_\+finalize().

\hypertarget{ompi_2mca_2coll_2base_2base_8h_af68d3e57646d558f68050d82d4415a9c}{\index{ompi/mca/coll/base/base.\+h@{ompi/mca/coll/base/base.\+h}!mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+select@{mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+select}}
\index{mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+select@{mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+select}!ompi/mca/coll/base/base.\+h@{ompi/mca/coll/base/base.\+h}}
\subsubsection[{mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+select}]{\setlength{\rightskip}{0pt plus 5cm}int mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+select (
\begin{DoxyParamCaption}
\item[{struct {\bf ompi\+\_\+communicator\+\_\+t} $\ast$}]{comm}
\end{DoxyParamCaption}
)}}\label{ompi_2mca_2coll_2base_2base_8h_af68d3e57646d558f68050d82d4415a9c}


Select an available component for a new communicator. 


\begin{DoxyParams}{Parameters}
{\em comm} & Communicator that the component will be selected for. \\
\hline
{\em preferred} & The component that is preferred for this communicator (or N\+U\+L\+L).\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S Upon success. 

O\+M\+P\+I\+\_\+\+E\+R\+R\+O\+R Upon failure.
\end{DoxyReturn}
Note that the types of the parameters have \char`\"{}struct\char`\"{} in them (e.\+g., \hyperlink{structompi__communicator__t}{ompi\+\_\+communicator\+\_\+t}\char`\"{} vs. a plain \char`\"{}\hyperlink{structompi__communicator__t}{ompi\+\_\+communicator\+\_\+t}\char`\"{}) to
avoid an include file loop.  All similar types (e.\+g., \char`\"{}struct \hyperlink{structompi__communicator__t}{ompi\+\_\+communicator\+\_\+t} $\ast$\char`\"{}, \char`\"{}\hyperlink{structompi__communicator__t}{ompi\+\_\+communicator\+\_\+t} $\ast$\char`\"{}, and \char`\"{}M\+P\+I\+\_\+\+Comm") are all typedef'ed to be the same, so the fact that we use struct here in the prototype is ok.

This function is invoked when a new communicator is created and a coll component needs to be selected for it. It should be invoked near the end of the communicator creation process such that almost everything else is functional on the communicator (e.\+g., point-\/to-\/point communication).

Note that new communicators may be created as a result of invoking this function. Specifically\+: this function is called in the depths of communicator creation, but during the execution of this function, new communicators may be created, and therefore communicator creation functions may be re-\/entered (albiet with different arguments). 

References mca\+\_\+coll\+\_\+base\+\_\+module\+\_\+2\+\_\+0\+\_\+0\+\_\+t\+::coll\+\_\+module\+\_\+enable, mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+unselect(), mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+available, mca\+\_\+coll\+\_\+base\+\_\+output, O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E, opal\+\_\+list\+\_\+remove\+\_\+first(), opal\+\_\+output\+\_\+verbose(), and orte\+\_\+show\+\_\+help().



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

\hypertarget{ompi_2mca_2coll_2base_2base_8h_a0769136448b1d7c2b7d6b5cca4fc6e45}{\index{ompi/mca/coll/base/base.\+h@{ompi/mca/coll/base/base.\+h}!mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+unselect@{mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+unselect}}
\index{mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+unselect@{mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+unselect}!ompi/mca/coll/base/base.\+h@{ompi/mca/coll/base/base.\+h}}
\subsubsection[{mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+unselect}]{\setlength{\rightskip}{0pt plus 5cm}int mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+unselect (
\begin{DoxyParamCaption}
\item[{struct {\bf ompi\+\_\+communicator\+\_\+t} $\ast$}]{comm}
\end{DoxyParamCaption}
)}}\label{ompi_2mca_2coll_2base_2base_8h_a0769136448b1d7c2b7d6b5cca4fc6e45}


Finalize a coll component on a specific communicator. 


\begin{DoxyParams}{Parameters}
{\em comm} & The communicator that is being destroyed.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S} & Always.\\
\hline
\end{DoxyRetVals}
Note that the type of the parameter is only a \char`\"{}struct
ompi\+\_\+communicator\+\_\+t\char`\"{} (vs. a plain \char`\"{}ompi\+\_\+communicator\+\_\+t\char`\"{}) to avoid an include file loop. The types \char`\"{}struct ompi\+\_\+communicator\+\_\+t $\ast$\char`\"{}, \char`\"{}ompi\+\_\+communicator\+\_\+t $\ast$\char`\"{}, and \char`\"{}\+M\+P\+I\+\_\+\+Comm\char`\"{} are all typedef'ed to be the same, so the fact that we use struct here in the prototype is ok.

This function is invoked near the beginning of the destruction of a communicator. It finalizes the coll component associated with the communicator (e.\+g., allowing the component to clean up and free any resources allocated for that communicator). Note that similar to mca\+\_\+coll\+\_\+base\+\_\+select(), as result of this function, other communicators may also be destroyed. 

Referenced by mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+select().

\hypertarget{ompi_2mca_2coll_2base_2base_8h_a479ec44eba428a8506a82d60262060d7}{\index{ompi/mca/coll/base/base.\+h@{ompi/mca/coll/base/base.\+h}!mca\+\_\+coll\+\_\+base\+\_\+find\+\_\+available@{mca\+\_\+coll\+\_\+base\+\_\+find\+\_\+available}}
\index{mca\+\_\+coll\+\_\+base\+\_\+find\+\_\+available@{mca\+\_\+coll\+\_\+base\+\_\+find\+\_\+available}!ompi/mca/coll/base/base.\+h@{ompi/mca/coll/base/base.\+h}}
\subsubsection[{mca\+\_\+coll\+\_\+base\+\_\+find\+\_\+available}]{\setlength{\rightskip}{0pt plus 5cm}int mca\+\_\+coll\+\_\+base\+\_\+find\+\_\+available (
\begin{DoxyParamCaption}
\item[{bool}]{enable\+\_\+progress\+\_\+threads, }
\item[{bool}]{enable\+\_\+mpi\+\_\+threads}
\end{DoxyParamCaption}
)}}\label{ompi_2mca_2coll_2base_2base_8h_a479ec44eba428a8506a82d60262060d7}


Create list of available coll components. 


\begin{DoxyParams}{Parameters}
{\em allow\+\_\+multi\+\_\+user\+\_\+threads} & Will be set to true if any of the available components will allow multiple user threads \\
\hline
{\em have\+\_\+hidden\+\_\+threads} & Will be set to true if any of the available components have hidden threads.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S} & If one or more coll components are available. \\
\hline
{\em O\+M\+P\+I\+\_\+\+E\+R\+R\+O\+R} & If no coll components are found to be available.\\
\hline
\end{DoxyRetVals}
This function is invoked during \hyperlink{mpiruntime_8h_a6352a08abfa7bd8a402a866ecebec0f3}{ompi\+\_\+mpi\+\_\+init()} to query all successfully opened coll components and create a list of all available coll components.

This function traverses the (internal global variable) mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+opened list and queries each component to see if it ever might want to run during this M\+P\+I process. It creates another internal global variable list named mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+available, consisting of a list of components that are available for selection when communicators are created. This variable should {\itshape only} be used by other coll base functions -- it is not considered a public interface member -- and is only mentioned here for completeness. 

References mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+available\+\_\+valid, mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+opened, mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+opened\+\_\+valid, mca\+\_\+coll\+\_\+base\+\_\+output, O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T, O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T, O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E, opal\+\_\+list\+\_\+append, opal\+\_\+list\+\_\+remove\+\_\+first(), opal\+\_\+output\+\_\+verbose(), and orte\+\_\+show\+\_\+help().



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

\hypertarget{ompi_2mca_2coll_2base_2base_8h_aaa9238dfd016d15bf70dccb410633c2f}{\index{ompi/mca/coll/base/base.\+h@{ompi/mca/coll/base/base.\+h}!mca\+\_\+coll\+\_\+base\+\_\+open@{mca\+\_\+coll\+\_\+base\+\_\+open}}
\index{mca\+\_\+coll\+\_\+base\+\_\+open@{mca\+\_\+coll\+\_\+base\+\_\+open}!ompi/mca/coll/base/base.\+h@{ompi/mca/coll/base/base.\+h}}
\subsubsection[{mca\+\_\+coll\+\_\+base\+\_\+open}]{\setlength{\rightskip}{0pt plus 5cm}B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int mca\+\_\+coll\+\_\+base\+\_\+open (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{ompi_2mca_2coll_2base_2base_8h_aaa9238dfd016d15bf70dccb410633c2f}


Initialize the coll M\+C\+A framework. 


\begin{DoxyRetVals}{Return values}
{\em O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S} & Upon success \\
\hline
{\em O\+M\+P\+I\+\_\+\+E\+R\+R\+O\+R} & Upon failure\\
\hline
\end{DoxyRetVals}
This must be the first function invoked in the coll M\+C\+A framework. It initializes the coll M\+C\+A framework, finds and opens coll components, etc.

This function is invoked during \hyperlink{mpiruntime_8h_a6352a08abfa7bd8a402a866ecebec0f3}{ompi\+\_\+mpi\+\_\+init()} and during the initialization of the special case of the laminfo command.

This function fills in the internal global variable mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+opened, which is a list of all coll components that were successfully opened. This variable should {\itshape only} be used by other coll base functions -- it is not considered a public interface member -- and is only mentioned here for completeness. 

References mca\+\_\+coll\+\_\+base\+\_\+components\+\_\+opened\+\_\+valid, mca\+\_\+coll\+\_\+base\+\_\+output, and opal\+\_\+output\+\_\+open().



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

