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


Back-\/end M\+P\+I attribute engine.  


{\ttfamily \#include \char`\"{}ompi\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/attribute/attribute.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/class/opal\+\_\+bitmap.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/threads/mutex.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/util/opal\+\_\+sos.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/constants.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/datatype/ompi\+\_\+datatype.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/communicator/communicator.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/win/win.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/mpi/f77/fint\+\_\+2\+\_\+int.\+h\char`\"{}}\\*
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structattribute__value__t}{attribute\+\_\+value\+\_\+t}
\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\hypertarget{attribute_8c_a6d4909b6e36b0dcafe1127925795f968}{\#define {\bfseries A\+T\+T\+R\+\_\+\+T\+A\+B\+L\+E\+\_\+\+S\+I\+Z\+E}~10}\label{attribute_8c_a6d4909b6e36b0dcafe1127925795f968}

\item 
\hypertarget{attribute_8c_a428327e949f2e49abb710d84eb0a7372}{\#define {\bfseries M\+P\+I\+\_\+\+D\+A\+T\+A\+T\+Y\+P\+E\+\_\+\+N\+U\+L\+L\+\_\+\+C\+O\+P\+Y\+\_\+\+F\+N}~M\+P\+I\+\_\+\+T\+Y\+P\+E\+\_\+\+N\+U\+L\+L\+\_\+\+C\+O\+P\+Y\+\_\+\+F\+N}\label{attribute_8c_a428327e949f2e49abb710d84eb0a7372}

\item 
\hypertarget{attribute_8c_af8f24104f94e7bb5ff0f0e6163a2f183}{\#define {\bfseries attr\+\_\+communicator\+\_\+f}~c\+\_\+f\+\_\+to\+\_\+c\+\_\+index}\label{attribute_8c_af8f24104f94e7bb5ff0f0e6163a2f183}

\item 
\hypertarget{attribute_8c_ab0d5f73bf46988e9b731a459287d5520}{\#define {\bfseries attr\+\_\+datatype\+\_\+f}~d\+\_\+f\+\_\+to\+\_\+c\+\_\+index}\label{attribute_8c_ab0d5f73bf46988e9b731a459287d5520}

\item 
\hypertarget{attribute_8c_a4a9bbb361a441349a8b2206862fc72d2}{\#define {\bfseries attr\+\_\+win\+\_\+f}~w\+\_\+f\+\_\+to\+\_\+c\+\_\+index}\label{attribute_8c_a4a9bbb361a441349a8b2206862fc72d2}

\item 
\hypertarget{attribute_8c_a236b63d7429f41ab0a018a17713e46e3}{\#define {\bfseries C\+R\+E\+A\+T\+E\+\_\+\+K\+E\+Y}(key)~\hyperlink{opal__bitmap_8h_a0f77c8302095dc04724734d40a71e826}{opal\+\_\+bitmap\+\_\+find\+\_\+and\+\_\+set\+\_\+first\+\_\+unset\+\_\+bit}(key\+\_\+bitmap, (key))}\label{attribute_8c_a236b63d7429f41ab0a018a17713e46e3}

\item 
\hypertarget{attribute_8c_a97898975c8032765ddd378dd61e37a7d}{\#define {\bfseries F\+R\+E\+E\+\_\+\+K\+E\+Y}(key)~\hyperlink{opal__bitmap_8h_afd189ce9320c6682afe665be3b79ae3f}{opal\+\_\+bitmap\+\_\+clear\+\_\+bit}(key\+\_\+bitmap, (key))}\label{attribute_8c_a97898975c8032765ddd378dd61e37a7d}

\item 
\hypertarget{attribute_8c_aea33441ebf57387f780535fcce2b176d}{\#define {\bfseries D\+E\+L\+E\+T\+E\+\_\+\+A\+T\+T\+R\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+S}(type, attribute, keyval\+\_\+obj, object)}\label{attribute_8c_aea33441ebf57387f780535fcce2b176d}

\item 
\hypertarget{attribute_8c_a4dac53373ee3438c4ab4450ccd564fd9}{\#define {\bfseries C\+O\+P\+Y\+\_\+\+A\+T\+T\+R\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+S}(type, old\+\_\+object, keyval\+\_\+obj, in\+\_\+attr, new\+\_\+object, out\+\_\+attr)}\label{attribute_8c_a4dac53373ee3438c4ab4450ccd564fd9}

\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{attribute_8c_a46703a935a086b18e48c485437149273}{typedef enum \\*
ompi\+\_\+attribute\+\_\+translate\+\_\+t {\bfseries ompi\+\_\+attribute\+\_\+translate\+\_\+t}}\label{attribute_8c_a46703a935a086b18e48c485437149273}

\item 
\hypertarget{attribute_8c_ad7d549b326839b492379708328ab9a89}{typedef struct \hyperlink{structattribute__value__t}{attribute\+\_\+value\+\_\+t} {\bfseries attribute\+\_\+value\+\_\+t}}\label{attribute_8c_ad7d549b326839b492379708328ab9a89}

\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
\hypertarget{attribute_8c_a8245f434d1e0e18961d1c0998db78f9c}{enum {\bfseries ompi\+\_\+attribute\+\_\+translate\+\_\+t} \{ {\bfseries O\+M\+P\+I\+\_\+\+A\+T\+T\+R\+I\+B\+U\+T\+E\+\_\+\+C}, 
{\bfseries O\+M\+P\+I\+\_\+\+A\+T\+T\+R\+I\+B\+U\+T\+E\+\_\+\+F\+O\+R\+T\+R\+A\+N\+\_\+\+M\+P\+I1}, 
{\bfseries O\+M\+P\+I\+\_\+\+A\+T\+T\+R\+I\+B\+U\+T\+E\+\_\+\+F\+O\+R\+T\+R\+A\+N\+\_\+\+M\+P\+I2}
 \}}\label{attribute_8c_a8245f434d1e0e18961d1c0998db78f9c}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{attribute_8c_a4ce93dd460de27e6f9bcee607bbc3a5e}{static void {\bfseries attribute\+\_\+value\+\_\+construct} (\hyperlink{structattribute__value__t}{attribute\+\_\+value\+\_\+t} $\ast$item)}\label{attribute_8c_a4ce93dd460de27e6f9bcee607bbc3a5e}

\item 
\hypertarget{attribute_8c_afb057fbadbf12af1e351e5f007406413}{static void {\bfseries ompi\+\_\+attribute\+\_\+keyval\+\_\+construct} (\hyperlink{structompi__attribute__keyval__t}{ompi\+\_\+attribute\+\_\+keyval\+\_\+t} $\ast$keyval)}\label{attribute_8c_afb057fbadbf12af1e351e5f007406413}

\item 
\hypertarget{attribute_8c_ac0fa01e0518ecbc635595f012e20c085}{static void {\bfseries ompi\+\_\+attribute\+\_\+keyval\+\_\+destruct} (\hyperlink{structompi__attribute__keyval__t}{ompi\+\_\+attribute\+\_\+keyval\+\_\+t} $\ast$keyval)}\label{attribute_8c_ac0fa01e0518ecbc635595f012e20c085}

\item 
\hypertarget{attribute_8c_afe07954f82eab080f3892d0c5e2d870f}{static int {\bfseries set\+\_\+value} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, void $\ast$object, \hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$$\ast$attr\+\_\+hash, int key, \hyperlink{structattribute__value__t}{attribute\+\_\+value\+\_\+t} $\ast$new\+\_\+attr, bool predefined)}\label{attribute_8c_afe07954f82eab080f3892d0c5e2d870f}

\item 
\hypertarget{attribute_8c_a3b08ec7e8b564eeb8d0e21c0e20eab73}{static int {\bfseries get\+\_\+value} (\hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$attr\+\_\+hash, int key, \hyperlink{structattribute__value__t}{attribute\+\_\+value\+\_\+t} $\ast$$\ast$attribute, int $\ast$flag)}\label{attribute_8c_a3b08ec7e8b564eeb8d0e21c0e20eab73}

\item 
\hypertarget{attribute_8c_a9e30ca3d87d8c1576e441346615bbe3c}{static void $\ast$ {\bfseries translate\+\_\+to\+\_\+c} (\hyperlink{structattribute__value__t}{attribute\+\_\+value\+\_\+t} $\ast$val)}\label{attribute_8c_a9e30ca3d87d8c1576e441346615bbe3c}

\item 
\hypertarget{attribute_8c_a04e3f0f51301fa70db400aaea71609ca}{static M\+P\+I\+\_\+\+Fint {\bfseries translate\+\_\+to\+\_\+fortran\+\_\+mpi1} (\hyperlink{structattribute__value__t}{attribute\+\_\+value\+\_\+t} $\ast$val)}\label{attribute_8c_a04e3f0f51301fa70db400aaea71609ca}

\item 
\hypertarget{attribute_8c_a4a635314fef1568c87e4aa20f2863942}{static M\+P\+I\+\_\+\+Aint {\bfseries translate\+\_\+to\+\_\+fortran\+\_\+mpi2} (\hyperlink{structattribute__value__t}{attribute\+\_\+value\+\_\+t} $\ast$val)}\label{attribute_8c_a4a635314fef1568c87e4aa20f2863942}

\item 
\hypertarget{attribute_8c_a307af62a5b8ecd01716f75127977b36e}{static {\bfseries O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E} (\hyperlink{structattribute__value__t}{attribute\+\_\+value\+\_\+t}, \hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t}, attribute\+\_\+value\+\_\+construct, N\+U\+L\+L)}\label{attribute_8c_a307af62a5b8ecd01716f75127977b36e}

\item 
\hypertarget{attribute_8c_a9436c2d9b6444ea9cce5e2afe11a6b90}{static {\bfseries O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E} (\hyperlink{structompi__attribute__keyval__t}{ompi\+\_\+attribute\+\_\+keyval\+\_\+t}, \hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t}, ompi\+\_\+attribute\+\_\+keyval\+\_\+construct, ompi\+\_\+attribute\+\_\+keyval\+\_\+destruct)}\label{attribute_8c_a9436c2d9b6444ea9cce5e2afe11a6b90}

\item 
int \hyperlink{attribute_8c_a9af9a68c2b8a68390caa36a39b91354b}{ompi\+\_\+attr\+\_\+init} (void)
\begin{DoxyCompactList}\small\item\em Initialize the main attribute hash that stores the keyvals and meta data. \end{DoxyCompactList}\item 
\hypertarget{attribute_8c_ad12ed051215ac3226c2137c4675e5b2d}{int \hyperlink{attribute_8c_ad12ed051215ac3226c2137c4675e5b2d}{ompi\+\_\+attr\+\_\+finalize} (void)}\label{attribute_8c_ad12ed051215ac3226c2137c4675e5b2d}

\begin{DoxyCompactList}\small\item\em Destroy the main attribute hash that stores the keyvals and meta data. \end{DoxyCompactList}\item 
\hypertarget{attribute_8c_ae126bbe36cb8edd86da17b73a9e03a1d}{static int {\bfseries ompi\+\_\+attr\+\_\+create\+\_\+keyval\+\_\+impl} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, \hyperlink{unionompi__attribute__fn__ptr__union__t}{ompi\+\_\+attribute\+\_\+fn\+\_\+ptr\+\_\+union\+\_\+t} copy\+\_\+attr\+\_\+fn, \hyperlink{unionompi__attribute__fn__ptr__union__t}{ompi\+\_\+attribute\+\_\+fn\+\_\+ptr\+\_\+union\+\_\+t} delete\+\_\+attr\+\_\+fn, int $\ast$key, \hyperlink{unionompi__attribute__fortran__ptr__t}{ompi\+\_\+attribute\+\_\+fortran\+\_\+ptr\+\_\+t} $\ast$extra\+\_\+state, int flags, void $\ast$bindings\+\_\+extra\+\_\+state)}\label{attribute_8c_ae126bbe36cb8edd86da17b73a9e03a1d}

\item 
int \hyperlink{attribute_8c_aea81ff4da2ceacadc2e9995f6b246f61}{ompi\+\_\+attr\+\_\+create\+\_\+keyval} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, \hyperlink{unionompi__attribute__fn__ptr__union__t}{ompi\+\_\+attribute\+\_\+fn\+\_\+ptr\+\_\+union\+\_\+t} copy\+\_\+attr\+\_\+fn, \hyperlink{unionompi__attribute__fn__ptr__union__t}{ompi\+\_\+attribute\+\_\+fn\+\_\+ptr\+\_\+union\+\_\+t} delete\+\_\+attr\+\_\+fn, int $\ast$key, void $\ast$extra\+\_\+state, int flags, void $\ast$bindings\+\_\+extra\+\_\+state)
\begin{DoxyCompactList}\small\item\em Create a new key for use by attribute of Comm/\+Win/\+Datatype. \end{DoxyCompactList}\item 
\hypertarget{attribute_8c_afaf568dc0180f228da010b37a718f0a8}{int \hyperlink{attribute_8c_afaf568dc0180f228da010b37a718f0a8}{ompi\+\_\+attr\+\_\+create\+\_\+keyval\+\_\+fint} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, \hyperlink{unionompi__attribute__fn__ptr__union__t}{ompi\+\_\+attribute\+\_\+fn\+\_\+ptr\+\_\+union\+\_\+t} copy\+\_\+attr\+\_\+fn, \hyperlink{unionompi__attribute__fn__ptr__union__t}{ompi\+\_\+attribute\+\_\+fn\+\_\+ptr\+\_\+union\+\_\+t} delete\+\_\+attr\+\_\+fn, int $\ast$key, M\+P\+I\+\_\+\+Fint extra\+\_\+state, int flags, void $\ast$bindings\+\_\+extra\+\_\+state)}\label{attribute_8c_afaf568dc0180f228da010b37a718f0a8}

\begin{DoxyCompactList}\small\item\em Same as ompi\+\_\+attr\+\_\+create\+\_\+keyval, but extra\+\_\+state is a Fortran default integer. \end{DoxyCompactList}\item 
\hypertarget{attribute_8c_a9fe42d92b8f65711a125dc112dee7d7c}{int \hyperlink{attribute_8c_a9fe42d92b8f65711a125dc112dee7d7c}{ompi\+\_\+attr\+\_\+create\+\_\+keyval\+\_\+aint} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, \hyperlink{unionompi__attribute__fn__ptr__union__t}{ompi\+\_\+attribute\+\_\+fn\+\_\+ptr\+\_\+union\+\_\+t} copy\+\_\+attr\+\_\+fn, \hyperlink{unionompi__attribute__fn__ptr__union__t}{ompi\+\_\+attribute\+\_\+fn\+\_\+ptr\+\_\+union\+\_\+t} delete\+\_\+attr\+\_\+fn, int $\ast$key, M\+P\+I\+\_\+\+Aint extra\+\_\+state, int flags, void $\ast$bindings\+\_\+extra\+\_\+state)}\label{attribute_8c_a9fe42d92b8f65711a125dc112dee7d7c}

\begin{DoxyCompactList}\small\item\em Same as ompi\+\_\+attr\+\_\+create\+\_\+keyval, but extra\+\_\+state is a Fortran address integer. \end{DoxyCompactList}\item 
int \hyperlink{attribute_8c_aec63e9a7d16f157bad607be9e9d69248}{ompi\+\_\+attr\+\_\+free\+\_\+keyval} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, int $\ast$key, bool predefined)
\begin{DoxyCompactList}\small\item\em Free an attribute keyval. \end{DoxyCompactList}\item 
int \hyperlink{attribute_8c_ab1ef737fff5361c48b9ef9893b450fc6}{ompi\+\_\+attr\+\_\+delete} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, void $\ast$object, \hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$attr\+\_\+hash, int key, bool predefined)
\begin{DoxyCompactList}\small\item\em Delete an attribute on the comm/win/datatype. \end{DoxyCompactList}\item 
int \hyperlink{attribute_8c_adbbad00337bf503cd1c6cfa3b1d15506}{ompi\+\_\+attr\+\_\+set\+\_\+c} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, void $\ast$object, \hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$$\ast$attr\+\_\+hash, int key, void $\ast$attribute, bool predefined)
\begin{DoxyCompactList}\small\item\em Set an attribute on the comm/win/datatype in a form valid for C. \end{DoxyCompactList}\item 
int \hyperlink{attribute_8c_aa97a2d135a210f0ecde71198b3c1ff08}{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi1} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, void $\ast$object, \hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$$\ast$attr\+\_\+hash, int key, M\+P\+I\+\_\+\+Fint attribute, bool predefined)
\begin{DoxyCompactList}\small\item\em Set an attribute on the comm/win/datatype in a form valid for Fortran M\+P\+I-\/1. \end{DoxyCompactList}\item 
int \hyperlink{attribute_8c_a57f317d5959101de8b128bd2c42b83f1}{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi2} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, void $\ast$object, \hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$$\ast$attr\+\_\+hash, int key, M\+P\+I\+\_\+\+Aint attribute, bool predefined)
\begin{DoxyCompactList}\small\item\em Set an attribute on the comm/win/datatype in a form valid for Fortran M\+P\+I-\/2. \end{DoxyCompactList}\item 
int \hyperlink{attribute_8c_a32e79f1f06ac8f339fe76a714bcba46f}{ompi\+\_\+attr\+\_\+get\+\_\+c} (\hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$attr\+\_\+hash, int key, void $\ast$$\ast$attribute, int $\ast$flag)
\begin{DoxyCompactList}\small\item\em Get an attribute on the comm/win/datatype in a form valid for C. \end{DoxyCompactList}\item 
int \hyperlink{attribute_8c_a9736954f77096d0b7bd3856904b1c594}{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi1} (\hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$attr\+\_\+hash, int key, M\+P\+I\+\_\+\+Fint $\ast$attribute, int $\ast$flag)
\begin{DoxyCompactList}\small\item\em Get an attribute on the comm/win/datatype in a form valid for Fortran M\+P\+I-\/1. \end{DoxyCompactList}\item 
int \hyperlink{attribute_8c_aede0586a83ebd543ee5b4380512c7219}{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi2} (\hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$attr\+\_\+hash, int key, M\+P\+I\+\_\+\+Aint $\ast$attribute, int $\ast$flag)
\begin{DoxyCompactList}\small\item\em Get an attribute on the comm/win/datatype in a form valid for Fortran M\+P\+I-\/2. \end{DoxyCompactList}\item 
int \hyperlink{attribute_8c_a09ccefae7ea24e42d519c37b0822b4a2}{ompi\+\_\+attr\+\_\+copy\+\_\+all} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, void $\ast$old\+\_\+object, void $\ast$new\+\_\+object, \hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$oldattr\+\_\+hash, \hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$newattr\+\_\+hash)
\begin{DoxyCompactList}\small\item\em This to be used from functions like M\+P\+I\+\_\+$\ast$\+\_\+\+D\+U\+P inorder to copy all the attributes from the old Comm/\+Win/\+Dtype object to a new object. \end{DoxyCompactList}\item 
int \hyperlink{attribute_8c_a21612af8393a68f3b1872e1b52617d26}{ompi\+\_\+attr\+\_\+delete\+\_\+all} (\hyperlink{attribute_8h_a8b9b36acf517ee908e6c95232ee4b7fd}{ompi\+\_\+attribute\+\_\+type\+\_\+t} type, void $\ast$object, \hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$attr\+\_\+hash)
\begin{DoxyCompactList}\small\item\em This to be used to delete all the attributes from the Comm/\+Win/\+Dtype object in one shot. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\hypertarget{attribute_8c_acc2e07f2fea7ce498b11e75f78b1a4a5}{static \hyperlink{structopal__hash__table__t}{opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$ {\bfseries keyval\+\_\+hash}}\label{attribute_8c_acc2e07f2fea7ce498b11e75f78b1a4a5}

\item 
\hypertarget{attribute_8c_a09d9448be3673c370a41afb8ba37430a}{static \hyperlink{structopal__bitmap__t}{opal\+\_\+bitmap\+\_\+t} $\ast$ {\bfseries key\+\_\+bitmap}}\label{attribute_8c_a09d9448be3673c370a41afb8ba37430a}

\item 
\hypertarget{attribute_8c_a23f6f2d1990d2d33663d211040550559}{static unsigned int {\bfseries int\+\_\+pos} = 12345}\label{attribute_8c_a23f6f2d1990d2d33663d211040550559}

\item 
\hypertarget{attribute_8c_a7f5ab9706f35b46c046f08b3a8e949b1}{static \hyperlink{structopal__mutex__t}{opal\+\_\+mutex\+\_\+t} {\bfseries keyval\+\_\+hash\+\_\+lock}}\label{attribute_8c_a7f5ab9706f35b46c046f08b3a8e949b1}

\item 
\hypertarget{attribute_8c_a65d25e2abe817a8e93ced61ec79acaa2}{static \hyperlink{structopal__mutex__t}{opal\+\_\+mutex\+\_\+t} {\bfseries attr\+\_\+hash\+\_\+lock}}\label{attribute_8c_a65d25e2abe817a8e93ced61ec79acaa2}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Back-\/end M\+P\+I attribute engine. 

This is complicated enough that it deserves a lengthy discussion of what is happening. This is extremely complicated stuff, paired with the fact that it is not described well in the M\+P\+I standard. There are several places in the standard that should be read about attributes\+:

M\+P\+I-\/1\+: Section 5.\+7 (pp 167-\/173) M\+P\+I-\/1\+: Section 7.\+1 (pp 191-\/192) predefined attributes in M\+P\+I-\/1 M\+P\+I-\/2\+: Section 4.\+12.\+7 (pp 57-\/59) interlanguage attribute clarifications M\+P\+I-\/2\+: Section 6.\+2.\+2 (pp 112) window predefined attributes M\+P\+I-\/2\+: Section 8.\+8 (pp 198-\/208) new attribute caching functions

After reading all of this, note the following\+:


\begin{DoxyItemize}
\item C M\+P\+I-\/1 and M\+P\+I-\/2 attribute functions and functionality are identical except for their function names.
\item Fortran M\+P\+I-\/1 and M\+P\+I-\/2 attribute functions and functionality are different (namely\+: the parameters are different sizes, both in the functions and the user callbacks, and the assignments to the different sized types occur differently \mbox{[}e.\+g., truncation and sign extension\mbox{]})
\item C functions store values by reference (i.\+e., writing an attribute means writing a pointer to an instance of something; changing the value of that instance will make it visible to anyone who reads that attribute value).
\item Fortran functions store values by value (i.\+e., writing an attribute value means that anyone who reads that attribute value will not be able to affect the value read by anyone else).
\item The predefined attribute M\+P\+I\+\_\+\+W\+I\+N\+\_\+\+B\+A\+S\+E seems to flaunt the rules designated by the rest of the standard; it is handled specifically in the M\+P\+I\+\_\+\+W\+I\+N\+\_\+\+G\+E\+T\+\_\+\+A\+T\+T\+R binding functions (see the comments in there for an explanation).
\item M\+P\+I-\/2 4.\+12.\+7\+:Example 4.\+13 (p58) is wrong. The C-\/$>$Fortran example should have the Fortran \char`\"{}val\char`\"{} variable equal to \&I.
\end{DoxyItemize}

By the first two of these, there are 9 possible use cases -- 3 possibilities for writing an attribute value, each of which has 3 possibilities for reading that value back. The following lists each of the 9 cases, and what happens in each.

\subsubsection*{Cases where C writes an attribute value\+: }

In all of these cases, a pointer was written by C (e.\+g., a pointer to an int -- but it could have been a pointer to anything, such as a struct). These scenarios each have 2 examples\+:

Example A\+: int foo = 3; M\+P\+I\+\_\+\+Attr\+\_\+put(..., \&foo); Example B\+: struct foo bar; M\+P\+I\+\_\+\+Attr\+\_\+put(..., \&bar);


\begin{DoxyEnumerate}
\item C reads the attribute value. Clearly, this is a \char`\"{}unity\char`\"{} case, and no translation occurs. A pointer is written, and that same pointer is returned.
\end{DoxyEnumerate}

Example A\+: int $\ast$ret; M\+P\+I\+\_\+\+Attr\+\_\+get(..., \&ret); --$>$ $\ast$ret will equal 3 Example B\+: struct foo $\ast$ret; M\+P\+I\+\_\+\+Attr\+\_\+get(..., \&ret); --$>$ $\ast$ret will point to the instance bar that was written


\begin{DoxyEnumerate}
\item Fortran M\+P\+I-\/1 reads the attribute value. The C pointer is cast to a fortran I\+N\+T\+E\+G\+E\+R (i.\+e., M\+P\+I\+\_\+\+Fint) -- potentially being truncated if sizeof(void$\ast$) $>$ sizeof(\+I\+N\+T\+E\+G\+E\+R).
\end{DoxyEnumerate}

Example A\+: I\+N\+T\+E\+G\+E\+R ret C\+A\+L\+L M\+P\+I\+\_\+\+A\+T\+T\+R\+\_\+\+G\+E\+T(..., ret, ierr) --$>$ ret will equal \&foo, possibly truncaed Example B\+: I\+N\+T\+E\+G\+E\+R ret C\+A\+L\+L M\+P\+I\+\_\+\+A\+T\+T\+R\+\_\+\+G\+E\+T(..., ret, ierr) --$>$ ret will equal \&bar, possibly truncaed


\begin{DoxyEnumerate}
\item Fortran M\+P\+I-\/2 reads the attribute value. The C pointer is cast to a fortran 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) (i.\+e., a (M\+P\+I\+\_\+\+Aint)).
\end{DoxyEnumerate}

Example A\+: 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) ret C\+A\+L\+L M\+P\+I\+\_\+\+C\+O\+M\+M\+\_\+\+G\+E\+T\+\_\+\+A\+T\+T\+R(..., ret, ierr) --$>$ ret will equal \&foo Example B\+: 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) ret C\+A\+L\+L M\+P\+I\+\_\+\+C\+O\+M\+M\+\_\+\+G\+E\+T\+\_\+\+A\+T\+T\+R(..., ret, ierr) --$>$ ret will equal \&bar

\subsubsection*{Cases where Fortran M\+P\+I-\/1 writes an attribute value\+: }

In all of these cases, an I\+N\+T\+E\+G\+E\+R is written by Fortran.

Example\+: I\+N\+T\+E\+G\+E\+R F\+O\+O = 7 C\+A\+L\+L M\+P\+I\+\_\+\+A\+T\+T\+R\+\_\+\+P\+U\+T(..., foo, ierr)


\begin{DoxyEnumerate}
\item C reads the attribute value. The value returned is a pointer that points to an I\+N\+T\+E\+G\+E\+R (i.\+e., an M\+P\+I\+\_\+\+Fint) that has a value of 7. --$>$ N\+O\+T\+E\+: The external M\+P\+I interface does not distinguish between this case and case 7. It is the programer's responsibility to code accordingly.
\end{DoxyEnumerate}

Example\+: M\+P\+I\+\_\+\+Fint $\ast$ret; M\+P\+I\+\_\+\+Attr\+\_\+get(..., \&ret); -\/$>$ $\ast$ret will equal 7.


\begin{DoxyEnumerate}
\item Fortran M\+P\+I-\/1 reads the attribute value. This is the unity case; the same value is returned.
\end{DoxyEnumerate}

Example\+: I\+N\+T\+E\+G\+E\+R ret C\+A\+L\+L M\+P\+I\+\_\+\+A\+T\+T\+R\+\_\+\+G\+E\+T(..., ret, ierr) --$>$ ret will equal 7


\begin{DoxyEnumerate}
\item Fortran M\+P\+I-\/2 reads the attribute value. The same value is returned, but potentially sign-\/extended if sizeof(\+I\+N\+T\+E\+G\+E\+R) $<$ sizeof(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)).
\end{DoxyEnumerate}

Example\+: 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) ret C\+A\+L\+L M\+P\+I\+\_\+\+C\+O\+M\+M\+\_\+\+G\+E\+T\+\_\+\+A\+T\+T\+R(..., ret, ierr) --$>$ ret will equal 7

\subsubsection*{Cases where Fortran M\+P\+I-\/2 writes an attribute value\+: }

In all of these cases, an 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) is written by Fortran.

Example A\+: 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) F\+O\+O = 12 C\+A\+L\+L M\+P\+I\+\_\+\+C\+O\+M\+M\+\_\+\+P\+U\+T\+\_\+\+A\+T\+T\+R(..., foo, ierr) Example B\+: // Assume a platform where sizeof(void$\ast$) = 8 and // sizeof(\+I\+N\+T\+E\+G\+E\+R) = 4. 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) F\+O\+O = pow(2, 40) C\+A\+L\+L M\+P\+I\+\_\+\+C\+O\+M\+M\+\_\+\+P\+U\+T\+\_\+\+A\+T\+T\+R(..., foo, ierr)


\begin{DoxyEnumerate}
\item C reads the attribute value. The value returned is a pointer that points to an 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) (i.\+e., a void$\ast$) that has a value of 12. --$>$ N\+O\+T\+E\+: The external M\+P\+I interface does not distinguish between this case and case 4. It is the programer's responsibility to code accordingly.
\end{DoxyEnumerate}

Example A\+: M\+P\+I\+\_\+\+Aint $\ast$ret; M\+P\+I\+\_\+\+Attr\+\_\+get(..., \&ret); -\/$>$ $\ast$ret will equal 12 Example B\+: M\+P\+I\+\_\+\+Aint $\ast$ret; M\+P\+I\+\_\+\+Attr\+\_\+get(..., \&ret); -\/$>$ $\ast$ret will equal 2$^\wedge$40


\begin{DoxyEnumerate}
\item Fortran M\+P\+I-\/1 reads the attribute value. The same value is returned, but potentially truncated if sizeof(\+I\+N\+T\+E\+G\+E\+R) $<$ sizeof(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)).
\end{DoxyEnumerate}

Example A\+: I\+N\+T\+E\+G\+E\+R ret C\+A\+L\+L M\+P\+I\+\_\+\+A\+T\+T\+R\+\_\+\+G\+E\+T(..., ret, ierr) --$>$ ret will equal 12 Example B\+: I\+N\+T\+E\+G\+E\+R ret C\+A\+L\+L M\+P\+I\+\_\+\+A\+T\+T\+R\+\_\+\+G\+E\+T(..., ret, ierr) --$>$ ret will equal 0


\begin{DoxyEnumerate}
\item Fortran M\+P\+I-\/2 reads the attribute value. This is the unity case; the same value is returned.
\end{DoxyEnumerate}

Example A\+: 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) ret C\+A\+L\+L M\+P\+I\+\_\+\+C\+O\+M\+M\+\_\+\+G\+E\+T\+\_\+\+A\+T\+T\+R(..., ret, ierr) --$>$ ret will equal 7 Example B\+: 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) ret C\+A\+L\+L M\+P\+I\+\_\+\+C\+O\+M\+M\+\_\+\+G\+E\+T\+\_\+\+A\+T\+T\+R(..., ret, ierr) --$>$ ret will equal 2$^\wedge$40 

\subsection{Function Documentation}
\hypertarget{attribute_8c_a09ccefae7ea24e42d519c37b0822b4a2}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+copy\+\_\+all@{ompi\+\_\+attr\+\_\+copy\+\_\+all}}
\index{ompi\+\_\+attr\+\_\+copy\+\_\+all@{ompi\+\_\+attr\+\_\+copy\+\_\+all}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+copy\+\_\+all}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+copy\+\_\+all (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+attribute\+\_\+type\+\_\+t}}]{type, }
\item[{void $\ast$}]{old\+\_\+object, }
\item[{void $\ast$}]{new\+\_\+object, }
\item[{{\bf opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$}]{oldattr\+\_\+hash, }
\item[{{\bf opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$}]{newkeyhash}
\end{DoxyParamCaption}
)}}\label{attribute_8c_a09ccefae7ea24e42d519c37b0822b4a2}


This to be used from functions like M\+P\+I\+\_\+$\ast$\+\_\+\+D\+U\+P inorder to copy all the attributes from the old Comm/\+Win/\+Dtype object to a new object. 


\begin{DoxyParams}{Parameters}
{\em type} & Type of attribute (C\+O\+M\+M/\+W\+I\+N/\+D\+T\+Y\+P\+E) (I\+N) \\
\hline
{\em old\+\_\+object} & The old C\+O\+M\+M/\+W\+I\+N/\+D\+T\+Y\+P\+E object (I\+N) \\
\hline
{\em new\+\_\+object} & The new C\+O\+M\+M/\+W\+I\+N/\+D\+T\+Y\+P\+E object (I\+N) \\
\hline
{\em attr\+\_\+hash} & The attribute hash table hanging on old object(\+I\+N) \\
\hline
{\em newattr\+\_\+hash} & The attribute hash table hanging on new object(\+I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+M\+P\+I error code 
\end{DoxyReturn}


References ompi\+\_\+attribute\+\_\+keyval\+\_\+t\+::attr\+\_\+flag, C\+O\+M\+M\+\_\+\+A\+T\+T\+R, O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E, opal\+\_\+hash\+\_\+table\+\_\+get\+\_\+first\+\_\+key\+\_\+uint32(), opal\+\_\+hash\+\_\+table\+\_\+get\+\_\+next\+\_\+key\+\_\+uint32(), opal\+\_\+hash\+\_\+table\+\_\+get\+\_\+value\+\_\+uint32(), O\+P\+A\+L\+\_\+\+T\+H\+R\+E\+A\+D\+\_\+\+L\+O\+C\+K, O\+P\+A\+L\+\_\+\+T\+H\+R\+E\+A\+D\+\_\+\+U\+N\+L\+O\+C\+K, T\+Y\+P\+E\+\_\+\+A\+T\+T\+R, U\+N\+U\+S\+E\+D\+\_\+\+A\+T\+T\+R, and W\+I\+N\+\_\+\+A\+T\+T\+R.

\hypertarget{attribute_8c_aea81ff4da2ceacadc2e9995f6b246f61}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+create\+\_\+keyval@{ompi\+\_\+attr\+\_\+create\+\_\+keyval}}
\index{ompi\+\_\+attr\+\_\+create\+\_\+keyval@{ompi\+\_\+attr\+\_\+create\+\_\+keyval}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+create\+\_\+keyval}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+create\+\_\+keyval (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+attribute\+\_\+type\+\_\+t}}]{type, }
\item[{{\bf ompi\+\_\+attribute\+\_\+fn\+\_\+ptr\+\_\+union\+\_\+t}}]{copy\+\_\+attr\+\_\+fn, }
\item[{{\bf ompi\+\_\+attribute\+\_\+fn\+\_\+ptr\+\_\+union\+\_\+t}}]{delete\+\_\+attr\+\_\+fn, }
\item[{int $\ast$}]{key, }
\item[{void $\ast$}]{extra\+\_\+state, }
\item[{int}]{flags, }
\item[{void $\ast$}]{bindings\+\_\+extra\+\_\+state}
\end{DoxyParamCaption}
)}}\label{attribute_8c_aea81ff4da2ceacadc2e9995f6b246f61}


Create a new key for use by attribute of Comm/\+Win/\+Datatype. 


\begin{DoxyParams}{Parameters}
{\em type} & Type of attribute (C\+O\+M\+M/\+W\+I\+N/\+D\+T\+Y\+P\+E) (I\+N) \\
\hline
{\em copy\+\_\+attr\+\_\+fn} & Union variable containing the function pointer to be used in order to copy the attribute (I\+N) \\
\hline
{\em delete\+\_\+attr\+\_\+fn} & \hyperlink{structFunction}{Function} pointer to be used for deleting the attribute (I\+N) \\
\hline
{\em key} & The newly created key is returned here (O\+U\+T) \\
\hline
{\em extra\+\_\+state} & Extra state to hang off/do some special things (I\+N) \\
\hline
{\em flags} & Flags for the key -- flags contain O\+M\+P\+I\+\_\+\+K\+E\+Y\+V\+A\+L\+\_\+\+F77, O\+M\+P\+I\+\_\+\+K\+E\+Y\+V\+A\+L\+\_\+\+P\+R\+E\+D\+E\+F\+I\+N\+E\+D \\
\hline
{\em bindings\+\_\+extra\+\_\+state} & Extra state that, if non-\/\+N\+U\+L\+L, will automatically be free()'ed by the C base when the keyval is destroyed.\\
\hline
\end{DoxyParams}
N\+O\+T\+E\+: I have taken the assumption that user cannot modify/delete any predefined keys or the attributes attached. To accomplish this, all M\+P\+I$\ast$ calls will have O\+M\+P\+I\+\_\+\+K\+E\+Y\+V\+A\+L\+\_\+\+P\+R\+E\+D\+E\+F\+I\+N\+E\+D set as 0. M\+P\+I implementors who will need to play with the predefined keys and attributes would call the ompi$\ast$ functions here and not the M\+P\+I$\ast$ functions, with O\+M\+P\+I\+\_\+\+K\+E\+Y\+V\+A\+L\+\_\+\+P\+R\+E\+D\+E\+F\+I\+N\+E\+D set to 1. E\+N\+D O\+F N\+O\+T\+E

N\+O\+T\+E\+: For the function pointers, you need to create a variable of the union type \char`\"{}ompi\+\_\+attribute\+\_\+fn\+\_\+ptr\+\_\+union\+\_\+t\char`\"{} and assign the proper field. to be passed into this function E\+N\+D O\+F N\+O\+T\+E

\begin{DoxyReturn}{Returns}
O\+M\+P\+I return code 
\end{DoxyReturn}
\hypertarget{attribute_8c_ab1ef737fff5361c48b9ef9893b450fc6}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+delete@{ompi\+\_\+attr\+\_\+delete}}
\index{ompi\+\_\+attr\+\_\+delete@{ompi\+\_\+attr\+\_\+delete}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+delete}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+delete (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+attribute\+\_\+type\+\_\+t}}]{type, }
\item[{void $\ast$}]{object, }
\item[{{\bf opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$}]{attr\+\_\+hash, }
\item[{int}]{key, }
\item[{bool}]{predefined}
\end{DoxyParamCaption}
)}}\label{attribute_8c_ab1ef737fff5361c48b9ef9893b450fc6}


Delete an attribute on the comm/win/datatype. 


\begin{DoxyParams}{Parameters}
{\em type} & Type of attribute (C\+O\+M\+M/\+W\+I\+N/\+D\+T\+Y\+P\+E) (I\+N) \\
\hline
{\em object} & The actual Comm/\+Win/\+Datatype object (I\+N) \\
\hline
{\em attr\+\_\+hash} & The attribute hash table hanging on the object(\+I\+N) \\
\hline
{\em key} & Key val for the attribute (I\+N) \\
\hline
{\em predefined} & Whether the key is predefined or not 0/1 (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+M\+P\+I error code 
\end{DoxyReturn}


References ompi\+\_\+attribute\+\_\+keyval\+\_\+t\+::attr\+\_\+flag, ompi\+\_\+attribute\+\_\+keyval\+\_\+t\+::attr\+\_\+type, C\+O\+M\+M\+\_\+\+A\+T\+T\+R, O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E, opal\+\_\+hash\+\_\+table\+\_\+get\+\_\+value\+\_\+uint32(), opal\+\_\+hash\+\_\+table\+\_\+remove\+\_\+value\+\_\+uint32(), O\+P\+A\+L\+\_\+\+T\+H\+R\+E\+A\+D\+\_\+\+L\+O\+C\+K, O\+P\+A\+L\+\_\+\+T\+H\+R\+E\+A\+D\+\_\+\+U\+N\+L\+O\+C\+K, T\+Y\+P\+E\+\_\+\+A\+T\+T\+R, and W\+I\+N\+\_\+\+A\+T\+T\+R.



Referenced by ompi\+\_\+attr\+\_\+delete\+\_\+all().

\hypertarget{attribute_8c_a21612af8393a68f3b1872e1b52617d26}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+delete\+\_\+all@{ompi\+\_\+attr\+\_\+delete\+\_\+all}}
\index{ompi\+\_\+attr\+\_\+delete\+\_\+all@{ompi\+\_\+attr\+\_\+delete\+\_\+all}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+delete\+\_\+all}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+delete\+\_\+all (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+attribute\+\_\+type\+\_\+t}}]{type, }
\item[{void $\ast$}]{object, }
\item[{{\bf opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$}]{attr\+\_\+hash}
\end{DoxyParamCaption}
)}}\label{attribute_8c_a21612af8393a68f3b1872e1b52617d26}


This to be used to delete all the attributes from the Comm/\+Win/\+Dtype object in one shot. 


\begin{DoxyParams}{Parameters}
{\em type} & Type of attribute (C\+O\+M\+M/\+W\+I\+N/\+D\+T\+Y\+P\+E) (I\+N) \\
\hline
{\em object} & The C\+O\+M\+M/\+W\+I\+N/\+D\+T\+Y\+P\+E object (I\+N) \\
\hline
{\em attr\+\_\+hash} & The attribute hash table hanging on the object(\+I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+M\+P\+I error code 
\end{DoxyReturn}


References ompi\+\_\+attr\+\_\+delete(), opal\+\_\+hash\+\_\+table\+\_\+get\+\_\+first\+\_\+key\+\_\+uint32(), opal\+\_\+hash\+\_\+table\+\_\+get\+\_\+next\+\_\+key\+\_\+uint32(), O\+P\+A\+L\+\_\+\+T\+H\+R\+E\+A\+D\+\_\+\+L\+O\+C\+K, and O\+P\+A\+L\+\_\+\+T\+H\+R\+E\+A\+D\+\_\+\+U\+N\+L\+O\+C\+K.



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

\hypertarget{attribute_8c_aec63e9a7d16f157bad607be9e9d69248}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+free\+\_\+keyval@{ompi\+\_\+attr\+\_\+free\+\_\+keyval}}
\index{ompi\+\_\+attr\+\_\+free\+\_\+keyval@{ompi\+\_\+attr\+\_\+free\+\_\+keyval}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+free\+\_\+keyval}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+free\+\_\+keyval (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+attribute\+\_\+type\+\_\+t}}]{type, }
\item[{int $\ast$}]{key, }
\item[{bool}]{predefined}
\end{DoxyParamCaption}
)}}\label{attribute_8c_aec63e9a7d16f157bad607be9e9d69248}


Free an attribute keyval. 


\begin{DoxyParams}{Parameters}
{\em type} & Type of attribute (C\+O\+M\+M/\+W\+I\+N/\+D\+T\+Y\+P\+E) (I\+N) \\
\hline
{\em key} & key, which is set to M\+P\+I\+\_\+\+K\+E\+Y\+\_\+\+I\+N\+V\+A\+L\+I\+D (I\+N/\+O\+U\+T) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+M\+P\+I error code 
\end{DoxyReturn}


References ompi\+\_\+attribute\+\_\+keyval\+\_\+t\+::attr\+\_\+flag, ompi\+\_\+attribute\+\_\+keyval\+\_\+t\+::attr\+\_\+type, O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E, opal\+\_\+hash\+\_\+table\+\_\+get\+\_\+value\+\_\+uint32(), O\+P\+A\+L\+\_\+\+T\+H\+R\+E\+A\+D\+\_\+\+L\+O\+C\+K, and O\+P\+A\+L\+\_\+\+T\+H\+R\+E\+A\+D\+\_\+\+U\+N\+L\+O\+C\+K.

\hypertarget{attribute_8c_a32e79f1f06ac8f339fe76a714bcba46f}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+get\+\_\+c@{ompi\+\_\+attr\+\_\+get\+\_\+c}}
\index{ompi\+\_\+attr\+\_\+get\+\_\+c@{ompi\+\_\+attr\+\_\+get\+\_\+c}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+get\+\_\+c}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+get\+\_\+c (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$}]{attr\+\_\+hash, }
\item[{int}]{key, }
\item[{void $\ast$$\ast$}]{attribute, }
\item[{int $\ast$}]{flag}
\end{DoxyParamCaption}
)}}\label{attribute_8c_a32e79f1f06ac8f339fe76a714bcba46f}


Get an attribute on the comm/win/datatype in a form valid for C. 


\begin{DoxyParams}{Parameters}
{\em attr\+\_\+hash} & The attribute hash table hanging on the object(\+I\+N) \\
\hline
{\em key} & Key val for the attribute (I\+N) \\
\hline
{\em attribute} & The actual attribute pointer (O\+U\+T) \\
\hline
{\em flag} & Flag whether an attribute is associated with the key (O\+U\+T) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+M\+P\+I error code
\end{DoxyReturn}
All three of these functions (\hyperlink{attribute_8h_a32e79f1f06ac8f339fe76a714bcba46f}{ompi\+\_\+attr\+\_\+get\+\_\+c()}, \hyperlink{attribute_8h_ad5e23a8ed029291551dc73d221ab091e}{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi1()}, and \hyperlink{attribute_8h_a98bd41d2f5d86561643857809bdad43e}{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi2()}) could have been combined into one function that took some kind of (void$\ast$) and an enum to indicate which way to translate the final representation, but that just seemed to make an already complicated situation more complicated through yet another layer of indirection.

So yes, this is more code, but it's clearer and less error-\/prone (read\+: better) this way. \hypertarget{attribute_8c_a9736954f77096d0b7bd3856904b1c594}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi1@{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi1}}
\index{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi1@{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi1}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi1}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi1 (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$}]{attr\+\_\+hash, }
\item[{int}]{key, }
\item[{M\+P\+I\+\_\+\+Fint $\ast$}]{attribute, }
\item[{int $\ast$}]{flag}
\end{DoxyParamCaption}
)}}\label{attribute_8c_a9736954f77096d0b7bd3856904b1c594}


Get an attribute on the comm/win/datatype in a form valid for Fortran M\+P\+I-\/1. 


\begin{DoxyParams}{Parameters}
{\em attr\+\_\+hash} & The attribute hash table hanging on the object(\+I\+N) \\
\hline
{\em key} & Key val for the attribute (I\+N) \\
\hline
{\em attribute} & The actual attribute pointer (O\+U\+T) \\
\hline
{\em flag} & Flag whether an attribute is associated with the key (O\+U\+T) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+M\+P\+I error code
\end{DoxyReturn}
All three of these functions (\hyperlink{attribute_8h_a32e79f1f06ac8f339fe76a714bcba46f}{ompi\+\_\+attr\+\_\+get\+\_\+c()}, \hyperlink{attribute_8h_ad5e23a8ed029291551dc73d221ab091e}{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi1()}, and \hyperlink{attribute_8h_a98bd41d2f5d86561643857809bdad43e}{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi2()}) could have been combined into one function that took some kind of (void$\ast$) and an enum to indicate which way to translate the final representation, but that just seemed to make an already complicated situation more complicated through yet another layer of indirection.

So yes, this is more code, but it's clearer and less error-\/prone (read\+: better) this way. \hypertarget{attribute_8c_aede0586a83ebd543ee5b4380512c7219}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi2@{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi2}}
\index{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi2@{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi2}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi2}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi2 (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$}]{attr\+\_\+hash, }
\item[{int}]{key, }
\item[{M\+P\+I\+\_\+\+Aint $\ast$}]{attribute, }
\item[{int $\ast$}]{flag}
\end{DoxyParamCaption}
)}}\label{attribute_8c_aede0586a83ebd543ee5b4380512c7219}


Get an attribute on the comm/win/datatype in a form valid for Fortran M\+P\+I-\/2. 


\begin{DoxyParams}{Parameters}
{\em attrhash} & The attribute hash table hanging on the object(\+I\+N) \\
\hline
{\em key} & Key val for the attribute (I\+N) \\
\hline
{\em attribute} & The actual attribute pointer (O\+U\+T) \\
\hline
{\em flag} & Flag whether an attribute is associated with the key (O\+U\+T) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+M\+P\+I error code
\end{DoxyReturn}
All three of these functions (\hyperlink{attribute_8h_a32e79f1f06ac8f339fe76a714bcba46f}{ompi\+\_\+attr\+\_\+get\+\_\+c()}, \hyperlink{attribute_8h_ad5e23a8ed029291551dc73d221ab091e}{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi1()}, and \hyperlink{attribute_8h_a98bd41d2f5d86561643857809bdad43e}{ompi\+\_\+attr\+\_\+get\+\_\+fortran\+\_\+mpi2()}) could have been combined into one function that took some kind of (void$\ast$) and an enum to indicate which way to translate the final representation, but that just seemed to make an already complicated situation more complicated through yet another layer of indirection.

So yes, this is more code, but it's clearer and less error-\/prone (read\+: better) this way. \hypertarget{attribute_8c_a9af9a68c2b8a68390caa36a39b91354b}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+init@{ompi\+\_\+attr\+\_\+init}}
\index{ompi\+\_\+attr\+\_\+init@{ompi\+\_\+attr\+\_\+init}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+init}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{attribute_8c_a9af9a68c2b8a68390caa36a39b91354b}


Initialize the main attribute hash that stores the keyvals and meta data. 

\begin{DoxyReturn}{Returns}
O\+M\+P\+I return code 
\end{DoxyReturn}


References O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T, opal\+\_\+bitmap\+\_\+init(), opal\+\_\+bitmap\+\_\+set\+\_\+max\+\_\+size(), and opal\+\_\+hash\+\_\+table\+\_\+init().



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

\hypertarget{attribute_8c_adbbad00337bf503cd1c6cfa3b1d15506}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+set\+\_\+c@{ompi\+\_\+attr\+\_\+set\+\_\+c}}
\index{ompi\+\_\+attr\+\_\+set\+\_\+c@{ompi\+\_\+attr\+\_\+set\+\_\+c}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+set\+\_\+c}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+set\+\_\+c (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+attribute\+\_\+type\+\_\+t}}]{type, }
\item[{void $\ast$}]{object, }
\item[{{\bf opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$$\ast$}]{attr\+\_\+hash, }
\item[{int}]{key, }
\item[{void $\ast$}]{attribute, }
\item[{bool}]{predefined}
\end{DoxyParamCaption}
)}}\label{attribute_8c_adbbad00337bf503cd1c6cfa3b1d15506}


Set an attribute on the comm/win/datatype in a form valid for C. 


\begin{DoxyParams}{Parameters}
{\em type} & Type of attribute (C\+O\+M\+M/\+W\+I\+N/\+D\+T\+Y\+P\+E) (I\+N) \\
\hline
{\em object} & The actual Comm/\+Win/\+Datatype object (I\+N) \\
\hline
{\em attr\+\_\+hash} & The attribute hash table hanging on the object(I\+N/\+O\+U\+T) \\
\hline
{\em key} & Key val for the attribute (I\+N) \\
\hline
{\em attribute} & The actual attribute pointer (I\+N) \\
\hline
{\em predefined} & Whether the key is predefined or not 0/1 (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+M\+P\+I error code
\end{DoxyReturn}
If ($\ast$attr\+\_\+hash) == N\+U\+L\+L, a new hash will be created and initialized.

All three of these functions (\hyperlink{attribute_8h_adbbad00337bf503cd1c6cfa3b1d15506}{ompi\+\_\+attr\+\_\+set\+\_\+c()}, \hyperlink{attribute_8h_a007eeee7038acb94515309c30c5012b0}{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi1()}, and \hyperlink{attribute_8h_ab34f09601dba96fd1aa24d1b73518a31}{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi2()}) could have been combined into one function that took some kind of (void$\ast$) and an enum to indicate which way to translate the final representation, but that just seemed to make an already complicated situation more complicated through yet another layer of indirection.

So yes, this is more code, but it's clearer and less error-\/prone (read\+: better) this way. \hypertarget{attribute_8c_aa97a2d135a210f0ecde71198b3c1ff08}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi1@{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi1}}
\index{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi1@{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi1}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi1}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi1 (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+attribute\+\_\+type\+\_\+t}}]{type, }
\item[{void $\ast$}]{object, }
\item[{{\bf opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$$\ast$}]{attr\+\_\+hash, }
\item[{int}]{key, }
\item[{M\+P\+I\+\_\+\+Fint}]{attribute, }
\item[{bool}]{predefined}
\end{DoxyParamCaption}
)}}\label{attribute_8c_aa97a2d135a210f0ecde71198b3c1ff08}


Set an attribute on the comm/win/datatype in a form valid for Fortran M\+P\+I-\/1. 


\begin{DoxyParams}{Parameters}
{\em type} & Type of attribute (C\+O\+M\+M/\+W\+I\+N/\+D\+T\+Y\+P\+E) (I\+N) \\
\hline
{\em object} & The actual Comm/\+Win/\+Datatype object (I\+N) \\
\hline
{\em attr\+\_\+hash} & The attribute hash table hanging on the object(I\+N/\+O\+U\+T) \\
\hline
{\em key} & Key val for the attribute (I\+N) \\
\hline
{\em attribute} & The actual attribute pointer (I\+N) \\
\hline
{\em predefined} & Whether the key is predefined or not 0/1 (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+M\+P\+I error code
\end{DoxyReturn}
If ($\ast$attr\+\_\+hash) == N\+U\+L\+L, a new hash will be created and initialized.

All three of these functions (\hyperlink{attribute_8h_adbbad00337bf503cd1c6cfa3b1d15506}{ompi\+\_\+attr\+\_\+set\+\_\+c()}, \hyperlink{attribute_8h_a007eeee7038acb94515309c30c5012b0}{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi1()}, and \hyperlink{attribute_8h_ab34f09601dba96fd1aa24d1b73518a31}{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi2()}) could have been combined into one function that took some kind of (void$\ast$) and an enum to indicate which way to translate the final representation, but that just seemed to make an already complicated situation more complicated through yet another layer of indirection.

So yes, this is more code, but it's clearer and less error-\/prone (read\+: better) this way. \hypertarget{attribute_8c_a57f317d5959101de8b128bd2c42b83f1}{\index{attribute.\+c@{attribute.\+c}!ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi2@{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi2}}
\index{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi2@{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi2}!attribute.\+c@{attribute.\+c}}
\subsubsection[{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi2}]{\setlength{\rightskip}{0pt plus 5cm}int ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi2 (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+attribute\+\_\+type\+\_\+t}}]{type, }
\item[{void $\ast$}]{object, }
\item[{{\bf opal\+\_\+hash\+\_\+table\+\_\+t} $\ast$$\ast$}]{attr\+\_\+hash, }
\item[{int}]{key, }
\item[{M\+P\+I\+\_\+\+Aint}]{attribute, }
\item[{bool}]{predefined}
\end{DoxyParamCaption}
)}}\label{attribute_8c_a57f317d5959101de8b128bd2c42b83f1}


Set an attribute on the comm/win/datatype in a form valid for Fortran M\+P\+I-\/2. 


\begin{DoxyParams}{Parameters}
{\em type} & Type of attribute (C\+O\+M\+M/\+W\+I\+N/\+D\+T\+Y\+P\+E) (I\+N) \\
\hline
{\em object} & The actual Comm/\+Win/\+Datatype object (I\+N) \\
\hline
{\em attr\+\_\+hash} & The attribute hash table hanging on the object(I\+N/\+O\+U\+T) \\
\hline
{\em key} & Key val for the attribute (I\+N) \\
\hline
{\em attribute} & The actual attribute pointer (I\+N) \\
\hline
{\em predefined} & Whether the key is predefined or not 0/1 (I\+N) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O\+M\+P\+I error code
\end{DoxyReturn}
If ($\ast$attr\+\_\+hash) == N\+U\+L\+L, a new hash will be created and initialized.

All three of these functions (\hyperlink{attribute_8h_adbbad00337bf503cd1c6cfa3b1d15506}{ompi\+\_\+attr\+\_\+set\+\_\+c()}, \hyperlink{attribute_8h_a007eeee7038acb94515309c30c5012b0}{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi1()}, and \hyperlink{attribute_8h_ab34f09601dba96fd1aa24d1b73518a31}{ompi\+\_\+attr\+\_\+set\+\_\+fortran\+\_\+mpi2()}) could have been combined into one function that took some kind of (void$\ast$) and an enum to indicate which way to translate the final representation, but that just seemed to make an already complicated situation more complicated through yet another layer of indirection.

So yes, this is more code, but it's clearer and less error-\/prone (read\+: better) this way. 