Skip to content

Commit

Permalink
Add value and info APIs
Browse files Browse the repository at this point in the history
Add two APIs for estimating the size of value and info objects.
 - PMIx_Value_get_size
 - PMIx_Info_get_size

Add two info list APIs.
 - PMIx_Info_list_prepend
 - PMIx_Info_list_get_info

See openpmix/openpmix#2896. Fixes #455.

Signed-off-by: Ken Raffenetti <[email protected]>
  • Loading branch information
raffenet committed Aug 14, 2023
1 parent 24e8561 commit e0a7be5
Showing 1 changed file with 138 additions and 0 deletions.
138 changes: 138 additions & 0 deletions Chap_API_Struct.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,39 @@ \subsubsection{Value structure support}
\argin{n}{Number of structures in the array (\code{size_t})}
\end{arglist}

%%%%%%%%%%%
\littleheader{Get size of data in a value structure}
\declareapiProvisional{PMIx_Value_get_size}

%%%%
\summary

Compute and return the size (in bytes) of the data payload in a \refstruct{pmix_value_t} structure.

%%%%
\format

\versionMarker{5.1}
\cspecificstart
\begin{codepar}
pmix_status_t
PMIx_Value_get_size(const pmix_value_t *val,
size_t *size);
\end{codepar}
\cspecificend

\begin{arglist}
\argin{val}{The \refstruct{pmix_value_t} where the data is located (pointer to \refstruct{pmix_value_t})}
\argin{size}{Pointer to variable where size will be returned}
\end{arglist}

Returns \refconst{PMIX_SUCCESS} or a negative value corresponding to a PMIx error constant.

%%%%
\descr

Compute and return the size (in bytes) of the data payload in a \refstruct{pmix_value_t} structure.

%%%%%%%%%%%
\littleheader{Load a value structure}
\declareapi{PMIx_Value_load}
Expand Down Expand Up @@ -1274,6 +1307,39 @@ \subsubsection{Info structure support macros}
\argin{n}{Number of structures in the array (\code{size_t})}
\end{arglist}

%%%%%%%%%%%
\littleheader{Get size of data in an info structure}
\declareapiProvisional{PMIx_Info_get_size}

%%%%
\summary

Compute and return the size (in bytes) of the data payload in an \refstruct{pmix_info_t} structure.

%%%%
\format

\versionMarker{5.1}
\cspecificstart
\begin{codepar}
pmix_status_t
PMIx_Info_get_size(const pmix_info_t *info,
size_t *size);
\end{codepar}
\cspecificend

\begin{arglist}
\argin{info}{The \refstruct{pmix_info_t} where the data is located}
\argin{type}{Pointer to variable where size will be returned}
\end{arglist}

Returns \refconst{PMIX_SUCCESS} or a negative value corresponding to a PMIx error constant.

%%%%
\descr

Compute and return the size (in bytes) of the data payload in an \refstruct{pmix_info_t} structure.

%%%%%%%%%%%
\littleheader{Load key and value data into a info struct}
\declareapi{PMIx_Info_load}
Expand Down Expand Up @@ -1431,6 +1497,78 @@ \subsubsection{Info structure list macros}

Copy the provided key and data into a \refstruct{pmix_info_t} on the list. The key and any data stored in the source value can be modified or free'd without affecting the copied data once the function has completed.

%%%%%%%%%%%
\littleheader{Retrieve next \refstruct{pmix_info_t} on a list}
\declareapiProvisional{PMIx_Info_list_get_info}

%%%%
\summary

Retrieve next \refstruct{pmix_info_t} on a list.

%%%%
\format

\versionMarker{5.0}
\cspecificstart
\begin{codepar}
pmix_info_t *
PMIx_Info_list_get_info(void *ptr,
void *prev,
void **next);
\end{codepar}
\cspecificend

\begin{arglist}
\argin{ptr}{A \code{void*} pointer initialized via \refapi{PMIx_Info_list_start} (handle)}
\argin{prev}{Pointer to previous list element}
\argin{next}{Pointer to next list element}
\end{arglist}

Returns \refconst{PMIX_SUCCESS} or a negative value corresponding to a PMIx error constant.

%%%%
\descr

Retrieve the next info on the list. Passing NULL to the prev parameter will return the first pmix_info_t on the list. If next is set to NULL, it indicates the end of the list.

%%%%%%%%%%%
\littleheader{Prepend a \refstruct{pmix_info_t} structure to a list}
\declareapiProvisional{PMIx_Info_list_prepend}

%%%%
\summary

Prepend a \refstruct{pmix_info_t} structure containing the specified value to the provided list.

%%%%
\format

\versionMarker{5.1}
\cspecificstart
\begin{codepar}
pmix_status_t
PMIx_Info_list_add(void *ptr,
const char *key,
const void *value,
pmix_data_type_t type);
\end{codepar}
\cspecificend

\begin{arglist}
\argin{ptr}{A \code{void*} pointer initialized via \refapi{PMIx_Info_list_start} (handle)}
\argin{key}{String key to be loaded - must be less than or equal to \refconst{PMIX_MAX_KEYLEN} in length (handle)}
\argin{value}{Pointer to the data value to be loaded (handle)}
\argin{type}{Type of the provided data value (\refstruct{pmix_data_type_t})}
\end{arglist}

Returns \refconst{PMIX_SUCCESS} or a negative value corresponding to a PMIx error constant.

%%%%
\descr

Copy the provided key and data into a \refstruct{pmix_info_t} at the head of list. The key and any data stored in the source value can be modified or free'd without affecting the copied data once the function has completed.

%%%%%%%%%%%
\littleheader{Transfer a \refstruct{pmix_info_t} structure to a list}
\declareapi{PMIx_Info_list_xfer}
Expand Down

0 comments on commit e0a7be5

Please sign in to comment.