Skip to content

Commit c4f8f26

Browse files
rhc54jjhursey
andauthored
Add a directive indicating that a reqd attribute has been processed (#322)
* Add a directive indicating that a reqd attribute has been processed Each level (client, server, host) needs to know if some prior level has already processed a required attribute so it can correctly deal with it. Define an info directive for that purpose, and provide macros to set and test for that directive. Signed-off-by: Ralph Castain <[email protected]> Co-authored-by: Josh Hursey <[email protected]>
1 parent 8d276a3 commit c4f8f26

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed

Chap_API_Server.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,10 +2019,12 @@ \section{Server Function Pointers}
20192019

20202020
\ac{PMIx} utilizes a "function-shipping" approach to support for implementing the server-side of the protocol. This method allows \acp{RM} to implement the server without being burdened with \ac{PMIx} internal details. When a request is received from the client, the corresponding server function will be called with the information.
20212021

2022-
Any functions not supported by the \ac{RM} can be indicated by a \code{NULL} for the function pointer. \ac{PMIx} implementations are required to return a \refconst{PMIX_ERR_NOT_SUPPORTED} status to all calls to functions that require host environment support and are not backed by a corresponding server module entry.
2022+
Any functions not supported by the \ac{RM} can be indicated by a \code{NULL} for the function pointer. \ac{PMIx} implementations are required to return a \refconst{PMIX_ERR_NOT_SUPPORTED} status to all calls to functions that require host environment support and are not backed by a corresponding server module entry. Host environments may, if they choose, include a function pointer for operations they have not yet implemented and simply return \refconst{PMIX_ERR_NOT_SUPPORTED}.
2023+
2024+
Functions that accept directives (i.e., arrays of \refstruct{pmix_info_t} structures) must check any provided directives for those marked as \emph{required} via the \refconst{PMIX_INFO_REQD} flag. \ac{PMIx} client and server libraries are required to mark any such directives with the \refconst{PMIX_INFO_REQD_PROCESSED} flag should they have handled the request. Any required directive that has not been marked therefore becomes the responsibility of the host environment. If a required directive that hasn't been processed by a lower level cannot be supported by the host, then the \refconst{PMIX_ERR_NOT_SUPPORTED} error constant must be returned. If the directive can be processed by the host, then the host shall do so and mark the attribute with the \refconst{PMIX_INFO_REQD_PROCESSED} flag.
20232025

20242026
The host \ac{RM} will provide the function pointers in a \refapi{pmix_server_module_t} structure passed to \refapi{PMIx_server_init}.
2025-
That module structure and associated function references are defined in this section.
2027+
The module structure and associated function references are defined in this section.
20262028

20272029
\advicermstart
20282030
For performance purposes, the host server is required to return as quickly as possible from all functions. Execution of

Chap_API_Struct.tex

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,9 @@ \subsection{Info Type Directives}
14551455
\declareconstitem{PMIX_INFO_REQD}
14561456
The behavior defined in the \refstruct{pmix_info_t} array is required, and not optional. This is a bit-mask value.
14571457
%
1458+
\declareconstitemNEW{PMIX_INFO_REQD_PROCESSED}
1459+
Mark that this required attribute has been processed. A required attribute can be handled at any level - the \ac{PMIx} client library might take care of it, or it may be resolved by the \ac{PMIx} server library, or it may pass up to the host environment for handling. If a level does not recognize or support the required attribute, it is required to pass it upwards to give the next level an opportunity to process it. Thus, the host environment (or the server library if the host does not support the given operation) must know if a lower level has handled the requirement so it can return a \refconst{PMIX_ERR_NOT_SUPPORTED} error status if the host itself cannot meet the request. Upon processing the request, the level must therefore mark the attribute with this directive to alert any subsequent levels that the requirement has been met.
1460+
%
14581461
\declareconstitem{PMIX_INFO_ARRAY_END}
14591462
Mark that this \refstruct{pmix_info_t} struct is at the end of an array created by the \refmacro{PMIX_INFO_CREATE} macro. This is a bit-mask value.
14601463
%
@@ -1548,6 +1551,44 @@ \subsubsection{Info Directive support macros}
15481551

15491552
Test the \refconst{PMIX_INFO_REQD} flag in a \refstruct{pmix_info_t} structure, returning \code{true} if the flag is \textit{not} set.
15501553

1554+
%%%%%%%%%%%
1555+
\littleheader{Mark a required attribute as processed}
1556+
\declaremacro{PMIX_INFO_PROCESSED}
1557+
1558+
Mark that a required \refstruct{pmix_info_t} structure has been processed.
1559+
1560+
\versionMarker{4.0}
1561+
\cspecificstart
1562+
\begin{codepar}
1563+
PMIX_INFO_PROCESSED(info);
1564+
\end{codepar}
1565+
\cspecificend
1566+
1567+
\begin{arglist}
1568+
\argin{info}{Pointer to the \refstruct{pmix_info_t} (pointer to \refstruct{pmix_info_t})}
1569+
\end{arglist}
1570+
1571+
Set the \refconst{PMIX_INFO_REQD_PROCESSED} flag in a \refstruct{pmix_info_t} structure indicating that is has been processed.
1572+
1573+
%%%%%%%%%%%
1574+
\littleheader{Test if a required attribute has been processed}
1575+
\declaremacro{PMIX_INFO_WAS_PROCESSED}
1576+
1577+
Test that a required \refstruct{pmix_info_t} structure has been processed.
1578+
1579+
\versionMarker{4.0}
1580+
\cspecificstart
1581+
\begin{codepar}
1582+
PMIX_INFO_WAS_PROCESSED(info);
1583+
\end{codepar}
1584+
\cspecificend
1585+
1586+
\begin{arglist}
1587+
\argin{info}{Pointer to the \refstruct{pmix_info_t} (pointer to \refstruct{pmix_info_t})}
1588+
\end{arglist}
1589+
1590+
Test the \refconst{PMIX_INFO_REQD_PROCESSED} flag in a \refstruct{pmix_info_t} structure.
1591+
15511592
%%%%%%%%%%%
15521593
\littleheader{Test an info structure for \textit{end of array} directive}
15531594
\declaremacro{PMIX_INFO_IS_END}

Chap_Revisions.tex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,10 @@ \subsection{Added Constants}
604604
\refconst{PMIX_DATA_TYPE_MAX} \\
605605
\refconst{PMIX_COMPRESSED_BYTE_OBJECT} \\
606606

607+
%
608+
\littleheader{Info directives}
609+
\refconst{PMIX_INFO_REQD_PROCESSED} \\
610+
607611
%
608612
\littleheader{Server constants}
609613
\refconst{PMIX_ERR_REPEAT_ATTR_REGISTRATION} \\
@@ -880,6 +884,8 @@ \subsection{Added Environmental Variables}
880884
\subsection{Added Macros}
881885
%
882886
\refmacro{PMIX_CHECK_RESERVED_KEY}
887+
\refmacro{PMIX_INFO_WAS_PROCESSED}
888+
\refmacro{PMIX_INFO_PROCESSED}
883889
\refmacro{PMIX_INFO_LIST_START}
884890
\refmacro{PMIX_INFO_LIST_ADD}
885891
\refmacro{PMIX_INFO_LIST_XFER}

0 commit comments

Comments
 (0)