From 79573b69dd4e625aa434cea3968d69dc6fc99119 Mon Sep 17 00:00:00 2001 From: David Ozog Date: Mon, 23 Jan 2017 11:01:23 -0500 Subject: [PATCH 1/3] Specify entry/exit for barrier within mem routines Original wording for memory management routines was to call barrier_all "before returning", which is slightly ambiguous. It is necessary to specify whether barrier must be called at exit, entry, or both. Signed-off-by: David Ozog --- content/shmem_malloc.tex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/shmem_malloc.tex b/content/shmem_malloc.tex index 35e845bfd..1b9067575 100644 --- a/content/shmem_malloc.tex +++ b/content/shmem_malloc.tex @@ -47,7 +47,11 @@ are provided so that multiple \ac{PE}s in a program can allocate symmetric, remotely accessible memory blocks. These memory blocks can then be used with \openshmem communication routines. Each of these routines call the - \FUNC{shmem\_barrier\_all} routine before returning; this ensures that all + \FUNC{shmem\_barrier\_all} routine before returning: \FUNC{shmem\_malloc} calls a + barrier on exit; \FUNC{shmem\_free} calls a barrier on entry; and + \FUNC{shmem\_realloc} may call barriers on both entry and exit, depending on + whether an existing allocation is modified and whether new memory is allocated. + This ensures that all \ac{PE}s participate in the memory allocation, and that the memory on other \ac{PE}s can be used as soon as the local \ac{PE} returns. The user is responsible for calling these routines with identical argument(s) on all From fd48bbe0eed807fd80757614f44b693dd0844610 Mon Sep 17 00:00:00 2001 From: David Ozog Date: Mon, 23 Jan 2017 15:39:22 -0500 Subject: [PATCH 2/3] Remove "before returning" ambiquity in barrier/mem. Signed-off-by: David Ozog --- content/shmem_malloc.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/shmem_malloc.tex b/content/shmem_malloc.tex index 1b9067575..dc1e44f3e 100644 --- a/content/shmem_malloc.tex +++ b/content/shmem_malloc.tex @@ -46,8 +46,8 @@ The \FUNC{shmem\_malloc}, \FUNC{shmem\_free}, and \FUNC{shmem\_realloc} routines are provided so that multiple \ac{PE}s in a program can allocate symmetric, remotely accessible memory blocks. These memory blocks can then be used with - \openshmem communication routines. Each of these routines call the - \FUNC{shmem\_barrier\_all} routine before returning: \FUNC{shmem\_malloc} calls a + \openshmem communication routines. Each of these routines include at least one + call to \FUNC{shmem\_barrier\_all}: \FUNC{shmem\_malloc} calls a barrier on exit; \FUNC{shmem\_free} calls a barrier on entry; and \FUNC{shmem\_realloc} may call barriers on both entry and exit, depending on whether an existing allocation is modified and whether new memory is allocated. From bf356e5e4205d2dee8dc163fd870e170022ffb75 Mon Sep 17 00:00:00 2001 From: David Ozog Date: Wed, 8 Mar 2017 17:28:29 -0500 Subject: [PATCH 3/3] Give align the same barrier requirement as malloc Adds a barrier at exit requirement to shmem_align (same as shmem_malloc). Also, change explicit requirement for a call to shmem_barrier_all to the less restrictive "semantic equivalence". Signed-off-by: David Ozog --- content/shmem_malloc.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/shmem_malloc.tex b/content/shmem_malloc.tex index dc1e44f3e..18697cb21 100644 --- a/content/shmem_malloc.tex +++ b/content/shmem_malloc.tex @@ -43,11 +43,12 @@ \CONST{NULL} pointer, the block to which it points is freed. If the space cannot be allocated, the block to which \VAR{ptr} points is unchanged. - The \FUNC{shmem\_malloc}, \FUNC{shmem\_free}, and \FUNC{shmem\_realloc} routines + The \FUNC{shmem\_malloc}, \FUNC{shmem\_align}, \FUNC{shmem\_free}, and \FUNC{shmem\_realloc} routines are provided so that multiple \ac{PE}s in a program can allocate symmetric, remotely accessible memory blocks. These memory blocks can then be used with \openshmem communication routines. Each of these routines include at least one - call to \FUNC{shmem\_barrier\_all}: \FUNC{shmem\_malloc} calls a + call to a procedure that is semantically equivalent to \FUNC{shmem\_barrier\_all}: + \FUNC{shmem\_malloc} and \FUNC{shmem\_align} call a barrier on exit; \FUNC{shmem\_free} calls a barrier on entry; and \FUNC{shmem\_realloc} may call barriers on both entry and exit, depending on whether an existing allocation is modified and whether new memory is allocated.