Skip to content

Commit

Permalink
Add a few simple, but helpful macros
Browse files Browse the repository at this point in the history
PMIX_RANK_IS_VALID - test if a rank has a valid value (i.e., less thatn PMIX_RANK_VALID)

PMIX_NSPACE_INVALID - test if a pmix_nspace_t contains a valid value (i.e., string of length greater than zero)

PMIX_PROCID_INVALID - check for invalid namespace or rank

PMIX_XFER_PROCID - copy a process ID between pmix_proc_t structures

Signed-off-by: Ralph Castain <rhc@pmix.org>
  • Loading branch information
rhc54 authored and jjhursey committed May 20, 2021
1 parent e51d470 commit 4fea9cd
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions Chap_API_Struct.tex
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,24 @@ \subsubsection{Namespace support macros}

Returns \code{true} if the namespace matches the given value

\littleheader{Check invalid namespace macro}
\declaremacro{PMIX_NSPACE_INVALID}

Check the string in a \refstruct{pmix_nspace_t}

\versionMarker{4.1}
\cspecificstart
\begin{codepar}
PMIX_NSPACE_INVALID(a)
\end{codepar}
\cspecificend

\begin{arglist}
\argin{a}{Pointer to the structure whose value is to be checked (pointer to \refstruct{pmix_nspace_t})}
\end{arglist}

Returns \code{true} if the namespace is invalid (i.e., starts with a \code{NULL} resulting in a zero-length string value)

\littleheader{Load namespace macro}
\declaremacro{PMIX_LOAD_NSPACE}

Expand Down Expand Up @@ -455,6 +473,24 @@ \subsubsection{Rank support macros}

Returns \code{true} if the ranks are equal, or at least one of the ranks is \refconst{PMIX_RANK_WILDCARD}

\littleheader{Check rank is valid macro}
\declaremacro{PMIX_RANK_IS_VALID}

Check is the given rank is a valid value

\versionMarker{4.1}
\cspecificstart
\begin{codepar}
PMIX_RANK_IS_VALID(a)
\end{codepar}
\cspecificend

\begin{arglist}
\argin{a}{Rank to be checked (\refstruct{pmix_rank_t})}
\end{arglist}

Returns \code{true} if the given rank is valid (i.e., less than \refconst{PMIX_RANK_VALID})

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Process Structure}
\declarestruct{pmix_proc_t}
Expand Down Expand Up @@ -604,6 +640,23 @@ \subsubsection{Process structure support macros}
\item one of the ranks is \refconst{PMIX_RANK_WILDCARD}
\end{itemize}

\littleheader{Check if a process identifier is valid}
\declaremacro{PMIX_PROCID_INVALID}

Check for invalid namespace or rank value

\versionMarker{4.1}
\cspecificstart
\begin{codepar}
PMIX_PROCID_INVALID(a)
\end{codepar}
\cspecificend

\begin{arglist}
\argin{a}{Pointer to a structure whose ID is to be checked (pointer to \refstruct{pmix_proc_t})}
\end{arglist}

Returns \code{true} if the process identifier contains either an empty (i.e., invalid) \refarg{nspace} field or a \refarg{rank} field of \refconst{PMIX_RANK_INVALID}

\littleheader{Load a procID structure}
\declaremacro{PMIX_LOAD_PROCID}
Expand All @@ -623,6 +676,23 @@ \subsubsection{Process structure support macros}
\argin{r}{Rank to be assigned (\refstruct{pmix_rank_t})}
\end{arglist}

\littleheader{Transfer a procID structure}
\declaremacro{PMIX_XFER_PROCID}

Transfer contents of one \refstruct{pmix_proc_t} value to another \refstruct{pmix_proc_t}.

\versionMarker{4.1}
\cspecificstart
\begin{codepar}
PMIX_XFER_PROCID(m, n)
\end{codepar}
\cspecificend

\begin{arglist}
\argin{m}{Pointer to the target structure (pointer to \refstruct{pmix_proc_t})}
\argin{n}{Pointer to the source structure (pointer to \refstruct{pmix_proc_t})}
\end{arglist}

\littleheader{Construct a multi-cluster namespace}
\declaremacro{PMIX_MULTICLUSTER_NSPACE_CONSTRUCT}

Expand Down

0 comments on commit 4fea9cd

Please sign in to comment.