\hypertarget{op__example__module__max_8c}{\section{ompi/mca/op/example/op\+\_\+example\+\_\+module\+\_\+max.c File Reference}
\label{op__example__module__max_8c}\index{ompi/mca/op/example/op\+\_\+example\+\_\+module\+\_\+max.\+c@{ompi/mca/op/example/op\+\_\+example\+\_\+module\+\_\+max.\+c}}
}


This is the max module source code.  


{\ttfamily \#include \char`\"{}ompi\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/class/opal\+\_\+object.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/util/output.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/constants.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/op/op.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/mca/op/op.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/mca/op/base/base.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/mca/op/example/op\+\_\+example.\+h\char`\"{}}\\*
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structmodule__max__t}{module\+\_\+max\+\_\+t}
\begin{DoxyCompactList}\small\item\em Derive a struct from the base op module struct, allowing us to cache some module-\/specific information for M\+A\+X. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{op__example__module__max_8c_acb6b334fdf81045bbca675e83978f2ad}{static void \hyperlink{op__example__module__max_8c_acb6b334fdf81045bbca675e83978f2ad}{module\+\_\+max\+\_\+constructor} (\hyperlink{structmodule__max__t}{module\+\_\+max\+\_\+t} $\ast$m)}\label{op__example__module__max_8c_acb6b334fdf81045bbca675e83978f2ad}

\begin{DoxyCompactList}\small\item\em \char`\"{}\+Constructor\char`\"{} for the max module class \end{DoxyCompactList}\item 
\hypertarget{op__example__module__max_8c_a0c53a0e92aa3a4800ebb413238c16247}{static void \hyperlink{op__example__module__max_8c_a0c53a0e92aa3a4800ebb413238c16247}{module\+\_\+max\+\_\+destructor} (\hyperlink{structmodule__max__t}{module\+\_\+max\+\_\+t} $\ast$m)}\label{op__example__module__max_8c_a0c53a0e92aa3a4800ebb413238c16247}

\begin{DoxyCompactList}\small\item\em \char`\"{}\+Destructor\char`\"{} for the max module class \end{DoxyCompactList}\item 
static \hyperlink{op__example__module__max_8c_a017f19868c760307997a32e94bfd04ef}{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E} (\hyperlink{structmodule__max__t}{module\+\_\+max\+\_\+t}, \hyperlink{structompi__op__base__module__1__0__0__t}{ompi\+\_\+op\+\_\+base\+\_\+module\+\_\+t}, \hyperlink{op__example__module__max_8c_acb6b334fdf81045bbca675e83978f2ad}{module\+\_\+max\+\_\+constructor}, \hyperlink{op__example__module__max_8c_a0c53a0e92aa3a4800ebb413238c16247}{module\+\_\+max\+\_\+destructor})
\begin{DoxyCompactList}\small\item\em Setup the class for the max module, listing\+: \end{DoxyCompactList}\item 
\hypertarget{op__example__module__max_8c_aa8468580b43264fb9e8894ad76654bce}{static void \hyperlink{op__example__module__max_8c_aa8468580b43264fb9e8894ad76654bce}{max\+\_\+float} (void $\ast$in, void $\ast$out, int $\ast$count, \hyperlink{structompi__datatype__t}{ompi\+\_\+datatype\+\_\+t} $\ast$$\ast$type, \hyperlink{structompi__op__base__module__1__0__0__t}{ompi\+\_\+op\+\_\+base\+\_\+module\+\_\+t} $\ast$module)}\label{op__example__module__max_8c_aa8468580b43264fb9e8894ad76654bce}

\begin{DoxyCompactList}\small\item\em Max function for C float. \end{DoxyCompactList}\item 
\hypertarget{op__example__module__max_8c_a8fe37e27f8ea024deb63c80651a7899c}{static void \hyperlink{op__example__module__max_8c_a8fe37e27f8ea024deb63c80651a7899c}{max\+\_\+double} (void $\ast$in, void $\ast$out, int $\ast$count, \hyperlink{structompi__datatype__t}{ompi\+\_\+datatype\+\_\+t} $\ast$$\ast$type, \hyperlink{structompi__op__base__module__1__0__0__t}{ompi\+\_\+op\+\_\+base\+\_\+module\+\_\+t} $\ast$module)}\label{op__example__module__max_8c_a8fe37e27f8ea024deb63c80651a7899c}

\begin{DoxyCompactList}\small\item\em Max function for C double. \end{DoxyCompactList}\item 
\hypertarget{op__example__module__max_8c_a3bcce8c24f1cd3bef169489beb797a78}{static void \hyperlink{op__example__module__max_8c_a3bcce8c24f1cd3bef169489beb797a78}{max\+\_\+real} (void $\ast$in, void $\ast$out, int $\ast$count, \hyperlink{structompi__datatype__t}{ompi\+\_\+datatype\+\_\+t} $\ast$$\ast$type, \hyperlink{structompi__op__base__module__1__0__0__t}{ompi\+\_\+op\+\_\+base\+\_\+module\+\_\+t} $\ast$module)}\label{op__example__module__max_8c_a3bcce8c24f1cd3bef169489beb797a78}

\begin{DoxyCompactList}\small\item\em Max function for Fortran R\+E\+A\+L. \end{DoxyCompactList}\item 
\hypertarget{op__example__module__max_8c_a3265008352bd4dabe73fda1a437e1fdf}{static void \hyperlink{op__example__module__max_8c_a3265008352bd4dabe73fda1a437e1fdf}{max\+\_\+double\+\_\+precision} (void $\ast$in, void $\ast$out, int $\ast$count, \hyperlink{structompi__datatype__t}{ompi\+\_\+datatype\+\_\+t} $\ast$$\ast$type, \hyperlink{structompi__op__base__module__1__0__0__t}{ompi\+\_\+op\+\_\+base\+\_\+module\+\_\+t} $\ast$module)}\label{op__example__module__max_8c_a3265008352bd4dabe73fda1a437e1fdf}

\begin{DoxyCompactList}\small\item\em Max function for Fortran D\+O\+U\+B\+L\+E P\+R\+E\+C\+I\+S\+I\+O\+N. \end{DoxyCompactList}\item 
\hyperlink{structompi__op__base__module__1__0__0__t}{ompi\+\_\+op\+\_\+base\+\_\+module\+\_\+t} $\ast$ \hyperlink{op__example__module__max_8c_a37187b33e427279b5a68b8f3a9f81226}{ompi\+\_\+op\+\_\+example\+\_\+setup\+\_\+max} (\hyperlink{structompi__op__t}{ompi\+\_\+op\+\_\+t} $\ast$op)
\begin{DoxyCompactList}\small\item\em Setup function for M\+P\+I\+\_\+\+M\+A\+X. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This is the max module source code. 

It contains the \char`\"{}setup\char`\"{} functions that will create a module for the M\+P\+I\+\_\+\+M\+A\+X M\+P\+I\+\_\+\+Op. 

\subsection{Function Documentation}
\hypertarget{op__example__module__max_8c_a017f19868c760307997a32e94bfd04ef}{\index{op\+\_\+example\+\_\+module\+\_\+max.\+c@{op\+\_\+example\+\_\+module\+\_\+max.\+c}!O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E@{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E}}
\index{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E@{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E}!op\+\_\+example\+\_\+module\+\_\+max.\+c@{op\+\_\+example\+\_\+module\+\_\+max.\+c}}
\subsubsection[{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E}]{\setlength{\rightskip}{0pt plus 5cm}static O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E (
\begin{DoxyParamCaption}
\item[{{\bf module\+\_\+max\+\_\+t}}]{, }
\item[{{\bf ompi\+\_\+op\+\_\+base\+\_\+module\+\_\+t}}]{, }
\item[{{\bf module\+\_\+max\+\_\+constructor}}]{, }
\item[{{\bf module\+\_\+max\+\_\+destructor}}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{op__example__module__max_8c_a017f19868c760307997a32e94bfd04ef}


Setup the class for the max module, listing\+: 


\begin{DoxyItemize}
\item the name of the class
\item the \char`\"{}parent\char`\"{} of the class
\item function pointer for the constructor (or N\+U\+L\+L)
\item function pointer for the destructor (or N\+U\+L\+L) 
\end{DoxyItemize}\hypertarget{op__example__module__max_8c_a37187b33e427279b5a68b8f3a9f81226}{\index{op\+\_\+example\+\_\+module\+\_\+max.\+c@{op\+\_\+example\+\_\+module\+\_\+max.\+c}!ompi\+\_\+op\+\_\+example\+\_\+setup\+\_\+max@{ompi\+\_\+op\+\_\+example\+\_\+setup\+\_\+max}}
\index{ompi\+\_\+op\+\_\+example\+\_\+setup\+\_\+max@{ompi\+\_\+op\+\_\+example\+\_\+setup\+\_\+max}!op\+\_\+example\+\_\+module\+\_\+max.\+c@{op\+\_\+example\+\_\+module\+\_\+max.\+c}}
\subsubsection[{ompi\+\_\+op\+\_\+example\+\_\+setup\+\_\+max}]{\setlength{\rightskip}{0pt plus 5cm}{\bf ompi\+\_\+op\+\_\+base\+\_\+module\+\_\+t}$\ast$ ompi\+\_\+op\+\_\+example\+\_\+setup\+\_\+max (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+op\+\_\+t} $\ast$}]{op}
\end{DoxyParamCaption}
)}}\label{op__example__module__max_8c_a37187b33e427279b5a68b8f3a9f81226}


Setup function for M\+P\+I\+\_\+\+M\+A\+X. 

Setup for M\+P\+I\+\_\+\+M\+A\+X and return a module.

If we get here, we can assume that a) the hardware is present, b) the M\+P\+I thread scenario is what we want, and c) the M\+A\+X operation is supported. So this function's job is to create a module and fill in function pointers for the functions that this hardware supports. 

References ompi\+\_\+op\+\_\+example\+\_\+component\+\_\+t\+::double\+\_\+supported, ompi\+\_\+op\+\_\+t\+::intrinsic, max\+\_\+double(), max\+\_\+double\+\_\+precision(), max\+\_\+float(), max\+\_\+real(), mca\+\_\+op\+\_\+example\+\_\+component, ompi\+\_\+op\+\_\+t\+::o\+\_\+func, O\+B\+J\+\_\+\+R\+E\+T\+A\+I\+N, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+D\+O\+U\+B\+L\+E, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+D\+O\+U\+B\+L\+E\+\_\+\+P\+R\+E\+C\+I\+S\+I\+O\+N, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+F\+L\+O\+A\+T, O\+M\+P\+I\+\_\+\+O\+P\+\_\+\+B\+A\+S\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+R\+E\+A\+L, and ompi\+\_\+op\+\_\+base\+\_\+module\+\_\+1\+\_\+0\+\_\+0\+\_\+t\+::opm\+\_\+fns.

