\hypertarget{shmem_8h}{\section{opal/mca/shmem/shmem.h File Reference}
\label{shmem_8h}\index{opal/mca/shmem/shmem.\+h@{opal/mca/shmem/shmem.\+h}}
}


shmem (shared memory backing facility) framework component interface definitions.  


{\ttfamily \#include \char`\"{}opal\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/mca/mca.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/mca/base/base.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/mca/shmem/shmem\+\_\+types.\+h\char`\"{}}\\*
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structopal__shmem__base__component__2__0__0__t}{opal\+\_\+shmem\+\_\+base\+\_\+component\+\_\+2\+\_\+0\+\_\+0\+\_\+t}
\item 
struct \hyperlink{structopal__shmem__base__module__2__0__0__t}{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+2\+\_\+0\+\_\+0\+\_\+t}
\begin{DoxyCompactList}\small\item\em structure for shmem modules \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{shmem_8h_ae920d31ac2d314e973584438fbd661b3}{O\+P\+A\+L\+\_\+\+S\+H\+M\+E\+M\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0}
\begin{DoxyCompactList}\small\item\em macro for use in components that are of type shmem see\+: \hyperlink{mca_8h}{opal/mca/mca.\+h} for more information \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{shmem_8h_a022309495689b206e16fadcc5fe2efa7}{typedef struct \\*
\hyperlink{structopal__shmem__base__component__2__0__0__t}{opal\+\_\+shmem\+\_\+base\+\_\+component\+\_\+2\+\_\+0\+\_\+0\+\_\+t} {\bfseries opal\+\_\+shmem\+\_\+base\+\_\+component\+\_\+2\+\_\+0\+\_\+0\+\_\+t}}\label{shmem_8h_a022309495689b206e16fadcc5fe2efa7}

\item 
\hypertarget{shmem_8h_aeba1b1b7fd4bd5a7c2d566e9f6c69805}{typedef struct \\*
\hyperlink{structopal__shmem__base__component__2__0__0__t}{opal\+\_\+shmem\+\_\+base\+\_\+component\+\_\+2\+\_\+0\+\_\+0\+\_\+t} {\bfseries opal\+\_\+shmem\+\_\+base\+\_\+component\+\_\+t}}\label{shmem_8h_aeba1b1b7fd4bd5a7c2d566e9f6c69805}

\item 
typedef int($\ast$ \hyperlink{shmem_8h_a40d9280bd512fb9893f8d9443ac3c72b}{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+init\+\_\+fn\+\_\+t} )(void)
\begin{DoxyCompactList}\small\item\em module initialization function. \end{DoxyCompactList}\item 
typedef int($\ast$ \hyperlink{shmem_8h_adedac7b3e012dd29b5e684c8d0c4bc34}{opal\+\_\+shmem\+\_\+base\+\_\+ds\+\_\+copy\+\_\+fn\+\_\+t} )(const \hyperlink{structopal__shmem__ds__t}{opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$from, \hyperlink{structopal__shmem__ds__t}{opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$to)
\begin{DoxyCompactList}\small\item\em copy shmem data structure information pointed to by from to the structure pointed to by to. \end{DoxyCompactList}\item 
typedef int($\ast$ \hyperlink{shmem_8h_a77280d678391ab8416f2828b16717491}{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+create\+\_\+fn\+\_\+t} )(\hyperlink{structopal__shmem__ds__t}{opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$ds\+\_\+buf, const char $\ast$file\+\_\+name, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em create a new shared memory segment and initialize members in structure pointed to by ds\+\_\+buf. \end{DoxyCompactList}\item 
typedef void $\ast$($\ast$ \hyperlink{shmem_8h_a40f690b00334c9d68bbbf8383d9ba1b6}{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+attach\+\_\+fn\+\_\+t} )(\hyperlink{structopal__shmem__ds__t}{opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$ds\+\_\+buf)
\begin{DoxyCompactList}\small\item\em attach to an existing shared memory segment initialized by segment\+\_\+create. \end{DoxyCompactList}\item 
typedef int($\ast$ \hyperlink{shmem_8h_ab2b98026a175bd3216992b7a42c1051b}{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+detach\+\_\+fn\+\_\+t} )(\hyperlink{structopal__shmem__ds__t}{opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$ds\+\_\+buf)
\begin{DoxyCompactList}\small\item\em detach from an existing shared memory segment. \end{DoxyCompactList}\item 
typedef int($\ast$ \hyperlink{shmem_8h_aa816647e7c4f2d96504881d10d0746ae}{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+unlink\+\_\+fn\+\_\+t} )(\hyperlink{structopal__shmem__ds__t}{opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$ds\+\_\+buf)
\begin{DoxyCompactList}\small\item\em unlink an existing shared memory segment. \end{DoxyCompactList}\item 
typedef int($\ast$ \hyperlink{shmem_8h_a5ec6b4fc8d31035b5771c8d8f915cfc0}{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t} )(void)
\begin{DoxyCompactList}\small\item\em module finalize function. \end{DoxyCompactList}\item 
\hypertarget{shmem_8h_a38510091dafa7b3a9da23d43a3c97d39}{typedef struct \\*
\hyperlink{structopal__shmem__base__module__2__0__0__t}{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+2\+\_\+0\+\_\+0\+\_\+t} \hyperlink{shmem_8h_a38510091dafa7b3a9da23d43a3c97d39}{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+2\+\_\+0\+\_\+0\+\_\+t}}\label{shmem_8h_a38510091dafa7b3a9da23d43a3c97d39}

\begin{DoxyCompactList}\small\item\em convenience typedefs \end{DoxyCompactList}\item 
\hypertarget{shmem_8h_aa5d73bf1c5a8e3ac34482ed0ec4c1f9d}{typedef struct \\*
\hyperlink{structopal__shmem__base__module__2__0__0__t}{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+2\+\_\+0\+\_\+0\+\_\+t} {\bfseries opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+t}}\label{shmem_8h_aa5d73bf1c5a8e3ac34482ed0ec4c1f9d}

\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\hypertarget{shmem_8h_a50de379982159f8afc8bc2017d5a2ab5}{B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S typedef int($\ast$ {\bfseries mca\+\_\+shmem\+\_\+base\+\_\+component\+\_\+runtime\+\_\+query\+\_\+fn\+\_\+t} )(\hyperlink{mca_8h_a754b82edf8c7a63b09f7ee5270031bdd}{mca\+\_\+base\+\_\+module\+\_\+t} $\ast$$\ast$module, int $\ast$priority, const char $\ast$hint)}\label{shmem_8h_a50de379982159f8afc8bc2017d5a2ab5}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
shmem (shared memory backing facility) framework component interface definitions. 

usage example\+: see ompi/mca/common/sm

The module has the following functions\+:


\begin{DoxyItemize}
\item module\+\_\+init
\item segment\+\_\+create
\item ds\+\_\+copy
\item segment\+\_\+attach
\item segment\+\_\+detach
\item unlink
\item module\+\_\+finalize 
\end{DoxyItemize}

\subsection{Macro Definition Documentation}
\hypertarget{shmem_8h_ae920d31ac2d314e973584438fbd661b3}{\index{shmem.\+h@{shmem.\+h}!O\+P\+A\+L\+\_\+\+S\+H\+M\+E\+M\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0@{O\+P\+A\+L\+\_\+\+S\+H\+M\+E\+M\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0}}
\index{O\+P\+A\+L\+\_\+\+S\+H\+M\+E\+M\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0@{O\+P\+A\+L\+\_\+\+S\+H\+M\+E\+M\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0}!shmem.\+h@{shmem.\+h}}
\subsubsection[{O\+P\+A\+L\+\_\+\+S\+H\+M\+E\+M\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+P\+A\+L\+\_\+\+S\+H\+M\+E\+M\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0}}\label{shmem_8h_ae920d31ac2d314e973584438fbd661b3}
{\bfseries Value\+:}
\begin{DoxyCode}
MCA\_BASE\_VERSION\_2\_0\_0,                                                    \(\backslash\)
    \textcolor{stringliteral}{"shmem"}, 2, 0, 0
\end{DoxyCode}


macro for use in components that are of type shmem see\+: \hyperlink{mca_8h}{opal/mca/mca.\+h} for more information 



\subsection{Typedef Documentation}
\hypertarget{shmem_8h_adedac7b3e012dd29b5e684c8d0c4bc34}{\index{shmem.\+h@{shmem.\+h}!opal\+\_\+shmem\+\_\+base\+\_\+ds\+\_\+copy\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+ds\+\_\+copy\+\_\+fn\+\_\+t}}
\index{opal\+\_\+shmem\+\_\+base\+\_\+ds\+\_\+copy\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+ds\+\_\+copy\+\_\+fn\+\_\+t}!shmem.\+h@{shmem.\+h}}
\subsubsection[{opal\+\_\+shmem\+\_\+base\+\_\+ds\+\_\+copy\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ opal\+\_\+shmem\+\_\+base\+\_\+ds\+\_\+copy\+\_\+fn\+\_\+t)(const {\bf opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$from, {\bf opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$to)}}\label{shmem_8h_adedac7b3e012dd29b5e684c8d0c4bc34}


copy shmem data structure information pointed to by from to the structure pointed to by to. 


\begin{DoxyParams}{Parameters}
{\em from} & source pointer (I\+N).\\
\hline
{\em to} & destination pointer (O\+U\+T).\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S on success. 
\end{DoxyReturn}
\hypertarget{shmem_8h_a5ec6b4fc8d31035b5771c8d8f915cfc0}{\index{shmem.\+h@{shmem.\+h}!opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t}}
\index{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t}!shmem.\+h@{shmem.\+h}}
\subsubsection[{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+finalize\+\_\+fn\+\_\+t)(void)}}\label{shmem_8h_a5ec6b4fc8d31035b5771c8d8f915cfc0}


module finalize function. 

invoked by the base on the selected module when the shmem framework is being shut down. \hypertarget{shmem_8h_a40d9280bd512fb9893f8d9443ac3c72b}{\index{shmem.\+h@{shmem.\+h}!opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+init\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+init\+\_\+fn\+\_\+t}}
\index{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+init\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+init\+\_\+fn\+\_\+t}!shmem.\+h@{shmem.\+h}}
\subsubsection[{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+init\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+init\+\_\+fn\+\_\+t)(void)}}\label{shmem_8h_a40d9280bd512fb9893f8d9443ac3c72b}


module initialization function. 

\begin{DoxyReturn}{Returns}
O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S on success. 
\end{DoxyReturn}
\hypertarget{shmem_8h_a40f690b00334c9d68bbbf8383d9ba1b6}{\index{shmem.\+h@{shmem.\+h}!opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+attach\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+attach\+\_\+fn\+\_\+t}}
\index{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+attach\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+attach\+\_\+fn\+\_\+t}!shmem.\+h@{shmem.\+h}}
\subsubsection[{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+attach\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef void$\ast$($\ast$ opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+attach\+\_\+fn\+\_\+t)({\bf opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$ds\+\_\+buf)}}\label{shmem_8h_a40f690b00334c9d68bbbf8383d9ba1b6}


attach to an existing shared memory segment initialized by segment\+\_\+create. 


\begin{DoxyParams}{Parameters}
{\em ds\+\_\+buf} & pointer to initialized \hyperlink{structopal__shmem__ds__t}{opal\+\_\+shmem\+\_\+ds\+\_\+t} typedef'd structure (I\+N/\+O\+U\+T).\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
base address of shared memory segment on success. returns N\+U\+L\+L otherwise. 
\end{DoxyReturn}
\hypertarget{shmem_8h_a77280d678391ab8416f2828b16717491}{\index{shmem.\+h@{shmem.\+h}!opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+create\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+create\+\_\+fn\+\_\+t}}
\index{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+create\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+create\+\_\+fn\+\_\+t}!shmem.\+h@{shmem.\+h}}
\subsubsection[{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+create\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+create\+\_\+fn\+\_\+t)({\bf opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$ds\+\_\+buf, const char $\ast$file\+\_\+name, size\+\_\+t size)}}\label{shmem_8h_a77280d678391ab8416f2828b16717491}


create a new shared memory segment and initialize members in structure pointed to by ds\+\_\+buf. 


\begin{DoxyParams}{Parameters}
{\em ds\+\_\+buf} & pointer to \hyperlink{structopal__shmem__ds__t}{opal\+\_\+shmem\+\_\+ds\+\_\+t} typedef'd structure defined in \hyperlink{shmem__types_8h}{shmem\+\_\+types.\+h} (O\+U\+T).\\
\hline
{\em file\+\_\+name} & file\+\_\+name unique string identifier that must be a valid, writable path (I\+N).\\
\hline
{\em size} & size of the shared memory segment.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S on success. 
\end{DoxyReturn}
\hypertarget{shmem_8h_ab2b98026a175bd3216992b7a42c1051b}{\index{shmem.\+h@{shmem.\+h}!opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+detach\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+detach\+\_\+fn\+\_\+t}}
\index{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+detach\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+detach\+\_\+fn\+\_\+t}!shmem.\+h@{shmem.\+h}}
\subsubsection[{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+detach\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+segment\+\_\+detach\+\_\+fn\+\_\+t)({\bf opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$ds\+\_\+buf)}}\label{shmem_8h_ab2b98026a175bd3216992b7a42c1051b}


detach from an existing shared memory segment. 


\begin{DoxyParams}{Parameters}
{\em ds\+\_\+buf} & pointer to initialized \hyperlink{structopal__shmem__ds__t}{opal\+\_\+shmem\+\_\+ds\+\_\+t} typedef'd structure (I\+N/\+O\+U\+T).\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S on success. 
\end{DoxyReturn}
\hypertarget{shmem_8h_aa816647e7c4f2d96504881d10d0746ae}{\index{shmem.\+h@{shmem.\+h}!opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+unlink\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+unlink\+\_\+fn\+\_\+t}}
\index{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+unlink\+\_\+fn\+\_\+t@{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+unlink\+\_\+fn\+\_\+t}!shmem.\+h@{shmem.\+h}}
\subsubsection[{opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+unlink\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ opal\+\_\+shmem\+\_\+base\+\_\+module\+\_\+unlink\+\_\+fn\+\_\+t)({\bf opal\+\_\+shmem\+\_\+ds\+\_\+t} $\ast$ds\+\_\+buf)}}\label{shmem_8h_aa816647e7c4f2d96504881d10d0746ae}


unlink an existing shared memory segment. 


\begin{DoxyParams}{Parameters}
{\em ds\+\_\+buf} & pointer to initialized \hyperlink{structopal__shmem__ds__t}{opal\+\_\+shmem\+\_\+ds\+\_\+t} typedef'd structure (I\+N/\+O\+U\+T).\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S on success. 
\end{DoxyReturn}
