Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for NBI put-with-signal operation #244

Closed
3 changes: 3 additions & 0 deletions content/backmatter.tex
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ \section{Version 1.5}
The following list describes the specific changes in \openshmem[1.5]:
\begin{itemize}
%
\item Added support for nonblocking put-with-signal functions.
\\ See Section \ref{subsec:shmem_put_signal_nbi}.
%
\item Specified the validity of communication contexts, added the constant
\CONST{SHMEM\_CTX\_INVALID}, and clarified the behavior of
\FUNC{shmem\_ctx\_*} routines on invalid contexts.
Expand Down
89 changes: 89 additions & 0 deletions content/shmem_put_signal_nbi.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
\color{ForestGreen}
\apisummary{
The nonblocking put-with-signal routines provide a method for copying data
from a contiguous local data object to a data object on a specified \ac{PE}
and subsequently updating a remote flag to signal completion.
}

\begin{apidefinition}

\begin{C11synopsis}
void @\FuncDecl{shmem\_put\_signal\_nbi}@(TYPE *dest, const TYPE *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int sig_op, int pe);
void @\FuncDecl{shmem\_put\_signal\_nbi}@(shmem_ctx_t ctx, TYPE *dest, const TYPE *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int sig_op, int pe);
\end{C11synopsis}
where \TYPE{} is one of the standard \ac{RMA} types specified by Table \ref{stdrmatypes}.

\begin{Csynopsis}
void @\FuncDecl{shmem\_\FuncParam{TYPENAME}\_put\_signal\_nbi}@(TYPE *dest, const TYPE *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int sig_op, int pe);
void @\FuncDecl{shmem\_ctx\_\FuncParam{TYPENAME}\_put\_signal\_nbi}@(shmem_ctx_t ctx, TYPE *dest, const TYPE *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int sig_op, int pe);
\end{Csynopsis}
where \TYPE{} is one of the standard \ac{RMA} types and has a corresponding \TYPENAME{} specified by Table \ref{stdrmatypes}.

\begin{CsynopsisCol}
void @\FuncDecl{shmem\_put\FuncParam{SIZE}\_signal\_nbi}@(void *dest, const void *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int sig_op, int pe);
void @\FuncDecl{shmem\_ctx\_put\FuncParam{SIZE}\_signal\_nbi}@(shmem_ctx_t ctx, void *dest, const void *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int sig_op, int pe);
\end{CsynopsisCol}
where \SIZE{} is one of \CONST{8, 16, 32, 64, 128}.

\begin{CsynopsisCol}
void @\FuncDecl{shmem\_putmem\_signal\_nbi}@(void *dest, const void *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int sig_op, int pe);
void @\FuncDecl{shmem\_ctx\_putmem\_signal\_nbi}@(shmem_ctx_t ctx, void *dest, const void *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int sig_op, int pe);
\end{CsynopsisCol}

\begin{apiarguments}
\apiargument{IN}{ctx}{A context handle specifying the context on which to
perform the operation. When this argument is not provided, the operation is
performed on the default context.}
\apiargument{OUT}{dest}{Data object to be updated on the remote \ac{PE}.
This data object must be remotely accessible.}
\apiargument{IN}{source}{Data object containing the data to be copied.}
\apiargument{IN}{nelems}{Number of elements in the \dest{} and \source{}
arrays. \VAR{nelems} must be of type \VAR{size\_t} for \Cstd.}
\apiargument{OUT}{sig\_addr}{Data object to be updated on the remote
\ac{PE} as the signal. This signal data object must be remotely accessible.}
\apiargument{IN}{signal}{Unsigned 64-bit value that is used for updating the
remote \VAR{sig\_addr} signal data object.}
\apiargument{IN}{sig\_op}{Signal operator that represents the type of update
to be performed on the remote \VAR{sig\_addr} signal data object.}
\apiargument{IN}{pe}{\ac{PE} number of the remote \ac{PE}.}
\end{apiarguments}

\apidescription{
The nonblocking put-with-signal routines provide a method for copying data
from a contiguous local data object to a data object on a specified \ac{PE}
and subsequently updating a remote flag to signal completion.

The routines return after posting the operation. The operation is considered
complete after a subsequent call to \FUNC{shmem\_quiet}. At the completion
of \FUNC{shmem\_quiet}, the data has been copied out of the \source{} array
on the local \ac{PE} and delivered into the \dest{} array on the destination
\ac{PE}. The delivery of \VAR{signal} flag on the remote \ac{PE} indicates
the delivery of its corresponding \dest{} data words into the data object on
the remote \ac{PE}.

The \VAR{sig\_op} signal operator determines the type of update to be
performed on the remote \VAR{sig\_addr} signal data object.

An update to the \VAR{sig\_addr} signal data object through a non-blocking
put-with-signal routine completes as if performed atomically with respect to
any other non-blocking put-with-signal routine that updates the
\VAR{sig\_addr} signal data object using the same \VAR{sig\_op} signal
update operator and any point-to-point synchronization routine that accesses
the \VAR{sig\_addr} signal data object.
}

\apireturnvalues{
None.
}

\apinotes{
The \dest{} and \VAR{sig\_addr} data objects must both be remotely
accessible. The \VAR{sig\_addr} and \dest{} could be of different kinds,
for example, one could be a global/static \Cstd variable and the other could
be allocated on the symmetric heap.

\VAR{sig\_addr} and \dest{} may not be overlapping in memory.
}

\end{apidefinition}
\color{black}
3 changes: 3 additions & 0 deletions main_spec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ \subsection{Non-blocking Remote Memory Access Routines}\label{sec:rma_nbi}
\subsubsection{\textbf{SHMEM\_PUT\_NBI}}\label{subsec:shmem_put_nbi}
\input{content/shmem_put_nbi.tex}

\subsubsection{\textbf{SHMEM\_PUT\_SIGNAL\_NBI}}\label{subsec:shmem_put_signal_nbi}
\input{content/shmem_put_signal_nbi.tex}

\subsubsection{\textbf{SHMEM\_GET\_NBI}}\label{subsec:shmem_get_nbi}
\input{content/shmem_get_nbi.tex}

Expand Down
9 changes: 6 additions & 3 deletions utils/defs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@
\textbf{C11:}
\lstset{language={C}, backgroundcolor=\color{gray}, lineskip=2pt,
escapechar=@,
morekeywords={size_t, ptrdiff_t, TYPE, _Noreturn, shmem_ctx_t},
morekeywords={size_t, ptrdiff_t, TYPE, _Noreturn, shmem_ctx_t,
uint64_t},
aboveskip=0pt, belowskip=0pt}}{}

\lstnewenvironment{CsynopsisCol}
Expand All @@ -424,7 +425,8 @@
\textbf{C/C++:}
\lstset{language={C}, backgroundcolor=\color{gray}, lineskip=2pt,
escapechar=@,
morekeywords={size_t, ptrdiff_t, TYPE, TYPENAME, SIZE, shmem_ctx_t},
morekeywords={size_t, ptrdiff_t, TYPE, TYPENAME, SIZE, shmem_ctx_t,
uint64_t},
aboveskip=0pt, belowskip=0pt}}{}

\lstnewenvironment{CsynopsisST}
Expand All @@ -433,7 +435,8 @@
\color{red}
{\lstset{language={C}, backgroundcolor=\color{gray}, lineskip=2pt,
escapechar=@,
morekeywords={size_t, ptrdiff_t, TYPE, TYPENAME, SIZE, shmem_ctx_t},
morekeywords={size_t, ptrdiff_t, TYPE, TYPENAME, SIZE, shmem_ctx_t,
uint64_t},
aboveskip=0pt, belowskip=0pt}}}{}

\lstnewenvironment{Fsynopsis}
Expand Down