Skip to content

Commit 57c7e52

Browse files
committed
Another pass at adding PMIX_DATA_TO_PUBLISH directive
1 parent 43c4079 commit 57c7e52

File tree

1 file changed

+33
-47
lines changed

1 file changed

+33
-47
lines changed

Chap_API_Publish.tex

Lines changed: 33 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,31 @@ \section{\code{PMIx_Publish}}
7676
ranges. Custom ranges are consider different if they have different members.
7777
Duplicate keys being published on the same data range shall return the
7878
\refconst{PMIX_ERR_DUPLICATE_KEY} error.
79+
publishing to a \declareconstitem{PMIX_RANGE_CUSTOM}
80+
range which does not include the publisher will prevent
81+
any processes from using \refapi{PMIX_Lookup} to access the published data.
7982

8083
In some cases, implementations may be incapable of distinguishing which
8184
info keys in the \refarg{info} array are for publishing and which info keys are
8285
directives. To make it clear, it is recommended that the keys to be published
8386
are designated by passing them as a \refstruct{pmix_data_array_t} using the
8487
\refattr{PMIX_DATA_TO_PUBLISH} directive.
85-
86-
For the purpose of distinguishing between info array elements that specify keys and attributes, implementations should attempt to
87-
recognize all standardized attributes to the publish call,
88-
even attributes the implementation does not support. Non-supported attributes
88+
If the \refarg{info} array contains a \refattr{PMIX_DATA_TO_PUBLISH} info,
89+
all other elements of the info array will be treated as directives.
90+
If the info array does not include a \refattr{PMIX_DATA_TO_PUBLISH} info,
91+
the implementation should
92+
distinguishing between info array elements that specify keys and directives as follows:
93+
All standardized directives to the publish call,
94+
including optional attributes the implementation does not support,
95+
should be treated as
96+
directives. Non-supported directives
8997
may be ignored as outlined in Section \ref{intro:portability:attributes},
9098
but should not be treated as data to
91-
publish. Only if a member of the \refarg{info} array is not recognized
92-
as an attribute, should it be assumed to be data to be published.
93-
Since implementations may support custom directives, it is always preferable that
94-
clients use the \refattr{PMIX_DATA_TO_PUBLISH} directive to clearly designate the
95-
keys to be published.
99+
publish. The implementation may treat any custom (non-standardized) directives it
100+
supports as directives. All other \refarg{info} array elements
101+
should it be assumed to be data to be published.
102+
Since additional directives may be added to the standard and implementations may add support for additional custom directives, the use of \refattr{PMIX_DATA_TO_PUBLISH} is the only reliable way to ensure that
103+
future implementations will not mis-classify elements of an \refarg{info} array.
96104

97105

98106
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -368,8 +376,10 @@ \section{\code{PMIx_Lookup}}
368376
\descr
369377

370378
Lookup information published by a process or host environment using \refapi{PMIx_Publish} or \refapi{PMIx_Publish_nb}.
371-
By default, the search will be constrained to publishers that fall within the \refconst{PMIX_RANGE_SESSION} range in case duplicate keys exist on different ranges.
372-
Changes to the range (e.g., expanding the search to all potential publishers via the \refconst{PMIX_RANGE_GLOBAL} constant), and any additional directives, can be provided in the \refstruct{pmix_info_t} array. Data is returned per the retrieval rules of Section \ref{chap:pub:retrules}.
379+
A lookup operation is always performed on a range which can be specified using the directive \refconst{PMIX_RANGE} or otherwise defaults to \refconst{PMIX_RANGE_SESSION}.
380+
The lookup operation will be constrained to publishers that fall within
381+
the range and that published data to the range.
382+
Data is returned per the retrieval rules of Section \ref{chap:pub:retrules}.
373383

374384
The \argref{data} parameter consists of an array of \refstruct{pmix_pdata_t} structures with the keys specifying the requested information.
375385
Data will be returned for each \code{key} field in the associated \code{value} field of this structure as per the above description of return values. The \code{proc} field in each \refstruct{pmix_pdata_t} structure will contain the namespace/rank of the process that published the data.
@@ -569,44 +579,27 @@ \subsubsection{Lookup data structure support macros}
569579
\section{Retrieval rules for published data}
570580
\label{chap:pub:retrules}
571581

572-
\begingroup
573-
\begin{figure*}[ht!]
574-
\begin{center}
575-
\includegraphics[clip,width=0.9\textwidth]{figs/publish_lookup.pdf}
576-
\end{center}
577-
\caption{Example Publish, Lookup retrieval rules}
578-
\label{fig:publish_lookup}
579-
\end{figure*}
580-
\endgroup
581-
582582
The retrieval rules for published data primarily revolve around enforcing data access permissions and range constraints.
583583
All publish and lookup operations operate on a range. If not specified, the range defaults to \refconst{PMIX_RANGE_SESSION}.
584584
The key being looked up will match with a published key only if all of the following conditions are met:
585585

586586
\begin{enumerate}
587587
\item The lookup key matches the published key.
588-
\item The publisher of the published key falls within the lookup range specified by the requester.
589-
\item The requester falls within the range specified by the publisher.
588+
\item The type of range specified by the publisher is the same as the type of range specified by the requester.
589+
\item If a custom range is specified by the publisher and the requester, the members described in both cases must be identical.
590+
\item The publisher must be a member of the requestors range.
591+
\item The requestor must be a member of the publishers range.
592+
593+
%%option2:
594+
%%
595+
%% \item The publisher's range must describe the same set of processes as the requestor's range.
596+
%% \item The requestor must be a member of the range specified.
597+
%%
598+
%% The difference here is in how custom ranges are handled in which the publisher is not a member of the custom range it describes. The later case allows the publisher to publish to a custom range that includes a set of processes not including itself.
599+
590600
\item If the publisher specified access permissions, the effective \ac{UID} and \ac{GID} of the requester must meet those requirements.
591601
\end{enumerate}
592602

593-
Fig.~\ref{fig:publish_lookup} shows process P0 executing on Host X in Namespace 1 in Session A publishing the key "tree" on three ranges. Publishing to different ranges is allowed.
594-
However, as the figure demonstrates, doing so must be done carefully to ensure predictable outcomes across different implementations. The figure shows processes P1 and P2 performing various lookup operation on the key "tree" using different ranges.
595-
Process P1 does not successfully lookup a value for "tree" on the range \refconst{PMIX_RANGE_LOCAL}
596-
because the only publisher is not within P1's specified range which covers only its
597-
local host. Similarly, P1 will not successfully lookup a value for "tree" on the range
598-
\refconst{PMIX_RANGE_NAMESPACE} since the only publisher is not within P1's namespace.
599-
A lookup of "tree" by P1 on the range \refconst{PMIX_RANGE_GLOBAL} does permit possible matches of keys published by P0. P0 has published "tree" three times,
600-
but P1 is outside of the P0's node and namespace ranges. Therefore, only the value of "tree"
601-
published to the session level is retrievable by P1. Notice that the lookup range
602-
does not need to match the publishing range for a match to occur. The requirement
603-
is that the requester is in the range specified by the publisher and the publisher is in the range specified by the requester.
604-
605-
The figure shows a similar scenario for P2. However, unlike P1, P2 is in the same namespace as P0 which results in two possible published values of
606-
"tree" that could be returned by a call to \refapi{PMIx_Lookup} by P2 on the range \refconst{PMIX_RANGE_SESSION} or \refconst{PMIX_RANGE_NAMESPACE}.
607-
An implementation is required to return one of the possible matches in such cases where
608-
there are multiple possible matches.
609-
610603
The status returned by the datastore shall be set to:
611604

612605
\begin{itemize}
@@ -622,13 +615,6 @@ \section{Retrieval rules for published data}
622615
\item a non-zero \ac{PMIx} error constant indicating a reason for the request's failure.
623616
\end{itemize}
624617

625-
\adviceuserstart
626-
Note that duplicate keys are allowed to exist on different ranges, and that ranges do overlap each other. Thus, if duplicate keys are published on overlapping ranges, it is possible for the datastore to successfully find multiple responses for a given key should publisher and requester specify sufficiently broad ranges. In this situation, the choice of resolving the duplication is left to the datastore implementation - e.g., it may return the first value found in its search, or the value corresponding to the most limited range of the found values, or it may choose to simply return an error.
627-
628-
Users are advised to avoid this ambiguity by careful selection of key values and ranges - e.g., by creating range-specific keys where necessary.
629-
\adviceuserend
630-
631-
632618
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
633619
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
634620
\section{\code{PMIx_Unpublish}}

0 commit comments

Comments
 (0)