From 94976fece39bf3b77d386d369861bd8dfb9e6034 Mon Sep 17 00:00:00 2001 From: Naveen Ravichandrasekaran Date: Mon, 10 Sep 2018 13:06:33 -0500 Subject: [PATCH] Add restrict qualifier to sig_addr We are adding the restricy qualifier to sig_addr data objects and expects it to not overlap or be same as the dest or source data objects. --- content/shmem_put_signal.tex | 21 +++++++++++---------- utils/defs.tex | 12 ++++++++---- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/content/shmem_put_signal.tex b/content/shmem_put_signal.tex index 86481bd6b..f4e6bb992 100644 --- a/content/shmem_put_signal.tex +++ b/content/shmem_put_signal.tex @@ -1,4 +1,3 @@ -\color{Green} \apisummary{ The 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} @@ -8,26 +7,26 @@ \begin{apidefinition} \begin{C11synopsis} -void @\FuncDecl{shmem\_put\_signal}@(TYPE *dest, const TYPE *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int pe); -void @\FuncDecl{shmem\_put\_signal}@(shmem_ctx_t ctx, TYPE *dest, const TYPE *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int pe); +void @\FuncDecl{shmem\_put\_signal}@(TYPE *dest, const TYPE *source, size_t nelems, uint64_t *restrict sig_addr, uint64_t signal, int pe); +void @\FuncDecl{shmem\_put\_signal}@(shmem_ctx_t ctx, TYPE *dest, const TYPE *source, size_t nelems, uint64_t *restrict sig_addr, uint64_t signal, 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}@(TYPE *dest, const TYPE *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int pe); -void @\FuncDecl{shmem\_ctx\_\FuncParam{TYPENAME}\_put\_signal}@(shmem_ctx_t ctx, TYPE *dest, const TYPE *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int pe); +void @\FuncDecl{shmem\_\FuncParam{TYPENAME}\_put\_signal}@(TYPE *dest, const TYPE *source, size_t nelems, uint64_t *restrict sig_addr, uint64_t signal, int pe); +void @\FuncDecl{shmem\_ctx\_\FuncParam{TYPENAME}\_put\_signal}@(shmem_ctx_t ctx, TYPE *dest, const TYPE *source, size_t nelems, uint64_t *restrict sig_addr, uint64_t signal, 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}@(void *dest, const void *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int pe); -void @\FuncDecl{shmem\_ctx\_put\FuncParam{SIZE}\_signal}@(shmem_ctx_t ctx, void *dest, const void *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int pe); +void @\FuncDecl{shmem\_put\FuncParam{SIZE}\_signal}@(void *dest, const void *source, size_t nelems, uint64_t *restrict sig_addr, uint64_t signal, int pe); +void @\FuncDecl{shmem\_ctx\_put\FuncParam{SIZE}\_signal}@(shmem_ctx_t ctx, void *dest, const void *source, size_t nelems, uint64_t *restrict sig_addr, uint64_t signal, int pe); \end{CsynopsisCol} where \SIZE{} is one of \CONST{8, 16, 32, 64, 128}. \begin{CsynopsisCol} -void @\FuncDecl{shmem\_putmem\_signal}@(void *dest, const void *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int pe); -void @\FuncDecl{shmem\_ctx\_putmem\_signal}@(shmem_ctx_t ctx, void *dest, const void *source, size_t nelems, uint64_t *sig_addr, uint64_t signal, int pe); +void @\FuncDecl{shmem\_putmem\_signal}@(void *dest, const void *source, size_t nelems, uint64_t *restrict sig_addr, uint64_t signal, int pe); +void @\FuncDecl{shmem\_ctx\_putmem\_signal}@(shmem_ctx_t ctx, void *dest, const void *source, size_t nelems, uint64_t *restrict sig_addr, uint64_t signal, int pe); \end{CsynopsisCol} \begin{apiarguments} @@ -64,6 +63,9 @@ for example, one could be a global/static \Cstd variable and the other could be allocated on the symmetric heap. + The restrict qualifier in \VAR{sig\_addr} expects the data object to be + distinct from \VAR{dest} and \VAR{source} data objects. + The delivery of \signal{} flag on the remote \ac{PE} indicates only the delivery of its corresponding \dest{} data words into the data object on the remote \ac{PE}. Without a memory-ordering operation, there is no implied @@ -83,4 +85,3 @@ \end{apiexamples} \end{apidefinition} -\color{Black} diff --git a/utils/defs.tex b/utils/defs.tex index a1ec4beee..915d26424 100644 --- a/utils/defs.tex +++ b/utils/defs.tex @@ -407,14 +407,16 @@ \textbf{C11:} \lstset{language={C}, backgroundcolor=\color{gray}, lineskip=2pt, escapechar=@, - morekeywords={size_t, ptrdiff_t, TYPE, _Noreturn, shmem_ctx_t, uint64_t}, + morekeywords={size_t, ptrdiff_t, TYPE, _Noreturn, shmem_ctx_t, + uint64_t, restrict}, aboveskip=0pt, belowskip=0pt}}{} \lstnewenvironment{CsynopsisCol} { \lstset{language={C}, backgroundcolor=\color{gray}, lineskip=2pt, escapechar=@, - morekeywords={size_t, ptrdiff_t, TYPE, TYPENAME, SIZE, shmem_ctx_t, uint64_t}, + morekeywords={size_t, ptrdiff_t, TYPE, TYPENAME, SIZE, shmem_ctx_t, + uint64_t, restrict}, aboveskip=0pt, belowskip=0pt}}{} @@ -423,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, uint64_t}, + morekeywords={size_t, ptrdiff_t, TYPE, TYPENAME, SIZE, shmem_ctx_t, + uint64_t, restrict}, aboveskip=0pt, belowskip=0pt}}{} \lstnewenvironment{CsynopsisST} @@ -515,7 +518,8 @@ ##1 \lstinputlisting[language={C}, tabsize=2, basicstyle=\ttfamily\footnotesize, - morekeywords={size_t, ptrdiff_t, shmem_ctx_t, uint64_t}]{##2} + morekeywords={size_t, ptrdiff_t, shmem_ctx_t, + uint64_t, restrict}]{##2} ##3 } \newcommand{\apifexample}[3]{ ##1