From 90bfe71763c0c5f972c58de863c2ef41eaf3ac15 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Mon, 26 Nov 2018 13:32:22 -0500 Subject: [PATCH 01/17] Adding shmem_malloc_with_hints interface --- content/shmem_malloc_hints.tex | 116 +++++++++++++++++++++++++++++++++ main_spec.tex | 4 ++ 2 files changed, 120 insertions(+) create mode 100644 content/shmem_malloc_hints.tex diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex new file mode 100644 index 000000000..518a1b18d --- /dev/null +++ b/content/shmem_malloc_hints.tex @@ -0,0 +1,116 @@ + +\apisummary{ + Collective memory allocation routine with support for providing hints. +} + +\begin{apidefinition} + +\begin{Csynopsis} +void *@\FuncDecl{shmem\_malloc\_with\_hints}@(size_t size, long hints); +\end{Csynopsis} + +\begin{apiarguments} + \apiargument{IN}{size}{The size, in bytes, of a block to be + allocated from the symmetric heap. This argument is of type \CTYPE{size\_t}} + \apiargument{IN}{hints}{A bit array of hints provided by the user to the implementation} +\end{apiarguments} + + +\apidescription{ + + The \FUNC{shmem\_malloc\_with\_hint} like \FUNC{shmem\_malloc} routine returns a pointer to a block of at least + \VAR{size} bytes, which shall be suitably aligned so that it may be + assigned to a pointer to any type of object. This space is allocated from + the symmetric heap (similar to \FUNC{shmem\_malloc}). When \VAR{size} is zero, + the \FUNC{shmem\_malloc\_with\_hint} routine performs no action and returns a null pointer. + + In addition to the \VAR{size} argument, the \VAR{hint} argument is provided by the user. + The \VAR{hint} could describe the trait of memory storage where memory is allocated or + it could describe the expected manner in which the \openshmem program may use the allocated memory. + The valid storage trait hints are described in Table~\ref{traithints} and the valid usage hints + are described in Table~\ref{usagehints}. Multiple hints are expressed as \CONST{OR} of \VAR{hints}. + + The information provided by the \VAR{hint} is used to optimize for performance by the implementation. + If the implementation cannot optimize, the behavior is same as \FUNC{shmem\_malloc}. + If more than one hint is provided, the implementation will make the best effort to use one or more hints + to optimize performance. + + The \FUNC{shmem\_malloc\_with\_hint} routine is provided so that multiple \acp{PE} in a program can allocate symmetric, + remotely accessible memory blocks. When no action is performed, these + routines return without performing a barrier. Otherwise, the routine will call a barrier on exit. + This ensures that all \acp{PE} participate in the memory allocation, and that the memory on other + \acp{PE} can be used as soon as the local \ac{PE} returns. The implicit barrier performed by this routine will quiet the + default context. It is the user's responsibility to ensure that no communication operations involving the given memory block are pending on + other contexts prior to calling the \FUNC{shmem\_free} and \FUNC{shmem\_realloc} routines. + The user is also responsible for calling these routines with identical argument(s) on all + \acp{PE}; if differing \VAR{size}, or \VAR{hint} arguments are used, the behavior of the call + and any subsequent \openshmem calls is undefined. +} + +\apireturnvalues{ + The \FUNC{shmem\_malloc\_with\_hint} routine returns a pointer to the allocated space; + otherwise, it returns a null pointer. +} + +\apinotes{ +} + +\apiimpnotes{ +} + \begin{longtable}{|p{0.45\textwidth}|p{0.5\textwidth}|} + \hline + \textbf{Hints} & \textbf{Storage Trait} + \tabularnewline \hline + \endhead + %% + \LibConstDecl{SHMEM\_HINT\_NONE} & + Behavior same as shmem\_malloc + \tabularnewline \hline + + \LibConstDecl{SHMEM\_HINT\_LOW\_LAT\_MEM} & + Allocate memory on low-latency storage + \tabularnewline \hline + + \LibConstDecl{SHMEM\_HINT\_HIGH\_BW\_MEM} & + Allocate memory on high-bandwidth storage + \tabularnewline \hline + + \LibConstDecl{SHMEM\_HINT\_NEAR\_NIC\_MEM} & + Allocate memory on storage near to the network card + \tabularnewline \hline + + \LibConstDecl{SHMEM\_HINT\_DEVICE\_GPU\_MEM} & + Allocate memory on the device + \tabularnewline \hline + + \LibConstDecl{SHMEM\_HINT\_DEVICE\_NIC\_MEM} & + Allocate memory on the network interface card + \tabularnewline \hline + \TableCaptionRef{Storage trait hints} + \label{traithints} + \end{longtable} + + + \begin{longtable}{|p{0.45\textwidth}|p{0.5\textwidth}|} + \hline + \textbf{Hints} & \textbf{Usage hint} + \tabularnewline \hline + \endhead + %% + \LibConstDecl{SHMEM\_HINT\_PSYNC} & + Memory used as \CONST{PSYNC} array + \tabularnewline \hline + + \LibConstDecl{SHMEM\_HINT\_PWORK} & + Memory used as \CONST{PWORK} array + \tabularnewline \hline + + \LibConstDecl{SHMEM\_HINT\_ATOMICS} & + Memory used for \VAR{Atomic} operations + \tabularnewline \hline + + \TableCaptionRef{Memory usage hints} + \label{usagehints} + \end{longtable} +\end{apidefinition} +\newpage diff --git a/main_spec.tex b/main_spec.tex index 6c2c46596..b97f98f64 100644 --- a/main_spec.tex +++ b/main_spec.tex @@ -103,6 +103,10 @@ \subsection{Memory Management Routines} \subsubsection{\textbf{SHMEM\_MALLOC, SHMEM\_FREE, SHMEM\_REALLOC, SHMEM\_ALIGN}}\label{subsec:shfree} \input{content/shmem_malloc.tex} +\newpage +\subsubsection{\textbf{SHMEM\_MALLOC\_WITH\_HINTS}}\label{subsec:shmmallochint} +\input{content/shmem_malloc_hints.tex} + \subsubsection{\textbf{SHMEM\_CALLOC}}\label{subsec:shmem_calloc} \input{content/shmem_calloc.tex} From 77f4c85154c7a0ed4f4f995048d10f6a5f3cc688 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Wed, 15 May 2019 15:08:08 -0400 Subject: [PATCH 02/17] Removing GPU hint based on the early feedback --- content/shmem_malloc_hints.tex | 4 ---- 1 file changed, 4 deletions(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index 518a1b18d..54cd22bf3 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -79,10 +79,6 @@ Allocate memory on storage near to the network card \tabularnewline \hline - \LibConstDecl{SHMEM\_HINT\_DEVICE\_GPU\_MEM} & - Allocate memory on the device - \tabularnewline \hline - \LibConstDecl{SHMEM\_HINT\_DEVICE\_NIC\_MEM} & Allocate memory on the network interface card \tabularnewline \hline From c1d9ce60eb133b1d21a84027924697afda033f52 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Tue, 21 May 2019 12:04:43 -0500 Subject: [PATCH 03/17] Changes based on feedback --- content/shmem_malloc_hints.tex | 37 ++++++++++------------------------ 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index 54cd22bf3..8f5a81087 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -25,12 +25,10 @@ the \FUNC{shmem\_malloc\_with\_hint} routine performs no action and returns a null pointer. In addition to the \VAR{size} argument, the \VAR{hint} argument is provided by the user. - The \VAR{hint} could describe the trait of memory storage where memory is allocated or - it could describe the expected manner in which the \openshmem program may use the allocated memory. - The valid storage trait hints are described in Table~\ref{traithints} and the valid usage hints - are described in Table~\ref{usagehints}. Multiple hints are expressed as \CONST{OR} of \VAR{hints}. + The \VAR{hint} describes the expected manner in which the \openshmem program may use the allocated memory. + The valid usage hints are described in Table~\ref{usagehints}. Multiple hints are expressed as \CONST{OR} of \VAR{hints}. - The information provided by the \VAR{hint} is used to optimize for performance by the implementation. + The information provided by the \VAR{hint} is used to optimize for performance by the implementation. If the implementation cannot optimize, the behavior is same as \FUNC{shmem\_malloc}. If more than one hint is provided, the implementation will make the best effort to use one or more hints to optimize performance. @@ -57,9 +55,9 @@ \apiimpnotes{ } - \begin{longtable}{|p{0.45\textwidth}|p{0.5\textwidth}|} + \begin{longtable}{|p{0.45\textwidth}|p{0.5\textwidth}|} \hline - \textbf{Hints} & \textbf{Storage Trait} + \textbf{Hints} & \textbf{Usage hint} \tabularnewline \hline \endhead %% @@ -75,24 +73,6 @@ Allocate memory on high-bandwidth storage \tabularnewline \hline - \LibConstDecl{SHMEM\_HINT\_NEAR\_NIC\_MEM} & - Allocate memory on storage near to the network card - \tabularnewline \hline - - \LibConstDecl{SHMEM\_HINT\_DEVICE\_NIC\_MEM} & - Allocate memory on the network interface card - \tabularnewline \hline - \TableCaptionRef{Storage trait hints} - \label{traithints} - \end{longtable} - - - \begin{longtable}{|p{0.45\textwidth}|p{0.5\textwidth}|} - \hline - \textbf{Hints} & \textbf{Usage hint} - \tabularnewline \hline - \endhead - %% \LibConstDecl{SHMEM\_HINT\_PSYNC} & Memory used as \CONST{PSYNC} array \tabularnewline \hline @@ -102,11 +82,16 @@ \tabularnewline \hline \LibConstDecl{SHMEM\_HINT\_ATOMICS} & - Memory used for \VAR{Atomic} operations + Memory used for \VAR{Atomic} operations \tabularnewline \hline + \LibConstDecl{SHMEM\_HINT\_SIGNAL} & + Memory used for \VAR{signal} operations + \tabularnewline \hline + \TableCaptionRef{Memory usage hints} \label{usagehints} \end{longtable} + \end{apidefinition} \newpage From c3125cdea976033ef34e67f1560a1718f8ae8aac Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Tue, 3 Sep 2019 10:37:43 -0700 Subject: [PATCH 04/17] Minor edits --- content/shmem_malloc_hints.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index 8f5a81087..5dc6ec2de 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -21,7 +21,7 @@ The \FUNC{shmem\_malloc\_with\_hint} like \FUNC{shmem\_malloc} routine returns a pointer to a block of at least \VAR{size} bytes, which shall be suitably aligned so that it may be assigned to a pointer to any type of object. This space is allocated from - the symmetric heap (similar to \FUNC{shmem\_malloc}). When \VAR{size} is zero, + the symmetric heap (similar to \FUNC{shmem\_malloc}). When the \VAR{size} is zero, the \FUNC{shmem\_malloc\_with\_hint} routine performs no action and returns a null pointer. In addition to the \VAR{size} argument, the \VAR{hint} argument is provided by the user. @@ -29,7 +29,7 @@ The valid usage hints are described in Table~\ref{usagehints}. Multiple hints are expressed as \CONST{OR} of \VAR{hints}. The information provided by the \VAR{hint} is used to optimize for performance by the implementation. - If the implementation cannot optimize, the behavior is same as \FUNC{shmem\_malloc}. + If the implementation cannot optimize, the behavior is the same as \FUNC{shmem\_malloc}. If more than one hint is provided, the implementation will make the best effort to use one or more hints to optimize performance. @@ -39,9 +39,9 @@ This ensures that all \acp{PE} participate in the memory allocation, and that the memory on other \acp{PE} can be used as soon as the local \ac{PE} returns. The implicit barrier performed by this routine will quiet the default context. It is the user's responsibility to ensure that no communication operations involving the given memory block are pending on - other contexts prior to calling the \FUNC{shmem\_free} and \FUNC{shmem\_realloc} routines. - The user is also responsible for calling these routines with identical argument(s) on all - \acp{PE}; if differing \VAR{size}, or \VAR{hint} arguments are used, the behavior of the call + other contexts before calling the \FUNC{shmem\_free} and \FUNC{shmem\_realloc} routines. + The user is also responsible for calling these routines with the identical argument(s) on all + \acp{PE}; if differing \VAR{size} or \VAR{hint} arguments are used, the behavior of the call and any subsequent \openshmem calls is undefined. } From 90a3ee49171c02e7dfe6bd634fbdd5db3b250b05 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Sun, 29 Sep 2019 10:05:22 -0400 Subject: [PATCH 05/17] Update content/shmem_malloc_hints.tex Change hint to hints Co-Authored-By: James Dinan --- content/shmem_malloc_hints.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index 8f5a81087..bc9cb64b6 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -46,7 +46,7 @@ } \apireturnvalues{ - The \FUNC{shmem\_malloc\_with\_hint} routine returns a pointer to the allocated space; + The \FUNC{shmem\_malloc\_with\_hints} routine returns a pointer to the allocated space; otherwise, it returns a null pointer. } From 016bf85527b0dfc4c7e78c6284da19acffd88fd3 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Sun, 29 Sep 2019 10:05:56 -0400 Subject: [PATCH 06/17] Update content/shmem_malloc_hints.tex Co-Authored-By: James Dinan --- content/shmem_malloc_hints.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index bc9cb64b6..a32cdf3fb 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -18,7 +18,7 @@ \apidescription{ - The \FUNC{shmem\_malloc\_with\_hint} like \FUNC{shmem\_malloc} routine returns a pointer to a block of at least + The \FUNC{shmem\_malloc\_with\_hints} like \FUNC{shmem\_malloc} routine returns a pointer to a block of at least \VAR{size} bytes, which shall be suitably aligned so that it may be assigned to a pointer to any type of object. This space is allocated from the symmetric heap (similar to \FUNC{shmem\_malloc}). When \VAR{size} is zero, From 150e79f0fb6f5c2176381b2f25096c353149fb5c Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Sun, 29 Sep 2019 10:06:04 -0400 Subject: [PATCH 07/17] Update content/shmem_malloc_hints.tex Co-Authored-By: Nick Park --- content/shmem_malloc_hints.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index a32cdf3fb..49e213c26 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -62,7 +62,7 @@ \endhead %% \LibConstDecl{SHMEM\_HINT\_NONE} & - Behavior same as shmem\_malloc + Behavior same as \FUNC{shmem\_malloc} \tabularnewline \hline \LibConstDecl{SHMEM\_HINT\_LOW\_LAT\_MEM} & From 7f01139e3e245d8adc0a70d1058cbf41220934c6 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Sun, 29 Sep 2019 10:06:26 -0400 Subject: [PATCH 08/17] Update content/shmem_malloc_hints.tex Co-Authored-By: Nick Park --- content/shmem_malloc_hints.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index 49e213c26..7f8df0e36 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -26,7 +26,7 @@ In addition to the \VAR{size} argument, the \VAR{hint} argument is provided by the user. The \VAR{hint} describes the expected manner in which the \openshmem program may use the allocated memory. - The valid usage hints are described in Table~\ref{usagehints}. Multiple hints are expressed as \CONST{OR} of \VAR{hints}. + The valid usage hints are described in Table~\ref{usagehints}. Multiple hints may be requested by combining them with a bitwise \CONST{OR} operation. The information provided by the \VAR{hint} is used to optimize for performance by the implementation. If the implementation cannot optimize, the behavior is same as \FUNC{shmem\_malloc}. From 79a4f10ebb7f0712755b9727f2127065661c9edb Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Sun, 29 Sep 2019 10:06:34 -0400 Subject: [PATCH 09/17] Update content/shmem_malloc_hints.tex Co-Authored-By: Nick Park --- content/shmem_malloc_hints.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index 7f8df0e36..b3073726b 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -41,7 +41,7 @@ default context. It is the user's responsibility to ensure that no communication operations involving the given memory block are pending on other contexts prior to calling the \FUNC{shmem\_free} and \FUNC{shmem\_realloc} routines. The user is also responsible for calling these routines with identical argument(s) on all - \acp{PE}; if differing \VAR{size}, or \VAR{hint} arguments are used, the behavior of the call + \acp{PE}; if differing \VAR{size}, or \VAR{hints} arguments are used, the behavior of the call and any subsequent \openshmem calls is undefined. } From e0f80af4da80eb0852e23ccfbfd7bdb22d8a7f76 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Sun, 29 Sep 2019 10:06:43 -0400 Subject: [PATCH 10/17] Update content/shmem_malloc_hints.tex Co-Authored-By: Nick Park --- content/shmem_malloc_hints.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index b3073726b..793f71de7 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -28,7 +28,7 @@ The \VAR{hint} describes the expected manner in which the \openshmem program may use the allocated memory. The valid usage hints are described in Table~\ref{usagehints}. Multiple hints may be requested by combining them with a bitwise \CONST{OR} operation. - The information provided by the \VAR{hint} is used to optimize for performance by the implementation. + The information provided by the \VAR{hints} is used to optimize for performance by the implementation. If the implementation cannot optimize, the behavior is same as \FUNC{shmem\_malloc}. If more than one hint is provided, the implementation will make the best effort to use one or more hints to optimize performance. From 7c6c93b005f76741073d15199da7f643ea8a8d19 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Sun, 29 Sep 2019 10:06:52 -0400 Subject: [PATCH 11/17] Update content/shmem_malloc_hints.tex Co-Authored-By: Nick Park --- content/shmem_malloc_hints.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index 793f71de7..340f3a7aa 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -25,7 +25,7 @@ the \FUNC{shmem\_malloc\_with\_hint} routine performs no action and returns a null pointer. In addition to the \VAR{size} argument, the \VAR{hint} argument is provided by the user. - The \VAR{hint} describes the expected manner in which the \openshmem program may use the allocated memory. + The \VAR{hints} describes the expected manner in which the \openshmem program may use the allocated memory. The valid usage hints are described in Table~\ref{usagehints}. Multiple hints may be requested by combining them with a bitwise \CONST{OR} operation. The information provided by the \VAR{hints} is used to optimize for performance by the implementation. From 45f4540b588176d9ecafe1b25e6c78e76d91c180 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Sun, 29 Sep 2019 10:07:47 -0400 Subject: [PATCH 12/17] Update content/shmem_malloc_hints.tex Co-Authored-By: Nick Park --- content/shmem_malloc_hints.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index 340f3a7aa..dbb62e17b 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -24,7 +24,7 @@ the symmetric heap (similar to \FUNC{shmem\_malloc}). When \VAR{size} is zero, the \FUNC{shmem\_malloc\_with\_hint} routine performs no action and returns a null pointer. - In addition to the \VAR{size} argument, the \VAR{hint} argument is provided by the user. + In addition to the \VAR{size} argument, the \VAR{hints} argument is provided by the user. The \VAR{hints} describes the expected manner in which the \openshmem program may use the allocated memory. The valid usage hints are described in Table~\ref{usagehints}. Multiple hints may be requested by combining them with a bitwise \CONST{OR} operation. From 5cd618ce9a859a6a799d29e20a1e8a4fbaa7c6b4 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Sun, 29 Sep 2019 07:24:22 -0700 Subject: [PATCH 13/17] Adding editorial suggestions from Nick --- content/shmem_malloc_hints.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index 9df3bf5f7..e8e0ac486 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -18,7 +18,7 @@ \apidescription{ - The \FUNC{shmem\_malloc\_with\_hints} like \FUNC{shmem\_malloc} routine returns a pointer to a block of at least + The \FUNC{shmem\_malloc\_with\_hints} routine, like \FUNC{shmem\_malloc}, returns a pointer to a block of at least \VAR{size} bytes, which shall be suitably aligned so that it may be assigned to a pointer to any type of object. This space is allocated from the symmetric heap (similar to \FUNC{shmem\_malloc}). When the \VAR{size} is zero, From bf4de2ebdc1d632afc1da11cd3d1cedeabf593c5 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Sun, 29 Sep 2019 07:31:06 -0700 Subject: [PATCH 14/17] Trim hints - Feedback from sep f2f --- content/shmem_malloc_hints.tex | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index e8e0ac486..b6b3cc83c 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -22,7 +22,7 @@ \VAR{size} bytes, which shall be suitably aligned so that it may be assigned to a pointer to any type of object. This space is allocated from the symmetric heap (similar to \FUNC{shmem\_malloc}). When the \VAR{size} is zero, - the \FUNC{shmem\_malloc\_with\_hint} routine performs no action and returns a null pointer. + the \FUNC{shmem\_malloc\_with\_hints} routine performs no action and returns a null pointer. In addition to the \VAR{size} argument, the \VAR{hints} argument is provided by the user. The \VAR{hints} describes the expected manner in which the \openshmem program may use the allocated memory. @@ -33,7 +33,7 @@ If more than one hint is provided, the implementation will make the best effort to use one or more hints to optimize performance. - The \FUNC{shmem\_malloc\_with\_hint} routine is provided so that multiple \acp{PE} in a program can allocate symmetric, + The \FUNC{shmem\_malloc\_with\_hints} routine is provided so that multiple \acp{PE} in a program can allocate symmetric, remotely accessible memory blocks. When no action is performed, these routines return without performing a barrier. Otherwise, the routine will call a barrier on exit. This ensures that all \acp{PE} participate in the memory allocation, and that the memory on other @@ -65,22 +65,6 @@ Behavior same as \FUNC{shmem\_malloc} \tabularnewline \hline - \LibConstDecl{SHMEM\_HINT\_LOW\_LAT\_MEM} & - Allocate memory on low-latency storage - \tabularnewline \hline - - \LibConstDecl{SHMEM\_HINT\_HIGH\_BW\_MEM} & - Allocate memory on high-bandwidth storage - \tabularnewline \hline - - \LibConstDecl{SHMEM\_HINT\_PSYNC} & - Memory used as \CONST{PSYNC} array - \tabularnewline \hline - - \LibConstDecl{SHMEM\_HINT\_PWORK} & - Memory used as \CONST{PWORK} array - \tabularnewline \hline - \LibConstDecl{SHMEM\_HINT\_ATOMICS} & Memory used for \VAR{Atomic} operations \tabularnewline \hline From e7d011c55170262b4356aff27a67bebe716cc034 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Sun, 29 Sep 2019 07:54:00 -0700 Subject: [PATCH 15/17] Change option NONE to zero --- content/shmem_malloc_hints.tex | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index b6b3cc83c..8a6355148 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -27,6 +27,7 @@ In addition to the \VAR{size} argument, the \VAR{hints} argument is provided by the user. The \VAR{hints} describes the expected manner in which the \openshmem program may use the allocated memory. The valid usage hints are described in Table~\ref{usagehints}. Multiple hints may be requested by combining them with a bitwise \CONST{OR} operation. + A zero option can be given if no options are requested. The information provided by the \VAR{hints} is used to optimize for performance by the implementation. If the implementation cannot optimize, the behavior is same as \FUNC{shmem\_malloc}. @@ -61,15 +62,20 @@ \tabularnewline \hline \endhead %% - \LibConstDecl{SHMEM\_HINT\_NONE} & + \newline + \CONST{0} & + \newline Behavior same as \FUNC{shmem\_malloc} \tabularnewline \hline + \LibConstDecl{SHMEM\_HINT\_ATOMICS} & + \newline Memory used for \VAR{Atomic} operations \tabularnewline \hline \LibConstDecl{SHMEM\_HINT\_SIGNAL} & + \newline Memory used for \VAR{signal} operations \tabularnewline \hline From 755a4ed9c879defd2772db3a3d18ddb62d648537 Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Mon, 21 Oct 2019 05:57:02 -0700 Subject: [PATCH 16/17] Change HINT name --- content/shmem_malloc_hints.tex | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index 8a6355148..a1c74552d 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -51,11 +51,6 @@ otherwise, it returns a null pointer. } -\apinotes{ -} - -\apiimpnotes{ -} \begin{longtable}{|p{0.45\textwidth}|p{0.5\textwidth}|} \hline \textbf{Hints} & \textbf{Usage hint} @@ -69,9 +64,9 @@ \tabularnewline \hline - \LibConstDecl{SHMEM\_HINT\_ATOMICS} & + \LibConstDecl{SHMEM\_HINT\_ATOMICS\_REMOTE} & \newline - Memory used for \VAR{Atomic} operations + Memory used for \VAR{atomic} operations \tabularnewline \hline \LibConstDecl{SHMEM\_HINT\_SIGNAL} & @@ -83,5 +78,13 @@ \label{usagehints} \end{longtable} +\apinotes{ + The \openshmem programs should allocate memory with + \CONST{SHMEM\_HINT\_ATOMIC\_REMOTE}, when the majority of + operations performed on this memory are atomic operations, and origin + and target \ac{PE} of the atomic operations do not share a memory domain + .i.e., symmetric objects on the target \ac{PE} is not accessible using + load/store operations from the origin \ac{PE} or vice versa. +} \end{apidefinition} \newpage From fc143db72d2dd7b6feaa90d7b44b7a9af28226ea Mon Sep 17 00:00:00 2001 From: Manjunath Gorentla Venkata Date: Tue, 22 Oct 2019 16:28:20 -0700 Subject: [PATCH 17/17] Minor edit: fixing typo --- content/shmem_malloc_hints.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_malloc_hints.tex b/content/shmem_malloc_hints.tex index a1c74552d..c51f439d0 100644 --- a/content/shmem_malloc_hints.tex +++ b/content/shmem_malloc_hints.tex @@ -80,7 +80,7 @@ \apinotes{ The \openshmem programs should allocate memory with - \CONST{SHMEM\_HINT\_ATOMIC\_REMOTE}, when the majority of + \CONST{SHMEM\_HINT\_ATOMICS\_REMOTE}, when the majority of operations performed on this memory are atomic operations, and origin and target \ac{PE} of the atomic operations do not share a memory domain .i.e., symmetric objects on the target \ac{PE} is not accessible using