From 265a97277dc60f1f1013b6c9b64855da8bf7c47c Mon Sep 17 00:00:00 2001 From: "Nicholas S. Park" Date: Tue, 6 Jul 2021 15:37:58 -0400 Subject: [PATCH 1/4] Initial interop text re: fork and subprocesses --- content/interoperability.tex | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/content/interoperability.tex b/content/interoperability.tex index bb9ed5a1..71b9298c 100644 --- a/content/interoperability.tex +++ b/content/interoperability.tex @@ -7,6 +7,39 @@ \chapter{Interoperability with Other Programming Models}\label{sec:interoperabil and advice to \openshmem library users and developers that may improve the portability and performance of hybrid programs. +\section{Subprocesses} + +In some cases, an \openshmem application may be used to create or +orchestrate other processes, which can be created through a number of +system-level interfaces. In these instances, such subprocesses are +subject to the following interoperability constraints. + +On platforms that provide the referenced POSIX\footnotemark[1] \acp{API}: + +\footnotetext[1]{POSIX, the Portable Operating System Interface, is + formally specified in IEEE Std 1003.1-2017 and The Open Group + Technical Standard Base Specifications, Issue 7.} + +\begin{itemize} +\item When \FUNC{fork} is invoked before the \openshmem library is + initialized, only one of either the parent or child processes may + initialize the \openshmem library. +\item When \FUNC{fork} is invoked within the \openshmem portion of the + program or after the \openshmem library has been finalized, the + newly created child process shall not call any \openshmem routines; + otherwise, the behavior is undefined. +\item Not all \openshmem implementations may support the use of + \FUNC{fork} during or after the \openshmem portion of a + program. When subprocess creation is needed in these instances, the + application is encouraged to make use of the \FUNC{posix\_spawn} and + \FUNC{posix\_spawnp} \acp{API}. +\end{itemize} + +\parimpnotes{ + All \openshmem implementations should ensure interoperability with + the \FUNC{posix\_spawn} and \FUNC{posix\_spawnp} \acp{API}. +} + \section{MPI Interoperability} From 29e7417b7c66d02ee11f0c19a45092f9fc13da95 Mon Sep 17 00:00:00 2001 From: Nick Park Date: Wed, 8 Sep 2021 15:19:29 -0400 Subject: [PATCH 2/4] Update 'fork' wording for consistency Co-authored-by: Bryant C. Lam --- content/interoperability.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/interoperability.tex b/content/interoperability.tex index 71b9298c..d5258836 100644 --- a/content/interoperability.tex +++ b/content/interoperability.tex @@ -29,8 +29,9 @@ \section{Subprocesses} newly created child process shall not call any \openshmem routines; otherwise, the behavior is undefined. \item Not all \openshmem implementations may support the use of - \FUNC{fork} during or after the \openshmem portion of a - program. When subprocess creation is needed in these instances, the + \FUNC{fork} within the \openshmem portion of the program or after + the \openshmem library has been finalized. + When subprocess creation is needed in these instances, the application is encouraged to make use of the \FUNC{posix\_spawn} and \FUNC{posix\_spawnp} \acp{API}. \end{itemize} From 507d7659cd02dab732da09d3d7b2c067dfce2aad Mon Sep 17 00:00:00 2001 From: "Nicholas S. Park" Date: Wed, 27 Oct 2021 20:04:03 -0400 Subject: [PATCH 3/4] Clarifying note on forking, exit handlers, and implicit finalization --- content/interoperability.tex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/interoperability.tex b/content/interoperability.tex index d5258836..f13bf75e 100644 --- a/content/interoperability.tex +++ b/content/interoperability.tex @@ -39,6 +39,12 @@ \section{Subprocesses} \parimpnotes{ All \openshmem implementations should ensure interoperability with the \FUNC{posix\_spawn} and \FUNC{posix\_spawnp} \acp{API}. + + \openshmem implementations that support implicit library + finalization for compatibility with \FUNC{start\_pes} should ensure + that child processes created after library initialization do not + implicitly call \openshmem operations as part of exit handlers + invoked during normal process termination. } From 8cd6cad0999ee85cad7a73e018e1bf76aeec8470 Mon Sep 17 00:00:00 2001 From: "Nicholas S. Park" Date: Wed, 27 Oct 2021 20:14:35 -0400 Subject: [PATCH 4/4] Changelog for fork/subprocess interoperability --- content/backmatter.tex | 6 +++++- content/interoperability.tex | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/content/backmatter.tex b/content/backmatter.tex index 755d4bc0..e6fc7282 100644 --- a/content/backmatter.tex +++ b/content/backmatter.tex @@ -668,6 +668,10 @@ \section{Version 1.6} \openshmem[1.5] Table 10, and clarified the types, names, and supporting operations for team-based reductions. \ChangelogRef{teamreducetypes}% +% +\item Clarified the interaction of the \openshmem library with + subprocess creation.% + \ChangelogRef{subsec:subprocess}% \end{itemize} \section{Version 1.5} @@ -742,7 +746,7 @@ \section{Version 1.5} subsec:shmem_reductions}% % \item Clarified interoperability of \openshmem with other programming models. -\ChangelogRef{sec:interoperability}% +\ChangelogRef{sec:interoperability, subsec:mpi}% % \item Clarified restrictions on using pointers to symmetric objects. \ChangelogRef{ diff --git a/content/interoperability.tex b/content/interoperability.tex index f13bf75e..6fabe8ac 100644 --- a/content/interoperability.tex +++ b/content/interoperability.tex @@ -7,7 +7,7 @@ \chapter{Interoperability with Other Programming Models}\label{sec:interoperabil and advice to \openshmem library users and developers that may improve the portability and performance of hybrid programs. -\section{Subprocesses} +\section{Subprocesses}\label{subsec:subprocess} In some cases, an \openshmem application may be used to create or orchestrate other processes, which can be created through a number of @@ -48,7 +48,7 @@ \section{Subprocesses} } -\section{MPI Interoperability} +\section{MPI Interoperability}\label{subsec:mpi} \openshmem and \ac{MPI} are two commonly used parallel programming models for distributed-memory systems. The user can choose to utilize both models in the same program