\hypertarget{openib_2connect_2connect_8h}{\section{ompi/mca/btl/openib/connect/connect.h File Reference}
\label{openib_2connect_2connect_8h}\index{ompi/mca/btl/openib/connect/connect.\+h@{ompi/mca/btl/openib/connect/connect.\+h}}
}


This interface is designed to hide the back-\/end details of how I\+B R\+C connections are made from the rest of the openib B\+T\+L.  


\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structompi__btl__openib__connect__base__component__t}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+t}
\begin{DoxyCompactList}\small\item\em C\+P\+C component struct. \end{DoxyCompactList}\item 
struct \hyperlink{structompi__btl__openib__connect__base__module__data__t}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+data\+\_\+t}
\begin{DoxyCompactList}\small\item\em Meta data about a C\+P\+C module. \end{DoxyCompactList}\item 
struct \hyperlink{structompi__btl__openib__connect__base__module__t}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+t}
\begin{DoxyCompactList}\small\item\em Struct for holding C\+P\+C module and associated meta data. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\hypertarget{openib_2connect_2connect_8h_a1b71a7863f11f7a640977ec88a805007}{\#define {\bfseries B\+C\+F\+\_\+\+M\+A\+X\+\_\+\+N\+A\+M\+E}~64}\label{openib_2connect_2connect_8h_a1b71a7863f11f7a640977ec88a805007}

\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef void($\ast$ \hyperlink{openib_2connect_2connect_8h_a2119c2f06528e13d708cdc7282c3aee8}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+register\+\_\+fn\+\_\+t} )(void)
\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} to register M\+C\+A params in the connect functions. \end{DoxyCompactList}\item 
typedef int($\ast$ \hyperlink{openib_2connect_2connect_8h_af90bb0d9b41d0ed3bcbe758ea3c024c7}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+init\+\_\+fn\+\_\+t} )(void)
\begin{DoxyCompactList}\small\item\em This function is invoked once by the openib B\+T\+L component during startup. \end{DoxyCompactList}\item 
typedef int($\ast$ \hyperlink{openib_2connect_2connect_8h_a98c5983f6b956603283885eba5a1f0f0}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+func\+\_\+component\+\_\+query\+\_\+t} )(struct \hyperlink{structmca__btl__openib__module__t}{mca\+\_\+btl\+\_\+openib\+\_\+module\+\_\+t} $\ast$btl, struct \hyperlink{structompi__btl__openib__connect__base__module__t}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+t} $\ast$$\ast$cpc)
\begin{DoxyCompactList}\small\item\em Query the C\+P\+C to see if it wants to run on a specific port (i.\+e., a specific B\+T\+L module). \end{DoxyCompactList}\item 
typedef int($\ast$ \hyperlink{openib_2connect_2connect_8h_a472866e56a459f324183621cc4762e88}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+finalize\+\_\+fn\+\_\+t} )(void)
\begin{DoxyCompactList}\small\item\em This function is invoked once by the openib B\+T\+L component during shutdown. \end{DoxyCompactList}\item 
\hypertarget{openib_2connect_2connect_8h_af479c627c8c5a88c3596e0274e0da42f}{typedef struct \\*
\hyperlink{structompi__btl__openib__connect__base__component__t}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+t} \hyperlink{openib_2connect_2connect_8h_af479c627c8c5a88c3596e0274e0da42f}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+t}}\label{openib_2connect_2connect_8h_af479c627c8c5a88c3596e0274e0da42f}

\begin{DoxyCompactList}\small\item\em Convenience typedef. \end{DoxyCompactList}\item 
\hypertarget{openib_2connect_2connect_8h_a2fe589c01c08ad38ec34cb777a35b917}{typedef int($\ast$ \hyperlink{openib_2connect_2connect_8h_a2fe589c01c08ad38ec34cb777a35b917}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+endpoint\+\_\+init\+\_\+fn\+\_\+t} )(struct \hyperlink{structmca__btl__base__endpoint__t}{mca\+\_\+btl\+\_\+base\+\_\+endpoint\+\_\+t} $\ast$endpoint)}\label{openib_2connect_2connect_8h_a2fe589c01c08ad38ec34cb777a35b917}

\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} called when an endpoint has been created and has been associated with a C\+P\+C. \end{DoxyCompactList}\item 
\hypertarget{openib_2connect_2connect_8h_a5262b084d963c395d4f7f6d90fc9d014}{typedef int($\ast$ \hyperlink{openib_2connect_2connect_8h_a5262b084d963c395d4f7f6d90fc9d014}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+start\+\_\+connect\+\_\+fn\+\_\+t} )(struct \hyperlink{structompi__btl__openib__connect__base__module__t}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+t} $\ast$cpc, struct \hyperlink{structmca__btl__base__endpoint__t}{mca\+\_\+btl\+\_\+base\+\_\+endpoint\+\_\+t} $\ast$endpoint)}\label{openib_2connect_2connect_8h_a5262b084d963c395d4f7f6d90fc9d014}

\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} to initiate a connection to a remote process. \end{DoxyCompactList}\item 
\hypertarget{openib_2connect_2connect_8h_a3d85dc889dd1963e42c9cb5db3c0dbe3}{typedef int($\ast$ \hyperlink{openib_2connect_2connect_8h_a3d85dc889dd1963e42c9cb5db3c0dbe3}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+endpoint\+\_\+finalize\+\_\+fn\+\_\+t} )(struct \hyperlink{structmca__btl__base__endpoint__t}{mca\+\_\+btl\+\_\+base\+\_\+endpoint\+\_\+t} $\ast$endpoint)}\label{openib_2connect_2connect_8h_a3d85dc889dd1963e42c9cb5db3c0dbe3}

\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} called when an endpoint is being destroyed. \end{DoxyCompactList}\item 
typedef int($\ast$ \hyperlink{openib_2connect_2connect_8h_addfb679c8e71e32bdaf3f1f993f8e89d}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t} )(struct \hyperlink{structmca__btl__openib__module__t}{mca\+\_\+btl\+\_\+openib\+\_\+module\+\_\+t} $\ast$btl, struct \hyperlink{structompi__btl__openib__connect__base__module__t}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+t} $\ast$cpc)
\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} to finalize the C\+P\+C module. \end{DoxyCompactList}\item 
typedef struct \\*
\hyperlink{structompi__btl__openib__connect__base__module__data__t}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+data\+\_\+t} \hyperlink{openib_2connect_2connect_8h_a69bd89265025150cc1058f811fb76d1d}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+data\+\_\+t}
\begin{DoxyCompactList}\small\item\em Meta data about a C\+P\+C module. \end{DoxyCompactList}\item 
\hypertarget{openib_2connect_2connect_8h_abb1d979711df54ea9d0fd35ee1b62836}{typedef struct \\*
\hyperlink{structompi__btl__openib__connect__base__module__t}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+t} \hyperlink{openib_2connect_2connect_8h_abb1d979711df54ea9d0fd35ee1b62836}{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+t}}\label{openib_2connect_2connect_8h_abb1d979711df54ea9d0fd35ee1b62836}

\begin{DoxyCompactList}\small\item\em Struct for holding C\+P\+C module and associated meta data. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This interface is designed to hide the back-\/end details of how I\+B R\+C connections are made from the rest of the openib B\+T\+L. 

There are module-\/like instances of the implemented functionality (dlopen and friends are not used, but all the functionality is accessed through struct's of function pointers, so you can swap between multiple different implementations at run time, just like real components). Hence, these entities are referred to as \char`\"{}\+Connect
\+Pseudo-\/\+Components\char`\"{} (C\+P\+Cs).

The C\+P\+Cs are referenced by their names (e.\+g., \char`\"{}oob\char`\"{}, \char`\"{}rdma\+\_\+cm\char`\"{}).

C\+P\+Cs are split into components and modules, similar to all other M\+C\+A frameworks in this code base.

Before diving into the C\+P\+C interface, let's discuss some terminology and mappings of data structures\+:


\begin{DoxyItemize}
\item a B\+T\+L module represents a network port (in the case of the openib B\+T\+L, a L\+I\+D)
\item a C\+P\+C module represents one way to make connections to a B\+T\+L module
\item hence, a B\+T\+L module has potentially multiple C\+P\+C modules associated with it
\item an endpoint represnts a connection between a local B\+T\+L module and a remote B\+T\+L module (in the openib B\+T\+L, because of B\+S\+R\+Q, an endpoint can contain multiple Q\+Ps)
\item when an endpoint is created, one of the C\+P\+C modules associated with the local B\+T\+L is selected and associated with the endpoint (obviously, it is a C\+P\+C module that is common between the local and remote B\+T\+L modules)
\item endpoints may be created and destroyed during the M\+P\+I job
\item endpoints are created lazily, during the first communication between two peers
\item endpoints are destroyed when two M\+P\+I processes become disconnected (e.\+g., M\+P\+I-\/2 dynamics or M\+P\+I\+\_\+\+F\+I\+N\+A\+L\+I\+Z\+E)
\item hence, B\+T\+L modules and C\+P\+C modules outlive endpoints. Specifically, B\+T\+L modules and C\+P\+C modules live from M\+P\+I\+\_\+\+I\+N\+I\+T to M\+P\+I\+\_\+\+F\+I\+N\+A\+L\+I\+Z\+E. endpoints come and go as M\+P\+I semantics demand it.
\item therefore, C\+P\+C modules need to cache information on endpoints that are specific to that connection.
\end{DoxyItemize}

Component interface\+:


\begin{DoxyItemize}
\item component\+\_\+register()\+: The openib B\+T\+L's component\+\_\+open() function calls the connect\+\_\+base\+\_\+register() function, which scans all compiled-\/in C\+P\+C's. If they have component\+\_\+register() functions, they are called (component\+\_\+register() functions are only allowed to register M\+C\+A parameters).
\end{DoxyItemize}

N\+O\+T\+E\+: The connect\+\_\+base\+\_\+register() function will process the btl\+\_\+openib\+\_\+cpc\+\_\+include and btl\+\_\+openib\+\_\+cpc\+\_\+exclude M\+C\+A parameters and automatically include/exclude C\+P\+Cs as relevant. If a C\+P\+C is excluded, none of its other interface functions will be invoked for the duration of the process.


\begin{DoxyItemize}
\item component\+\_\+init()\+: The openib B\+T\+L's component\+\_\+init() function calls connect\+\_\+base\+\_\+init(), which will invoke this query function on each C\+P\+C to see if it wants to run at all. C\+P\+Cs can gracefully remove themselves from consideration in this process by returning O\+M\+P\+I\+\_\+\+E\+R\+R\+\_\+\+N\+O\+T\+\_\+\+S\+U\+P\+P\+O\+R\+T\+E\+D.
\item component\+\_\+query()\+: The openib B\+T\+L's init\+\_\+one\+\_\+port() calls the connect\+\_\+base\+\_\+select\+\_\+for\+\_\+local\+\_\+port() function, which, for each L\+I\+D on that port, calls the component\+\_\+query() function on every available C\+P\+C on that L\+I\+D. This function is intended to see if a C\+P\+C can run on a sepcific openib B\+T\+L module (i.\+e., L\+I\+D). If it can, the C\+P\+C is supposed to create a C\+P\+C module that is specific to that B\+T\+L/\+L\+I\+D and return it. If it cannot, it should return O\+M\+P\+I\+\_\+\+E\+R\+R\+\_\+\+N\+O\+T\+\_\+\+S\+U\+P\+P\+O\+R\+T\+E\+D and be gracefully skipped for this Open\+Fabrics port.
\end{DoxyItemize}

component\+\_\+finalize()\+: The openib B\+T\+L's component\+\_\+close() function calls connect\+\_\+base\+\_\+finalize(), which, in turn, calls the component\+\_\+finalize() function on all available C\+P\+Cs. Note that all C\+P\+C modules will have been finalized by this point; the C\+P\+C component\+\_\+finalize() function is a chance for the C\+P\+C to clean up any component-\/specific resources.

Module interface\+:

cbm\+\_\+component member\+: A pointer pointing to the single, global instance of the C\+P\+C component. This member is used for creating a unique index representing the modules' component so that it can be shared with remote peer processes.

cbm\+\_\+priority member\+: An integer between 0 and 100, inclusive, representing the priority of this C\+P\+C.

cbm\+\_\+modex\+\_\+message member\+: A pointer to a blob buffer that will be included in the modex message for this port for this C\+P\+C (it is assumed that this blob is a) only understandable by the corresponding C\+P\+C in the peer process, and b) contains specific addressing/contact information for {\itshape this} port's C\+P\+C module).

cbm\+\_\+modex\+\_\+message\+\_\+len member\+: The length of the cbm\+\_\+modex\+\_\+message blob, in bytes.

cbm\+\_\+endpoint\+\_\+init()\+: Called during endpoint creation, allowing a C\+P\+C module to cache information on the endpoint. A pointer to the endpoint's C\+P\+C module is already cached on the endpoint.

cbm\+\_\+start\+\_\+connect()\+: initiate a connection to a remote peer. The C\+P\+C is responsible for setting itself up for asyncronous operation for progressing the outgoing connection request.

cbm\+\_\+endpoint\+\_\+finalize()\+: Called during the endpoint destrouction, allowing the C\+P\+C module to destroy anything that it cached on the endpoint.

cbm\+\_\+finalize()\+: shut down all asynchronous handling and clean up any state that was setup for this C\+P\+C module/\+B\+T\+L. Some C\+P\+Cs setup asynchronous support on a per-\/\+H\+C\+A/\+N\+I\+C basis (vs. per-\/port/\+L\+I\+D). It is the reponsibility of the C\+P\+C to figure out such issues (e.\+g., via reference counting) -- there is no notification from the upper-\/level B\+T\+L about when an entire H\+C\+A/\+N\+I\+C is no longer being used. There is only this function, which tells when a specific C\+P\+C/\+B\+T\+L module is no longer being used.

cbm\+\_\+uses\+\_\+cts\+: a bool that indicates whether the C\+P\+C will use the C\+T\+S protocol or not.
\begin{DoxyItemize}
\item if true\+: the C\+P\+C will post the fragment on endpoint-\/$>$endpoint\+\_\+cts\+\_\+frag as a receive buffer and will {\itshape not} call ompi\+\_\+btl\+\_\+openib\+\_\+post\+\_\+recvs().
\item if false\+: the C\+P\+C will call ompi\+\_\+btl\+\_\+openib\+\_\+post\+\_\+recvs() before calling ompi\+\_\+btl\+\_\+openib\+\_\+cpc\+\_\+complete().
\end{DoxyItemize}

There are two functions in the main openib B\+T\+L that the C\+P\+C may call\+:


\begin{DoxyItemize}
\item ompi\+\_\+btl\+\_\+openib\+\_\+post\+\_\+recvs(endpoint)\+: once a Q\+P is locally connected to the remote side (but we don't know if the remote side is connected to us yet), this function is invoked to post buffers on the Q\+P, setup credits for the endpoint, etc. This function is {\itshape only} invoked if the C\+P\+C's cbm\+\_\+uses\+\_\+cts is false.
\item ompi\+\_\+btl\+\_\+openib\+\_\+cpc\+\_\+complete(endpoint)\+: once that a C\+P\+C knows that a Q\+P is connected on {\itshape both} sides, this function is invoked to tell the main openib B\+T\+L \char`\"{}ok, you can use this connection now.\char`\"{} (e.\+g., the main openib B\+T\+L will either invoke the C\+T\+S protocol or start sending out fragments that were queued while the connection was establishing, etc.). 
\end{DoxyItemize}

\subsection{Typedef Documentation}
\hypertarget{openib_2connect_2connect_8h_a472866e56a459f324183621cc4762e88}{\index{openib/connect/connect.\+h@{openib/connect/connect.\+h}!ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+finalize\+\_\+fn\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+finalize\+\_\+fn\+\_\+t}}
\index{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+finalize\+\_\+fn\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+finalize\+\_\+fn\+\_\+t}!openib/connect/connect.\+h@{openib/connect/connect.\+h}}
\subsubsection[{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+finalize\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+finalize\+\_\+fn\+\_\+t)(void)}}\label{openib_2connect_2connect_8h_a472866e56a459f324183621cc4762e88}


This function is invoked once by the openib B\+T\+L component during shutdown. 

It is intended to have C\+P\+C component-\/wide shutdown. \hypertarget{openib_2connect_2connect_8h_af90bb0d9b41d0ed3bcbe758ea3c024c7}{\index{openib/connect/connect.\+h@{openib/connect/connect.\+h}!ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+init\+\_\+fn\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+init\+\_\+fn\+\_\+t}}
\index{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+init\+\_\+fn\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+init\+\_\+fn\+\_\+t}!openib/connect/connect.\+h@{openib/connect/connect.\+h}}
\subsubsection[{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+init\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+init\+\_\+fn\+\_\+t)(void)}}\label{openib_2connect_2connect_8h_af90bb0d9b41d0ed3bcbe758ea3c024c7}


This function is invoked once by the openib B\+T\+L component during startup. 

It is intended to have C\+P\+C component-\/wide startup.

Return value\+:


\begin{DoxyItemize}
\item O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S\+: this C\+P\+C component will be used in selection during this process.
\item O\+M\+P\+I\+\_\+\+E\+R\+R\+\_\+\+N\+O\+T\+\_\+\+S\+U\+P\+P\+O\+R\+T\+E\+D\+: this C\+P\+C component will be silently ignored in this process.
\item Other O\+M\+P\+I\+\_\+\+E\+R\+R\+\_\+$\ast$ values\+: the error will be propagated upwards, likely causing a fatal error (and/or the openib B\+T\+L component being ignored). 
\end{DoxyItemize}\hypertarget{openib_2connect_2connect_8h_a2119c2f06528e13d708cdc7282c3aee8}{\index{openib/connect/connect.\+h@{openib/connect/connect.\+h}!ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+register\+\_\+fn\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+register\+\_\+fn\+\_\+t}}
\index{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+register\+\_\+fn\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+register\+\_\+fn\+\_\+t}!openib/connect/connect.\+h@{openib/connect/connect.\+h}}
\subsubsection[{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+register\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$ ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+component\+\_\+register\+\_\+fn\+\_\+t)(void)}}\label{openib_2connect_2connect_8h_a2119c2f06528e13d708cdc7282c3aee8}


\hyperlink{structFunction}{Function} to register M\+C\+A params in the connect functions. 

It returns no value, so it cannot fail. \hypertarget{openib_2connect_2connect_8h_a98c5983f6b956603283885eba5a1f0f0}{\index{openib/connect/connect.\+h@{openib/connect/connect.\+h}!ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+func\+\_\+component\+\_\+query\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+func\+\_\+component\+\_\+query\+\_\+t}}
\index{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+func\+\_\+component\+\_\+query\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+func\+\_\+component\+\_\+query\+\_\+t}!openib/connect/connect.\+h@{openib/connect/connect.\+h}}
\subsubsection[{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+func\+\_\+component\+\_\+query\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+func\+\_\+component\+\_\+query\+\_\+t)(struct {\bf mca\+\_\+btl\+\_\+openib\+\_\+module\+\_\+t} $\ast$btl, struct {\bf ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+t} $\ast$$\ast$cpc)}}\label{openib_2connect_2connect_8h_a98c5983f6b956603283885eba5a1f0f0}


Query the C\+P\+C to see if it wants to run on a specific port (i.\+e., a specific B\+T\+L module). 

If the component init function previously returned O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S, this function is invoked once per B\+T\+L module creation (i.\+e., for each port found by an M\+P\+I process). If this C\+P\+C wants to be used on this B\+T\+L module, it returns a C\+P\+C module that is specific to this B\+T\+L module.

The B\+T\+L module in question is passed to the function; all of its attributes can be used to query to see if it's eligible for this C\+P\+C.

If it is eligible, the C\+P\+C is responsible for creating a corresponding C\+P\+C module, filling in all the relevant fields on the modules, and for setting itself up to run (per above) and returning a C\+P\+C module (this is effectively the \char`\"{}module\+\_\+init\char`\"{} function). Note that the module priority must be between 0 and 100 (inclusive). When multiple C\+P\+Cs are eligible for a single module, the C\+P\+C with the highest priority will be used.

Return value\+:


\begin{DoxyItemize}
\item O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S if this C\+P\+C is eligible for and was able to be setup for this B\+T\+L module. It is assumed that the C\+P\+C is now completely setup to run on this openib module (per description above).
\item O\+M\+P\+I\+\_\+\+E\+R\+R\+\_\+\+N\+O\+T\+\_\+\+S\+U\+P\+P\+O\+R\+T\+E\+D if this C\+P\+C cannot support this B\+T\+L module. This is not an error; it's just the C\+P\+C saying \char`\"{}sorry, I
cannot support this B\+T\+L module.\char`\"{}
\item Other O\+M\+P\+I\+\_\+\+E\+R\+R\+\_\+$\ast$ code\+: an error occurred. 
\end{DoxyItemize}\hypertarget{openib_2connect_2connect_8h_a69bd89265025150cc1058f811fb76d1d}{\index{openib/connect/connect.\+h@{openib/connect/connect.\+h}!ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+data\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+data\+\_\+t}}
\index{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+data\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+data\+\_\+t}!openib/connect/connect.\+h@{openib/connect/connect.\+h}}
\subsubsection[{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+data\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+data\+\_\+t}  {\bf ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+data\+\_\+t}}}\label{openib_2connect_2connect_8h_a69bd89265025150cc1058f811fb76d1d}


Meta data about a C\+P\+C module. 

This is in a standalone struct because it is used in both the C\+P\+C module struct and the openib\+\_\+btl\+\_\+proc\+\_\+t struct to hold information received from the modex. \hypertarget{openib_2connect_2connect_8h_addfb679c8e71e32bdaf3f1f993f8e89d}{\index{openib/connect/connect.\+h@{openib/connect/connect.\+h}!ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t}}
\index{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t@{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t}!openib/connect/connect.\+h@{openib/connect/connect.\+h}}
\subsubsection[{ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t)(struct {\bf mca\+\_\+btl\+\_\+openib\+\_\+module\+\_\+t} $\ast$btl, struct {\bf ompi\+\_\+btl\+\_\+openib\+\_\+connect\+\_\+base\+\_\+module\+\_\+t} $\ast$cpc)}}\label{openib_2connect_2connect_8h_addfb679c8e71e32bdaf3f1f993f8e89d}


\hyperlink{structFunction}{Function} to finalize the C\+P\+C module. 

It is called once when the C\+P\+C module's corresponding openib B\+T\+L module is being finalized. 