\hypertarget{op_2op_8h}{\section{ompi/op/op.h File Reference}
\label{op_2op_8h}\index{ompi/op/op.\+h@{ompi/op/op.\+h}}
}


Public interface for the M\+P\+I\+\_\+\+Op handle.  


{\ttfamily \#include \char`\"{}ompi\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include $<$stdio.\+h$>$}\\*
{\ttfamily \#include \char`\"{}mpi.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/class/opal\+\_\+object.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/datatype/ompi\+\_\+datatype.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/mpi/f77/fint\+\_\+2\+\_\+int.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/mca/op/op.\+h\char`\"{}}\\*
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t}
\begin{DoxyCompactList}\small\item\em Back-\/end type of M\+P\+I\+\_\+\+Op. \end{DoxyCompactList}\item 
struct \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t}
\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\hypertarget{op_2op_8h_a7c6dfb4663e52e576814541d07fae04d}{\#define \hyperlink{op_2op_8h_a7c6dfb4663e52e576814541d07fae04d}{O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+I\+N\+T\+R\+I\+N\+S\+I\+C}~0x0001}\label{op_2op_8h_a7c6dfb4663e52e576814541d07fae04d}

\begin{DoxyCompactList}\small\item\em Set if the M\+P\+I\+\_\+\+Op is a built-\/in operation. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_afd65b9477d334cd046589d428df80437}{\#define \hyperlink{op_2op_8h_afd65b9477d334cd046589d428df80437}{O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+F\+O\+R\+T\+R\+A\+N\+\_\+\+F\+U\+N\+C}~0x0002}\label{op_2op_8h_afd65b9477d334cd046589d428df80437}

\begin{DoxyCompactList}\small\item\em Set if the callback function is in Fortran. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a3224a8d75645f2da7961978d37b3f242}{\#define \hyperlink{op_2op_8h_a3224a8d75645f2da7961978d37b3f242}{O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+C\+X\+X\+\_\+\+F\+U\+N\+C}~0x0004}\label{op_2op_8h_a3224a8d75645f2da7961978d37b3f242}

\begin{DoxyCompactList}\small\item\em Set if the callback function is in C++. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_ad569e0559b385ad70f0878ddcf4c68a0}{\#define \hyperlink{op_2op_8h_ad569e0559b385ad70f0878ddcf4c68a0}{O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+A\+S\+S\+O\+C}~0x0008}\label{op_2op_8h_ad569e0559b385ad70f0878ddcf4c68a0}

\begin{DoxyCompactList}\small\item\em Set if the callback function is associative (M\+A\+X and S\+U\+M will both have A\+S\+S\+O\+C set -- in fact, it will only {\itshape not} be set if we implement some extensions to M\+P\+I, because M\+P\+I says that all M\+P\+I\+\_\+\+Op's should be associative, so this flag is really here for future expansion) \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a31ee1ed3fad1e4a1926b01e101647e78}{\#define \hyperlink{op_2op_8h_a31ee1ed3fad1e4a1926b01e101647e78}{O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+F\+L\+O\+A\+T\+\_\+\+A\+S\+S\+O\+C}~0x0010}\label{op_2op_8h_a31ee1ed3fad1e4a1926b01e101647e78}

\begin{DoxyCompactList}\small\item\em Set if the callback function is associative for floating point operands (e.\+g., M\+P\+I\+\_\+\+S\+U\+M will have A\+S\+S\+O\+C set, but will {\itshape not} have F\+L\+O\+A\+T\+\_\+\+A\+S\+S\+O\+C set) \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_aac0cf48c4bd858066c551fadb9288e56}{\#define \hyperlink{op_2op_8h_aac0cf48c4bd858066c551fadb9288e56}{O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+C\+O\+M\+M\+U\+T\+E}~0x0020}\label{op_2op_8h_aac0cf48c4bd858066c551fadb9288e56}

\begin{DoxyCompactList}\small\item\em Set if the callback function is communative. \end{DoxyCompactList}\item 
\#define \hyperlink{op_2op_8h_a9f01b9c40cc821a6c8a85c137668c352}{P\+R\+E\+D\+E\+F\+I\+N\+E\+D\+\_\+\+O\+P\+\_\+\+P\+A\+D}~(sizeof(void$\ast$) $\ast$ 256)
\begin{DoxyCompactList}\small\item\em Padded struct to maintain back compatibiltiy. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{op_2op_8h_a97ecc42442aae614913c85b589e36b68}{typedef void( \hyperlink{op_2op_8h_a97ecc42442aae614913c85b589e36b68}{ompi\+\_\+op\+\_\+fortran\+\_\+handler\+\_\+fn\+\_\+t} )(void $\ast$, void $\ast$, M\+P\+I\+\_\+\+Fint $\ast$, M\+P\+I\+\_\+\+Fint $\ast$)}\label{op_2op_8h_a97ecc42442aae614913c85b589e36b68}

\begin{DoxyCompactList}\small\item\em Typedef for fortran user-\/defined M\+P\+I\+\_\+\+Ops. \end{DoxyCompactList}\item 
typedef void( \hyperlink{op_2op_8h_af8f62efb7b7201bde08355a5c071c220}{ompi\+\_\+op\+\_\+cxx\+\_\+handler\+\_\+fn\+\_\+t} )(void $\ast$, void $\ast$, int $\ast$, struct \hyperlink{structompi__datatype__t}{ompi\+\_\+datatype\+\_\+t} $\ast$$\ast$, M\+P\+I\+\_\+\+User\+\_\+function $\ast$op)
\begin{DoxyCompactList}\small\item\em Typedef for C++ op functions intercept (used for user-\/defined M\+P\+I\+::\+Ops). \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a39a38fc598162caa017e0fa881a96325}{typedef struct \hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_a39a38fc598162caa017e0fa881a96325}{ompi\+\_\+op\+\_\+t}}\label{op_2op_8h_a39a38fc598162caa017e0fa881a96325}

\begin{DoxyCompactList}\small\item\em Convenience typedef. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a699e82cf364babd64575c3e24c064159}{typedef struct \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} {\bfseries ompi\+\_\+predefined\+\_\+op\+\_\+t}}\label{op_2op_8h_a699e82cf364babd64575c3e24c064159}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S typedef void() \hyperlink{op_2op_8h_aabf1815275628eb477e4693d7b206487}{ompi\+\_\+op\+\_\+c\+\_\+handler\+\_\+fn\+\_\+t} (void $\ast$, void $\ast$, int $\ast$, struct \hyperlink{structompi__datatype__t}{ompi\+\_\+datatype\+\_\+t} $\ast$$\ast$)
\begin{DoxyCompactList}\small\item\em Typedef for C op functions for user-\/defined M\+P\+I\+\_\+\+Ops. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a3957097f0ddebad1c88e90957d6f5577}{O\+M\+P\+I\+\_\+\+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{structompi__op__t}{ompi\+\_\+op\+\_\+t})}\label{op_2op_8h_a3957097f0ddebad1c88e90957d6f5577}

\item 
int \hyperlink{op_2op_8h_a6270277920ea2e39d8fd20cf4e24a036}{ompi\+\_\+op\+\_\+init} (void)
\begin{DoxyCompactList}\small\item\em Initialize the op interface. \end{DoxyCompactList}\item 
int \hyperlink{op_2op_8h_ab00519a114816bb73c0972f103980b65}{ompi\+\_\+op\+\_\+finalize} (void)
\begin{DoxyCompactList}\small\item\em Finalize the op interface. \end{DoxyCompactList}\item 
\hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} $\ast$ \hyperlink{op_2op_8h_ae5d04af1a69db7a8c5c4946657ed7501}{ompi\+\_\+op\+\_\+create\+\_\+user} (bool commute, \hyperlink{op_2op_8h_a97ecc42442aae614913c85b589e36b68}{ompi\+\_\+op\+\_\+fortran\+\_\+handler\+\_\+fn\+\_\+t} func)
\begin{DoxyCompactList}\small\item\em Create a \hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} with a user-\/defined callback (vs. \end{DoxyCompactList}\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{op_2op_8h_a98a939205f29c7b58f7566224b68405a}{ompi\+\_\+op\+\_\+set\+\_\+cxx\+\_\+callback} (\hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} $\ast$op, M\+P\+I\+\_\+\+User\+\_\+function $\ast$fn)
\begin{DoxyCompactList}\small\item\em Mark an M\+P\+I\+\_\+\+Op as holding a C++ callback function, and cache that function in the M\+P\+I\+\_\+\+Op. \end{DoxyCompactList}\item 
static bool \hyperlink{op_2op_8h_afc1f2a52ae244e5968d144b6a2fc4c43}{ompi\+\_\+op\+\_\+is\+\_\+intrinsic} (\hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} $\ast$op)
\begin{DoxyCompactList}\small\item\em Check to see if an op is intrinsic. \end{DoxyCompactList}\item 
static bool \hyperlink{op_2op_8h_af6fae8ed6a4be8f2492f7f967bd946e7}{ompi\+\_\+op\+\_\+is\+\_\+commute} (\hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} $\ast$op)
\begin{DoxyCompactList}\small\item\em Check to see if an op is communative or not. \end{DoxyCompactList}\item 
static bool \hyperlink{op_2op_8h_ab87f288b76a3fc2c0ff86208df30aeb5}{ompi\+\_\+op\+\_\+is\+\_\+float\+\_\+assoc} (\hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} $\ast$op)
\begin{DoxyCompactList}\small\item\em Check to see if an op is floating point associative or not. \end{DoxyCompactList}\item 
static bool \hyperlink{op_2op_8h_aee9a54810e493df81fca673bd2ba47a1}{ompi\+\_\+op\+\_\+is\+\_\+valid} (\hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} $\ast$op, \hyperlink{structompi__datatype__t}{ompi\+\_\+datatype\+\_\+t} $\ast$ddt, char $\ast$$\ast$msg, const char $\ast$func)
\begin{DoxyCompactList}\small\item\em Check to see if an op is valid on a given datatype. \end{DoxyCompactList}\item 
static void \hyperlink{op_2op_8h_acdca390988d83a445ab467feba25bea7}{ompi\+\_\+op\+\_\+reduce} (\hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} $\ast$op, void $\ast$source, void $\ast$target, int count, \hyperlink{structompi__datatype__t}{ompi\+\_\+datatype\+\_\+t} $\ast$dtype)
\begin{DoxyCompactList}\small\item\em Perform a reduction operation. \end{DoxyCompactList}\item 
static void \hyperlink{op_2op_8h_a81fc6ea6d7e9d39149edad3b05c78557}{ompi\+\_\+3buff\+\_\+op\+\_\+reduce} (\hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} $\ast$op, void $\ast$source1, void $\ast$source2, void $\ast$target, int count, \hyperlink{structompi__datatype__t}{ompi\+\_\+datatype\+\_\+t} $\ast$dtype)
\begin{DoxyCompactList}\small\item\em Perform a reduction operation. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{op_2op_8h_aa034d01affe5dc2f08cbff17890c5251}{ompi\+\_\+op\+\_\+ddt\+\_\+map} \mbox{[}O\+M\+P\+I\+\_\+\+D\+A\+T\+A\+T\+Y\+P\+E\+\_\+\+M\+A\+X\+\_\+\+P\+R\+E\+D\+E\+F\+I\+N\+E\+D\mbox{]}
\begin{DoxyCompactList}\small\item\em Array to map ddt-\/$>$id values to the corresponding position in the op function array. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_acf77e7fac85405c0052f8093d96ccc87}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_acf77e7fac85405c0052f8093d96ccc87}{ompi\+\_\+mpi\+\_\+op\+\_\+null}}\label{op_2op_8h_acf77e7fac85405c0052f8093d96ccc87}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+O\+P\+\_\+\+N\+U\+L\+L. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a203a0949f1b7ac1277eb8f221fa7b5e6}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_a203a0949f1b7ac1277eb8f221fa7b5e6}{ompi\+\_\+mpi\+\_\+op\+\_\+max}}\label{op_2op_8h_a203a0949f1b7ac1277eb8f221fa7b5e6}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+M\+A\+X. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_ab445612972ff1d0051788c7e3ab31d58}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_ab445612972ff1d0051788c7e3ab31d58}{ompi\+\_\+mpi\+\_\+op\+\_\+min}}\label{op_2op_8h_ab445612972ff1d0051788c7e3ab31d58}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+M\+I\+N. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a0a16debe52be7c9f57f179a9cb370d92}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_a0a16debe52be7c9f57f179a9cb370d92}{ompi\+\_\+mpi\+\_\+op\+\_\+sum}}\label{op_2op_8h_a0a16debe52be7c9f57f179a9cb370d92}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+S\+U\+M. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a255b9503a055d5d3c8501e8be903f85d}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_a255b9503a055d5d3c8501e8be903f85d}{ompi\+\_\+mpi\+\_\+op\+\_\+prod}}\label{op_2op_8h_a255b9503a055d5d3c8501e8be903f85d}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+P\+R\+O\+D. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_ace64f18f630980b81f38c1f38441749d}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_ace64f18f630980b81f38c1f38441749d}{ompi\+\_\+mpi\+\_\+op\+\_\+land}}\label{op_2op_8h_ace64f18f630980b81f38c1f38441749d}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+L\+A\+N\+D. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a25240c9ea0b0f2727ccd5394b69c1595}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_a25240c9ea0b0f2727ccd5394b69c1595}{ompi\+\_\+mpi\+\_\+op\+\_\+band}}\label{op_2op_8h_a25240c9ea0b0f2727ccd5394b69c1595}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+B\+A\+N\+D. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_afa9ba73d9ae186598cde400a98dbd3ce}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_afa9ba73d9ae186598cde400a98dbd3ce}{ompi\+\_\+mpi\+\_\+op\+\_\+lor}}\label{op_2op_8h_afa9ba73d9ae186598cde400a98dbd3ce}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+L\+O\+R. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_acbbe736403c037ed37a8becba08d923d}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_acbbe736403c037ed37a8becba08d923d}{ompi\+\_\+mpi\+\_\+op\+\_\+bor}}\label{op_2op_8h_acbbe736403c037ed37a8becba08d923d}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+B\+O\+R. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_ac7c540c1a95e074f2ac7fc576e55fa09}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_ac7c540c1a95e074f2ac7fc576e55fa09}{ompi\+\_\+mpi\+\_\+op\+\_\+lxor}}\label{op_2op_8h_ac7c540c1a95e074f2ac7fc576e55fa09}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+L\+X\+O\+R. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a4c976927104719c83d20d02a7ae9ebc4}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_a4c976927104719c83d20d02a7ae9ebc4}{ompi\+\_\+mpi\+\_\+op\+\_\+bxor}}\label{op_2op_8h_a4c976927104719c83d20d02a7ae9ebc4}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+B\+X\+O\+R. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a14f5a993361de1165380101649041199}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_a14f5a993361de1165380101649041199}{ompi\+\_\+mpi\+\_\+op\+\_\+maxloc}}\label{op_2op_8h_a14f5a993361de1165380101649041199}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+M\+A\+X\+L\+O\+C. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_ad334c9f3c97ee490c8534737680f97d2}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_ad334c9f3c97ee490c8534737680f97d2}{ompi\+\_\+mpi\+\_\+op\+\_\+minloc}}\label{op_2op_8h_ad334c9f3c97ee490c8534737680f97d2}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+M\+I\+N\+L\+O\+C. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_a17445ea5681b5eea2b843e82266f32e2}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structompi__predefined__op__t}{ompi\+\_\+predefined\+\_\+op\+\_\+t} \hyperlink{op_2op_8h_a17445ea5681b5eea2b843e82266f32e2}{ompi\+\_\+mpi\+\_\+op\+\_\+replace}}\label{op_2op_8h_a17445ea5681b5eea2b843e82266f32e2}

\begin{DoxyCompactList}\small\item\em Global variable for M\+P\+I\+\_\+\+R\+E\+P\+L\+A\+C\+E. \end{DoxyCompactList}\item 
\hypertarget{op_2op_8h_ada0b87fd23c93e036681c9f10699179b}{struct \hyperlink{structopal__pointer__array__t}{opal\+\_\+pointer\+\_\+array\+\_\+t} $\ast$ \hyperlink{op_2op_8h_ada0b87fd23c93e036681c9f10699179b}{ompi\+\_\+op\+\_\+f\+\_\+to\+\_\+c\+\_\+table}}\label{op_2op_8h_ada0b87fd23c93e036681c9f10699179b}

\begin{DoxyCompactList}\small\item\em Table for Fortran $<$-\/$>$ C op handle conversion. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Public interface for the M\+P\+I\+\_\+\+Op handle. 



\subsection{Macro Definition Documentation}
\hypertarget{op_2op_8h_a9f01b9c40cc821a6c8a85c137668c352}{\index{op/op.\+h@{op/op.\+h}!P\+R\+E\+D\+E\+F\+I\+N\+E\+D\+\_\+\+O\+P\+\_\+\+P\+A\+D@{P\+R\+E\+D\+E\+F\+I\+N\+E\+D\+\_\+\+O\+P\+\_\+\+P\+A\+D}}
\index{P\+R\+E\+D\+E\+F\+I\+N\+E\+D\+\_\+\+O\+P\+\_\+\+P\+A\+D@{P\+R\+E\+D\+E\+F\+I\+N\+E\+D\+\_\+\+O\+P\+\_\+\+P\+A\+D}!op/op.\+h@{op/op.\+h}}
\subsubsection[{P\+R\+E\+D\+E\+F\+I\+N\+E\+D\+\_\+\+O\+P\+\_\+\+P\+A\+D}]{\setlength{\rightskip}{0pt plus 5cm}\#define P\+R\+E\+D\+E\+F\+I\+N\+E\+D\+\_\+\+O\+P\+\_\+\+P\+A\+D~(sizeof(void$\ast$) $\ast$ 256)}}\label{op_2op_8h_a9f01b9c40cc821a6c8a85c137668c352}


Padded struct to maintain back compatibiltiy. 

See \hyperlink{communicator_8h_source}{ompi/communicator/communicator.\+h} comments with struct \hyperlink{structompi__communicator__t}{ompi\+\_\+communicator\+\_\+t} for full explanation why we chose the following padding construct for predefines. 

\subsection{Typedef Documentation}
\hypertarget{op_2op_8h_af8f62efb7b7201bde08355a5c071c220}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+cxx\+\_\+handler\+\_\+fn\+\_\+t@{ompi\+\_\+op\+\_\+cxx\+\_\+handler\+\_\+fn\+\_\+t}}
\index{ompi\+\_\+op\+\_\+cxx\+\_\+handler\+\_\+fn\+\_\+t@{ompi\+\_\+op\+\_\+cxx\+\_\+handler\+\_\+fn\+\_\+t}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+cxx\+\_\+handler\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef void( ompi\+\_\+op\+\_\+cxx\+\_\+handler\+\_\+fn\+\_\+t)(void $\ast$, void $\ast$, int $\ast$, struct {\bf ompi\+\_\+datatype\+\_\+t} $\ast$$\ast$, M\+P\+I\+\_\+\+User\+\_\+function $\ast$op)}}\label{op_2op_8h_af8f62efb7b7201bde08355a5c071c220}


Typedef for C++ op functions intercept (used for user-\/defined M\+P\+I\+::\+Ops). 

See the lengthy explanation for why this is different than the C intercept in ompi/mpi/cxx/intercepts.\+cc in the ompi\+\_\+mpi\+\_\+cxx\+\_\+op\+\_\+intercept() function. 

\subsection{Function Documentation}
\hypertarget{op_2op_8h_a81fc6ea6d7e9d39149edad3b05c78557}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+3buff\+\_\+op\+\_\+reduce@{ompi\+\_\+3buff\+\_\+op\+\_\+reduce}}
\index{ompi\+\_\+3buff\+\_\+op\+\_\+reduce@{ompi\+\_\+3buff\+\_\+op\+\_\+reduce}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+3buff\+\_\+op\+\_\+reduce}]{\setlength{\rightskip}{0pt plus 5cm}static void ompi\+\_\+3buff\+\_\+op\+\_\+reduce (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+op\+\_\+t} $\ast$}]{op, }
\item[{void $\ast$}]{source1, }
\item[{void $\ast$}]{source2, }
\item[{void $\ast$}]{target, }
\item[{int}]{count, }
\item[{{\bf ompi\+\_\+datatype\+\_\+t} $\ast$}]{dtype}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{op_2op_8h_a81fc6ea6d7e9d39149edad3b05c78557}


Perform a reduction operation. 


\begin{DoxyParams}{Parameters}
{\em op} & The operation (I\+N) \\
\hline
{\em source} & Source1 (input) buffer (I\+N) \\
\hline
{\em source} & Source2 (input) buffer (I\+N) \\
\hline
{\em target} & Target (output) buffer (I\+N/\+O\+U\+T) \\
\hline
{\em count} & Number of elements (I\+N) \\
\hline
{\em dtype} & M\+P\+I datatype (I\+N)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void As with M\+P\+I user-\/defined reduction functions, there is no return code from this function.
\end{DoxyReturn}
Perform a reduction operation with count elements of type dtype in the buffers source and target. The target buffer obtains the result (i.\+e., the original values in the target buffer are reduced with the values in the source buffer and the result is stored in the target buffer).

This function will {\itshape only} be invoked on intrinsic M\+P\+I\+\_\+\+Ops.

Otherwise, this function is the same as ompi\+\_\+op\+\_\+reduce. 

References ompi\+\_\+datatype\+\_\+t\+::id, ompi\+\_\+op\+\_\+t\+::o\+\_\+3buff\+\_\+intrinsic, and ompi\+\_\+op\+\_\+ddt\+\_\+map.

\hypertarget{op_2op_8h_aabf1815275628eb477e4693d7b206487}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+c\+\_\+handler\+\_\+fn\+\_\+t@{ompi\+\_\+op\+\_\+c\+\_\+handler\+\_\+fn\+\_\+t}}
\index{ompi\+\_\+op\+\_\+c\+\_\+handler\+\_\+fn\+\_\+t@{ompi\+\_\+op\+\_\+c\+\_\+handler\+\_\+fn\+\_\+t}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+c\+\_\+handler\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S typedef void() ompi\+\_\+op\+\_\+c\+\_\+handler\+\_\+fn\+\_\+t (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{, }
\item[{void $\ast$}]{, }
\item[{int $\ast$}]{, }
\item[{struct {\bf ompi\+\_\+datatype\+\_\+t} $\ast$$\ast$}]{}
\end{DoxyParamCaption}
)}}\label{op_2op_8h_aabf1815275628eb477e4693d7b206487}


Typedef for C op functions for user-\/defined M\+P\+I\+\_\+\+Ops. 

We don't use M\+P\+I\+\_\+\+User\+\_\+function because this would create a confusing dependency loop between this file and \hyperlink{mpi_8h_source}{mpi.\+h}. So this is repeated code, but it's better this way (and this typedef will never change, so there's not much of a maintenance worry). \hypertarget{op_2op_8h_ae5d04af1a69db7a8c5c4946657ed7501}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+create\+\_\+user@{ompi\+\_\+op\+\_\+create\+\_\+user}}
\index{ompi\+\_\+op\+\_\+create\+\_\+user@{ompi\+\_\+op\+\_\+create\+\_\+user}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+create\+\_\+user}]{\setlength{\rightskip}{0pt plus 5cm}{\bf ompi\+\_\+op\+\_\+t}$\ast$ ompi\+\_\+op\+\_\+create\+\_\+user (
\begin{DoxyParamCaption}
\item[{bool}]{commute, }
\item[{{\bf ompi\+\_\+op\+\_\+fortran\+\_\+handler\+\_\+fn\+\_\+t}}]{func}
\end{DoxyParamCaption}
)}}\label{op_2op_8h_ae5d04af1a69db7a8c5c4946657ed7501}


Create a \hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} with a user-\/defined callback (vs. 

creating an intrinsic \hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t}).


\begin{DoxyParams}{Parameters}
{\em commute} & Boolean indicating whether the operation is communative or not \\
\hline
{\em func} & \hyperlink{structFunction}{Function} pointer of the error handler\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
op Pointer to the \hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} that will be created and returned
\end{DoxyReturn}
This function is called as the back-\/end of all the M\+P\+I\+\_\+\+O\+P\+\_\+\+C\+R\+E\+A\+T\+E function. It creates a new \hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} object, initializes it to the correct object type, and sets the callback function on it.

The type of the function pointer is (arbitrarily) the fortran function handler type. Since this function has to accept 2 different function pointer types (lest we have 2 different functions to create errhandlers), the fortran one was picked arbitrarily. Note that (void$\ast$) is not sufficient because at least theoretically, a sizeof(void$\ast$) may not necessarily be the same as sizeof(void($\ast$)).

N\+O\+T\+E\+: It {\itshape always} sets the \char`\"{}fortran\char`\"{} flag to false. The Fortran wrapper for M\+P\+I\+\_\+\+O\+P\+\_\+\+C\+R\+E\+A\+T\+E is expected to reset this flag to true manually. 

References ompi\+\_\+op\+\_\+t\+::fort\+\_\+fn, ompi\+\_\+op\+\_\+t\+::o\+\_\+f\+\_\+to\+\_\+c\+\_\+index, ompi\+\_\+op\+\_\+t\+::o\+\_\+flags, ompi\+\_\+op\+\_\+t\+::o\+\_\+func, O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+A\+S\+S\+O\+C, and O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+C\+O\+M\+M\+U\+T\+E.

\hypertarget{op_2op_8h_ab00519a114816bb73c0972f103980b65}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+finalize@{ompi\+\_\+op\+\_\+finalize}}
\index{ompi\+\_\+op\+\_\+finalize@{ompi\+\_\+op\+\_\+finalize}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+finalize}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+op\+\_\+finalize (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{op_2op_8h_ab00519a114816bb73c0972f103980b65}


Finalize the op interface. 

\begin{DoxyReturn}{Returns}
O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S Always
\end{DoxyReturn}
Invokes from \hyperlink{mpiruntime_8h_a657cd1789f5cbe7dbb711f6c836398e6}{ompi\+\_\+mpi\+\_\+finalize()}; tears down the op interface, and destroys the F2\+C translation table. 

References O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T, and O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E.



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

\hypertarget{op_2op_8h_a6270277920ea2e39d8fd20cf4e24a036}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+init@{ompi\+\_\+op\+\_\+init}}
\index{ompi\+\_\+op\+\_\+init@{ompi\+\_\+op\+\_\+init}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+init}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+op\+\_\+init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{op_2op_8h_a6270277920ea2e39d8fd20cf4e24a036}


Initialize the op interface. 

\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 Otherwise
\end{DoxyReturn}
Invoked from \hyperlink{mpiruntime_8h_a6352a08abfa7bd8a402a866ecebec0f3}{ompi\+\_\+mpi\+\_\+init()}; sets up the op interface, creates the predefined M\+P\+I operations, and creates the corresopnding F2\+C translation table. 

References O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+F\+O\+R\+T\+R\+A\+N\+\_\+\+B\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\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+L\+O\+N\+G\+\_\+\+I\+N\+T, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+R\+E\+A\+L, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+S\+H\+O\+R\+T\+\_\+\+I\+N\+T, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+U\+I\+N\+T16\+\_\+\+T, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+U\+I\+N\+T32\+\_\+\+T, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+U\+I\+N\+T64\+\_\+\+T, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+U\+I\+N\+T8\+\_\+\+T, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+W\+C\+H\+A\+R, and ompi\+\_\+op\+\_\+ddt\+\_\+map.



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

\hypertarget{op_2op_8h_af6fae8ed6a4be8f2492f7f967bd946e7}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+is\+\_\+commute@{ompi\+\_\+op\+\_\+is\+\_\+commute}}
\index{ompi\+\_\+op\+\_\+is\+\_\+commute@{ompi\+\_\+op\+\_\+is\+\_\+commute}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+is\+\_\+commute}]{\setlength{\rightskip}{0pt plus 5cm}static bool ompi\+\_\+op\+\_\+is\+\_\+commute (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+op\+\_\+t} $\ast$}]{op}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{op_2op_8h_af6fae8ed6a4be8f2492f7f967bd946e7}


Check to see if an op is communative or not. 


\begin{DoxyParams}{Parameters}
{\em op} & The op to check\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true If the op is communative 

false If the op is not communative
\end{DoxyReturn}
Self-\/explanitory. This is needed in a few top-\/level M\+P\+I functions; this function is provided to hide the internal structure field names. 

References ompi\+\_\+op\+\_\+t\+::o\+\_\+flags, and O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+C\+O\+M\+M\+U\+T\+E.

\hypertarget{op_2op_8h_ab87f288b76a3fc2c0ff86208df30aeb5}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+is\+\_\+float\+\_\+assoc@{ompi\+\_\+op\+\_\+is\+\_\+float\+\_\+assoc}}
\index{ompi\+\_\+op\+\_\+is\+\_\+float\+\_\+assoc@{ompi\+\_\+op\+\_\+is\+\_\+float\+\_\+assoc}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+is\+\_\+float\+\_\+assoc}]{\setlength{\rightskip}{0pt plus 5cm}static bool ompi\+\_\+op\+\_\+is\+\_\+float\+\_\+assoc (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+op\+\_\+t} $\ast$}]{op}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{op_2op_8h_ab87f288b76a3fc2c0ff86208df30aeb5}


Check to see if an op is floating point associative or not. 


\begin{DoxyParams}{Parameters}
{\em op} & The op to check\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true If the op is floating point associative 

false If the op is not floating point associative
\end{DoxyReturn}
Self-\/explanitory. This is needed in a few top-\/level M\+P\+I functions; this function is provided to hide the internal structure field names. 

References ompi\+\_\+op\+\_\+t\+::o\+\_\+flags, and O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+F\+L\+O\+A\+T\+\_\+\+A\+S\+S\+O\+C.



Referenced by mca\+\_\+coll\+\_\+sm\+\_\+reduce\+\_\+intra().

\hypertarget{op_2op_8h_afc1f2a52ae244e5968d144b6a2fc4c43}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+is\+\_\+intrinsic@{ompi\+\_\+op\+\_\+is\+\_\+intrinsic}}
\index{ompi\+\_\+op\+\_\+is\+\_\+intrinsic@{ompi\+\_\+op\+\_\+is\+\_\+intrinsic}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+is\+\_\+intrinsic}]{\setlength{\rightskip}{0pt plus 5cm}static bool ompi\+\_\+op\+\_\+is\+\_\+intrinsic (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+op\+\_\+t} $\ast$}]{op}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{op_2op_8h_afc1f2a52ae244e5968d144b6a2fc4c43}


Check to see if an op is intrinsic. 


\begin{DoxyParams}{Parameters}
{\em op} & The op to check\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true If the op is intrinsic 

false If the op is not intrinsic
\end{DoxyReturn}
Self-\/explanitory. This is needed in a few top-\/level M\+P\+I functions; this function is provided to hide the internal structure field names. 

References ompi\+\_\+op\+\_\+t\+::o\+\_\+flags, and O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+I\+N\+T\+R\+I\+N\+S\+I\+C.



Referenced by mca\+\_\+coll\+\_\+sm\+\_\+reduce\+\_\+intra(), and ompi\+\_\+op\+\_\+is\+\_\+valid().

\hypertarget{op_2op_8h_aee9a54810e493df81fca673bd2ba47a1}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+is\+\_\+valid@{ompi\+\_\+op\+\_\+is\+\_\+valid}}
\index{ompi\+\_\+op\+\_\+is\+\_\+valid@{ompi\+\_\+op\+\_\+is\+\_\+valid}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+is\+\_\+valid}]{\setlength{\rightskip}{0pt plus 5cm}static bool ompi\+\_\+op\+\_\+is\+\_\+valid (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+op\+\_\+t} $\ast$}]{op, }
\item[{{\bf ompi\+\_\+datatype\+\_\+t} $\ast$}]{ddt, }
\item[{char $\ast$$\ast$}]{msg, }
\item[{const char $\ast$}]{func}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{op_2op_8h_aee9a54810e493df81fca673bd2ba47a1}


Check to see if an op is valid on a given datatype. 


\begin{DoxyParams}{Parameters}
{\em op} & The op to check \\
\hline
{\em ddt} & The datatype to check\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true If the op is valid on that datatype 

false If the op is not valid on that datatype
\end{DoxyReturn}
Self-\/explanitory. This is needed in a few top-\/level M\+P\+I functions; this function is provided to hide the internal structure field names. 

References ompi\+\_\+datatype\+\_\+t\+::id, ompi\+\_\+op\+\_\+t\+::intrinsic, ompi\+\_\+datatype\+\_\+t\+::name, ompi\+\_\+op\+\_\+t\+::o\+\_\+func, ompi\+\_\+op\+\_\+t\+::o\+\_\+name, ompi\+\_\+op\+\_\+ddt\+\_\+map, and ompi\+\_\+op\+\_\+is\+\_\+intrinsic().

\hypertarget{op_2op_8h_acdca390988d83a445ab467feba25bea7}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+reduce@{ompi\+\_\+op\+\_\+reduce}}
\index{ompi\+\_\+op\+\_\+reduce@{ompi\+\_\+op\+\_\+reduce}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+reduce}]{\setlength{\rightskip}{0pt plus 5cm}static void ompi\+\_\+op\+\_\+reduce (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+op\+\_\+t} $\ast$}]{op, }
\item[{void $\ast$}]{source, }
\item[{void $\ast$}]{target, }
\item[{int}]{count, }
\item[{{\bf ompi\+\_\+datatype\+\_\+t} $\ast$}]{dtype}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{op_2op_8h_acdca390988d83a445ab467feba25bea7}


Perform a reduction operation. 


\begin{DoxyParams}{Parameters}
{\em op} & The operation (I\+N) \\
\hline
{\em source} & Source (input) buffer (I\+N) \\
\hline
{\em target} & Target (output) buffer (I\+N/\+O\+U\+T) \\
\hline
{\em count} & Number of elements (I\+N) \\
\hline
{\em dtype} & M\+P\+I datatype (I\+N)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void As with M\+P\+I user-\/defined reduction functions, there is no return code from this function.
\end{DoxyReturn}
Perform a reduction operation with count elements of type dtype in the buffers source and target. The target buffer obtains the result (i.\+e., the original values in the target buffer are reduced with the values in the source buffer and the result is stored in the target buffer).

This function figures out which reduction operation function to invoke and whether to invoke it with C-\/ or Fortran-\/style invocation methods. If the op is intrinsic and has the operation defined for dtype, the appropriate back-\/end function will be invoked. Otherwise, the op is assumed to be a user op and the first function pointer in the op array will be used.

N\+O\+T\+E\+: This function assumes that a correct combination will be given to it; it makes no provision for errors (in the name of optimization). If you give it an intrinsic op with a datatype that is not defined to have that operation, it is likely to seg fault. 

References ompi\+\_\+op\+\_\+t\+::c\+\_\+fn, ompi\+\_\+op\+\_\+t\+::cxx\+\_\+data, ompi\+\_\+datatype\+\_\+t\+::d\+\_\+f\+\_\+to\+\_\+c\+\_\+index, ompi\+\_\+op\+\_\+t\+::fort\+\_\+fn, ompi\+\_\+datatype\+\_\+t\+::id, ompi\+\_\+op\+\_\+t\+::intrinsic, ompi\+\_\+op\+\_\+t\+::o\+\_\+flags, ompi\+\_\+op\+\_\+t\+::o\+\_\+func, ompi\+\_\+op\+\_\+ddt\+\_\+map, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+C\+X\+X\+\_\+\+F\+U\+N\+C, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+F\+O\+R\+T\+R\+A\+N\+\_\+\+F\+U\+N\+C, and O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+I\+N\+T\+R\+I\+N\+S\+I\+C.



Referenced by ompi\+\_\+osc\+\_\+base\+\_\+process\+\_\+op().

\hypertarget{op_2op_8h_a98a939205f29c7b58f7566224b68405a}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+set\+\_\+cxx\+\_\+callback@{ompi\+\_\+op\+\_\+set\+\_\+cxx\+\_\+callback}}
\index{ompi\+\_\+op\+\_\+set\+\_\+cxx\+\_\+callback@{ompi\+\_\+op\+\_\+set\+\_\+cxx\+\_\+callback}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+set\+\_\+cxx\+\_\+callback}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void ompi\+\_\+op\+\_\+set\+\_\+cxx\+\_\+callback (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+op\+\_\+t} $\ast$}]{op, }
\item[{M\+P\+I\+\_\+\+User\+\_\+function $\ast$}]{fn}
\end{DoxyParamCaption}
)}}\label{op_2op_8h_a98a939205f29c7b58f7566224b68405a}


Mark an M\+P\+I\+\_\+\+Op as holding a C++ callback function, and cache that function in the M\+P\+I\+\_\+\+Op. 

See a lenghty comment in ompi/mpi/cxx/op.\+c\+::ompi\+\_\+mpi\+\_\+cxx\+\_\+op\+\_\+intercept() for a full expalantion. 

References ompi\+\_\+op\+\_\+t\+::cxx\+\_\+data, ompi\+\_\+op\+\_\+t\+::fort\+\_\+fn, ompi\+\_\+op\+\_\+t\+::o\+\_\+flags, ompi\+\_\+op\+\_\+t\+::o\+\_\+func, and O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+F\+L\+A\+G\+S\+\_\+\+C\+X\+X\+\_\+\+F\+U\+N\+C.



\subsection{Variable Documentation}
\hypertarget{op_2op_8h_aa034d01affe5dc2f08cbff17890c5251}{\index{op/op.\+h@{op/op.\+h}!ompi\+\_\+op\+\_\+ddt\+\_\+map@{ompi\+\_\+op\+\_\+ddt\+\_\+map}}
\index{ompi\+\_\+op\+\_\+ddt\+\_\+map@{ompi\+\_\+op\+\_\+ddt\+\_\+map}!op/op.\+h@{op/op.\+h}}
\subsubsection[{ompi\+\_\+op\+\_\+ddt\+\_\+map}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int ompi\+\_\+op\+\_\+ddt\+\_\+map\mbox{[}O\+M\+P\+I\+\_\+\+D\+A\+T\+A\+T\+Y\+P\+E\+\_\+\+M\+A\+X\+\_\+\+P\+R\+E\+D\+E\+F\+I\+N\+E\+D\mbox{]}}}\label{op_2op_8h_aa034d01affe5dc2f08cbff17890c5251}


Array to map ddt-\/$>$id values to the corresponding position in the op function array. 

N\+O\+T\+E\+: It is possible to have an implementation without this map. There are basically 3 choices for implementing \char`\"{}how to find the
right position in the op array based on the datatype\char`\"{}\+:


\begin{DoxyEnumerate}
\item Use the exact same ordering as ddt-\/$>$id in the op map. This is nice in that it's always a direct lookup via one memory de-\/reference. But it makes a sparse op array, and it's at least somewhat wasteful. It also chains the ddt and op implementations together. If the ddt ever changes its ordering, op is screwed. It seemed safer from a maintenance point of view not to do it that way.
\item Re-\/arrange the ddt I\+D values so that all the reducable types are at the beginning. This means that we can have a dense array here in op, but then we have the same problem as number one -- and so this didn't seem like a good idea from a maintenance point of view.
\item Create a mapping between the ddt-\/$>$id values and the position in the op array. This allows a nice dense op array, and if we make the map based on symbolic values, then if ddt ever changes its ordering, it won't matter to op. This seemed like the safest thing to do from a maintenance perspective, and since it only costs one extra lookup, and that lookup is way cheaper than the function call to invoke the reduction operation, it seemed like the best idea. 
\end{DoxyEnumerate}

Referenced by ompi\+\_\+3buff\+\_\+op\+\_\+reduce(), ompi\+\_\+op\+\_\+init(), ompi\+\_\+op\+\_\+is\+\_\+valid(), and ompi\+\_\+op\+\_\+reduce().

