\hypertarget{attribute__predefined_8c}{\section{ompi/attribute/attribute\+\_\+predefined.c File Reference}
\label{attribute__predefined_8c}\index{ompi/attribute/attribute\+\_\+predefined.\+c@{ompi/attribute/attribute\+\_\+predefined.\+c}}
}


Setup the predefined attributes in M\+P\+I.  


{\ttfamily \#include \char`\"{}ompi\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}mpi.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/attribute/attribute.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/errhandler/errcode.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/communicator/communicator.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/mca/pml/pml.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}orte/util/proc\+\_\+info.\+h\char`\"{}}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{attribute__predefined_8c_a90078b0a77e5202ee49d76aef3103201}{static int {\bfseries create\+\_\+comm} (int target\+\_\+keyval, bool want\+\_\+inherit)}\label{attribute__predefined_8c_a90078b0a77e5202ee49d76aef3103201}

\item 
\hypertarget{attribute__predefined_8c_abb8fb8e6fa4fc2ee5e8436ba33c170db}{static int {\bfseries free\+\_\+comm} (int keyval)}\label{attribute__predefined_8c_abb8fb8e6fa4fc2ee5e8436ba33c170db}

\item 
\hypertarget{attribute__predefined_8c_abfcfd181791529ee1cb480e8c5e9d815}{static int {\bfseries create\+\_\+win} (int target\+\_\+keyval)}\label{attribute__predefined_8c_abfcfd181791529ee1cb480e8c5e9d815}

\item 
\hypertarget{attribute__predefined_8c_a8751153312c4610ae81a965d0c335c24}{static int {\bfseries free\+\_\+win} (int keyval)}\label{attribute__predefined_8c_a8751153312c4610ae81a965d0c335c24}

\item 
\hypertarget{attribute__predefined_8c_a765c4fc08a753ccb184cb2418ac0f16f}{static int {\bfseries set\+\_\+f} (int keyval, M\+P\+I\+\_\+\+Fint value)}\label{attribute__predefined_8c_a765c4fc08a753ccb184cb2418ac0f16f}

\item 
\hypertarget{attribute__predefined_8c_a32ca8203123407d9543774b0a88c85b3}{int {\bfseries ompi\+\_\+attr\+\_\+create\+\_\+predefined} (void)}\label{attribute__predefined_8c_a32ca8203123407d9543774b0a88c85b3}

\item 
\hypertarget{attribute__predefined_8c_abb601687ffa4dd5e6ec3452987470073}{int {\bfseries ompi\+\_\+attr\+\_\+free\+\_\+predefined} (void)}\label{attribute__predefined_8c_abb601687ffa4dd5e6ec3452987470073}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Setup the predefined attributes in M\+P\+I. 

A number of pre-\/defined attributes are created here, most of which are exactly what one would expect, but there are a few exceptions -- so they're documented here.

Predefined attributes are integer-\/valued or address-\/valued (per M\+P\+I-\/2; see section 4.\+12.\+7, keeping in mind that Example 4.\+13 is totally wrong -- see src/attribute/attribute.\+h for a lengthy explanation of this).

The only address-\/valued attribute is M\+P\+I\+\_\+\+W\+I\+N\+\_\+\+B\+A\+S\+E. We treat it as if it were set from C. All other attributes are integer-\/valued. We treat them as if they were set from Fortran M\+P\+I-\/1 (i.\+e., M\+P\+I\+\_\+\+A\+T\+T\+R\+\_\+\+P\+U\+T) or Fortran M\+P\+I-\/2 (i.\+e., M\+P\+I\+\_\+xxx\+\_\+\+A\+T\+T\+R\+\_\+\+S\+E\+T). Most attributes are M\+P\+I-\/1 integer-\/valued, meaning that they are the size of M\+P\+I\+\_\+\+Fint (I\+N\+T\+E\+G\+E\+R). But M\+P\+I\+\_\+\+W\+I\+N\+\_\+\+S\+I\+Z\+E and M\+P\+I\+\_\+\+W\+I\+N\+\_\+\+D\+I\+S\+P\+\_\+\+U\+N\+I\+T are M\+P\+I-\/2 integer-\/valued, meaning that they are the size of M\+P\+I\+\_\+\+Aint (I\+N\+T\+E\+G\+E\+R(K\+I\+N\+D=M\+P\+I\+\_\+\+A\+D\+D\+R\+E\+S\+S\+\_\+\+K\+I\+N\+D)).

M\+P\+I\+\_\+\+T\+A\+G\+\_\+\+U\+B is set to a fixed upper limit.

M\+P\+I\+\_\+\+H\+O\+S\+T is set to M\+P\+I\+\_\+\+P\+R\+O\+C\+\_\+\+N\+U\+L\+L (per M\+P\+I-\/1, see 7.\+1.\+1, p192).

M\+P\+I\+\_\+\+I\+O is set to M\+P\+I\+\_\+\+A\+N\+Y\+\_\+\+S\+O\+U\+R\+C\+E. We may need to revist this.

M\+P\+I\+\_\+\+W\+T\+I\+M\+E\+\_\+\+I\+S\+\_\+\+G\+L\+O\+B\+A\+L is set to 0 (a conservative answer).

M\+P\+I\+\_\+\+A\+P\+P\+N\+U\+M is set as the result of a G\+P\+R subscription.

M\+P\+I\+\_\+\+L\+A\+S\+T\+U\+S\+E\+D\+C\+O\+D\+E is set to an initial value and is reset every time M\+P\+I\+\_\+\+A\+D\+D\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+L\+A\+S\+S or M\+P\+I\+\_\+\+A\+D\+D\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+O\+D\+E is invoked. Its copy function is set to M\+P\+I\+\_\+\+C\+O\+M\+M\+\_\+\+N\+U\+L\+L\+\_\+\+C\+O\+P\+Y\+\_\+\+F\+N, meaning that {\itshape only} M\+P\+I\+\_\+\+C\+O\+M\+M\+\_\+\+W\+O\+R\+L\+D will have this attribute value. As such, we only have to update M\+P\+I\+\_\+\+C\+O\+M\+M\+\_\+\+W\+O\+R\+L\+D when this value changes (i.\+e., since this is an integer-\/valued attribute, we have to update this attribute on every communicator -- using N\+U\+L\+L\+\_\+\+C\+O\+P\+Y\+\_\+\+F\+N ensures that only M\+P\+I\+\_\+\+C\+O\+M\+M\+\_\+\+W\+O\+R\+L\+D has this attribute value set).

M\+P\+I\+\_\+\+U\+N\+I\+V\+E\+R\+S\+E\+\_\+\+S\+I\+Z\+E is set as the result of a G\+P\+R subscription.

M\+P\+I\+\_\+\+W\+I\+N\+\_\+\+B\+A\+S\+E is an address-\/valued attribute, and is set directly from M\+P\+I\+\_\+\+W\+I\+N\+\_\+\+C\+R\+E\+A\+T\+E. M\+P\+I\+\_\+\+W\+I\+N\+\_\+\+S\+I\+Z\+E and M\+P\+I\+\_\+\+W\+I\+N\+\_\+\+D\+I\+S\+P\+\_\+\+U\+N\+I\+T are both integer-\/valued attributes, {\itshape B\+U\+T} at least the M\+P\+I\+\_\+\+W\+I\+N\+\_\+\+S\+I\+Z\+E is an M\+P\+I\+\_\+\+Aint, so in terms of consistency, both should be the same -- hence, we treat them as M\+P\+I-\/2 Fortran integer-\/valued attributes. All three of these atrributes have N\+U\+L\+L\+\_\+\+C\+O\+P\+Y\+\_\+\+F\+N copy functions; it doesn't make sense to copy them to new windows (because they're values specific and unique to each window) -- especially when W\+I\+N\+\_\+\+C\+R\+E\+A\+T\+E will explicitly set them on new windows anyway.

These are not supported yet, but are included here for consistency\+:

M\+P\+I\+\_\+\+I\+M\+P\+I\+\_\+\+C\+L\+I\+E\+N\+T\+\_\+\+S\+I\+Z\+E, M\+P\+I\+\_\+\+I\+M\+P\+I\+\_\+\+C\+L\+I\+E\+N\+T\+\_\+\+C\+O\+L\+O\+R, M\+P\+I\+\_\+\+I\+M\+P\+I\+\_\+\+H\+O\+S\+T\+\_\+\+S\+I\+Z\+E, and M\+P\+I\+\_\+\+I\+M\+P\+I\+\_\+\+H\+O\+S\+T\+\_\+\+C\+O\+L\+O\+R are integer-\/valued attributes. 