From 387f294d9cf805869ab8b441e508c754e82f0543 Mon Sep 17 00:00:00 2001 From: "David M. Ozog" Date: Thu, 6 Feb 2020 15:40:47 -0600 Subject: [PATCH 1/4] Add rows for undefined teams behavior to Annex C --- content/backmatter.tex | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/content/backmatter.tex b/content/backmatter.tex index a67acc6f0..3fd56266a 100644 --- a/content/backmatter.tex +++ b/content/backmatter.tex @@ -157,6 +157,12 @@ \chapter{Undefined Behavior in OpenSHMEM}\label{sec:undefined} an error message saying that the \ac{PE} accessed is outside the range of accessible \acp{PE}, or may exit without a warning.\tabularnewline \hline +Accessing an invalid team member \ac{PE} & Passing a \ac{PE} value that +corresponds to an invalid team member to an RMA/AMO routine, as the root of +a broadcast, etc. results in undefined behavior. Invalid team member +\ac{PE} values include those that are negative or greater than the size of +the team.\tabularnewline +\hline Use of non-symmetric variables & Some routines require remotely accessible variables to perform their function. For example, a \PUT{} to a non-symmetric variable may be trapped where possible and the library may abort the program. Another @@ -181,6 +187,16 @@ \chapter{Undefined Behavior in OpenSHMEM}\label{sec:undefined} \end{itemize} \tabularnewline \hline +Concurrently using active-set-based and team-based collectives & Concurrently +using the default team on an active-set-based collective with the default +team in a team-based collective, for instance inside a parallel region, +results in undefined behavior.\tabularnewline +\hline +Destroying a team with unfreed private contexts & Before destroying a given +team, the user is responsible for destroying all contexts within that team +having the \LibConstRef{SHMEM\_CTX\_PRIVATE} option enabled, otherwise, the +behavior is undefined.\tabularnewline +\hline \end{longtable} From 000d4eeeaf78c3237abd63aef31b021c3438c9fb Mon Sep 17 00:00:00 2001 From: David Ozog Date: Tue, 25 Feb 2020 17:25:30 -0500 Subject: [PATCH 2/4] Update content/backmatter.tex Co-Authored-By: James Dinan --- content/backmatter.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/backmatter.tex b/content/backmatter.tex index 3fd56266a..679ebc661 100644 --- a/content/backmatter.tex +++ b/content/backmatter.tex @@ -160,7 +160,7 @@ \chapter{Undefined Behavior in OpenSHMEM}\label{sec:undefined} Accessing an invalid team member \ac{PE} & Passing a \ac{PE} value that corresponds to an invalid team member to an RMA/AMO routine, as the root of a broadcast, etc. results in undefined behavior. Invalid team member -\ac{PE} values include those that are negative or greater than the size of +\ac{PE} values include those that are negative or greater than or equal to the size of the team.\tabularnewline \hline Use of non-symmetric variables & Some routines require remotely accessible From cf30194b235f4e02f50af3b1d4f287c1af40e023 Mon Sep 17 00:00:00 2001 From: David Ozog Date: Wed, 26 Feb 2020 16:57:52 -0500 Subject: [PATCH 3/4] Apply batch suggestions from code review Co-Authored-By: Nick Park --- content/backmatter.tex | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/content/backmatter.tex b/content/backmatter.tex index 679ebc661..0c7d5d121 100644 --- a/content/backmatter.tex +++ b/content/backmatter.tex @@ -187,14 +187,16 @@ \chapter{Undefined Behavior in OpenSHMEM}\label{sec:undefined} \end{itemize} \tabularnewline \hline -Concurrently using active-set-based and team-based collectives & Concurrently -using the default team on an active-set-based collective with the default -team in a team-based collective, for instance inside a parallel region, -results in undefined behavior.\tabularnewline +Concurrent use of a team & Teams are not thread-safe objects. +Concurrent use of a team from multiple threads results in undefined +behavior. Such a situation can arise when one thread is calling a +team-implicit collective (e.g., \FUNC{shmem\_barrier\_all}), which +implicitly operate on the world team, and another calls a team-based +collective (e.g., \FUNC{shmem\_broadcastmem}). \tabularnewline \hline Destroying a team with unfreed private contexts & Before destroying a given -team, the user is responsible for destroying all contexts within that team -having the \LibConstRef{SHMEM\_CTX\_PRIVATE} option enabled, otherwise, the +team, the user is responsible for destroying all contexts created from that team +with the \LibConstRef{SHMEM\_CTX\_PRIVATE} option enabled; otherwise, the behavior is undefined.\tabularnewline \hline \end{longtable} From 94fcf6b110d2519f6385802c44010503cb6e8376 Mon Sep 17 00:00:00 2001 From: "David M. Ozog" Date: Wed, 26 Feb 2020 17:02:45 -0500 Subject: [PATCH 4/4] Combine invalid PE access in undef behavior annex Also fix a couple typos Signed-off-by: David M. Ozog --- content/backmatter.tex | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/content/backmatter.tex b/content/backmatter.tex index 0c7d5d121..e70cffe55 100644 --- a/content/backmatter.tex +++ b/content/backmatter.tex @@ -151,17 +151,12 @@ \chapter{Undefined Behavior in OpenSHMEM}\label{sec:undefined} result in undefined behavior. \tabularnewline \hline -Accessing non-existent \acp{PE} & If a communications routine accesses a -non-existent \ac{PE}, then the \openshmem library may handle this -situation in an implementation-defined way. For example, the library may report -an error message saying that the \ac{PE} accessed is outside the range of -accessible \acp{PE}, or may exit without a warning.\tabularnewline -\hline -Accessing an invalid team member \ac{PE} & Passing a \ac{PE} value that -corresponds to an invalid team member to an RMA/AMO routine, as the root of -a broadcast, etc. results in undefined behavior. Invalid team member -\ac{PE} values include those that are negative or greater than or equal to the size of -the team.\tabularnewline +Specifying invalid \ac{PE} numbers & For \openshmem routines that accept a +\ac{PE} number as an argument, if the \ac{PE} number is invalid for the +team associated with the operation (either implicitly or explicitly), the +behavior is undefined. An invalid \ac{PE} number includes those that are +negative or greater than or equal to the size of the associated team. +\tabularnewline \hline Use of non-symmetric variables & Some routines require remotely accessible variables to perform their function. For example, a \PUT{} to a non-symmetric variable may @@ -191,7 +186,7 @@ \chapter{Undefined Behavior in OpenSHMEM}\label{sec:undefined} Concurrent use of a team from multiple threads results in undefined behavior. Such a situation can arise when one thread is calling a team-implicit collective (e.g., \FUNC{shmem\_barrier\_all}), which -implicitly operate on the world team, and another calls a team-based +implicitly operates on the world team, and another calls a team-based collective (e.g., \FUNC{shmem\_broadcastmem}). \tabularnewline \hline Destroying a team with unfreed private contexts & Before destroying a given