diff --git a/content/backmatter.tex b/content/backmatter.tex index 10191168..3baa7c60 100644 --- a/content/backmatter.tex +++ b/content/backmatter.tex @@ -653,6 +653,16 @@ \subsection{Table~\ref{p2psynctypes}: point-to-point synchronization types} \chapter{Changes to this Document}\label{sec:changelog} +\section{Version 1.6} + +The following list describes the specific changes in \openshmem[1.6]: +\begin{itemize} + +\item Added \FUNC{shmem\_initialized} and \FUNC{shmem\_finalized} to + provide a query mechanism for the state of the \openshmem library. + +\end{itemize} + \section{Version 1.5} Major changes in \openshmem[1.5] include the addition of new team-based collective functions, \OPR{put-with-signal} functions, nonblocking \ac{AMO} diff --git a/content/shmem_finalized.tex b/content/shmem_finalized.tex new file mode 100644 index 00000000..3626392b --- /dev/null +++ b/content/shmem_finalized.tex @@ -0,0 +1,32 @@ +\apisummary{ + Indicates whether the \openshmem library has been finalized. +} + +\begin{apidefinition} + +\begin{Csynopsis} +int @\FuncDecl{shmem\_finalized}@(void); +\end{Csynopsis} + +\begin{apiarguments} + \apiargument{None}{}{} +\end{apiarguments} + +\apidescription{ + The \FUNC{shmem\_finalized} routine returns a value indicating + whether the \openshmem library has been finalized (i.e, a call to + \FUNC{shmem\_finalize} has completed successfully). + This routine may be called at any point in an \openshmem program, + including before \FUNC{shmem\_init[\_thread]} and after + \FUNC{shmem\_finalize}. + This routine may be called by any thread of execution in the + \ac{PE}, independent of the level of thread support provided by the + implementation. +} + +\apireturnvalues{ + Returns \CONST{1} if the \openshmem library has been finalized; + otherwise, returns \CONST{0}. +} + +\end{apidefinition} diff --git a/content/shmem_initialized.tex b/content/shmem_initialized.tex new file mode 100644 index 00000000..9d88bebe --- /dev/null +++ b/content/shmem_initialized.tex @@ -0,0 +1,44 @@ +\apisummary{ + Indicates whether the \openshmem library has been initialized. +} + +\begin{apidefinition} + +\begin{Csynopsis} +int @\FuncDecl{shmem\_initialized}@(void); +\end{Csynopsis} + +\begin{apiarguments} + \apiargument{None}{}{} +\end{apiarguments} + +\apidescription{ + The \FUNC{shmem\_initialized} routine returns a value indicating + whether the \openshmem library has been initialized (i.e, a call to + either \FUNC{shmem\_init} or \FUNC{shmem\_init\_thread} has + completed successfully). + This routine may be called at any point in an \openshmem program, + including before \FUNC{shmem\_init[\_thread]} and after + \FUNC{shmem\_finalize}. + This routine may be called by any thread of execution in the + \ac{PE}, independent of the level of thread support provided by the + implementation. +} + +\apireturnvalues{ + Returns \CONST{1} if the \openshmem library has been initialized; + otherwise, returns \CONST{0}. +} + +\apinotes{ + Although \FUNC{shmem\_initialized} is thread-safe, its return value + is not a sufficient guard to prevent multiple threads from racing to + initialize the \openshmem library concurrently, as + \FUNC{shmem\_initialized} may return \CONST{0} to one thread while + library initialization is in progress due to a call from another + thread. Applications must ensure that only one call to + \FUNC{shmem\_init[\_thread]} is made to initialize the \openshmem + library. +} + +\end{apidefinition} diff --git a/main_spec.tex b/main_spec.tex index d9e91421..f9d02bc8 100644 --- a/main_spec.tex +++ b/main_spec.tex @@ -56,6 +56,12 @@ \subsubsection{\textbf{SHMEM\_N\_PES}}\label{subsec:shmem_n_pes} \subsubsection{\textbf{SHMEM\_FINALIZE}}\label{subsec:shmem_finalize} \input{content/shmem_finalize} +\subsubsection{\textbf{SHMEM\_INITIALIZED}}\label{subsec:shmem_initialized} +\input{content/shmem_initialized} + +\subsubsection{\textbf{SHMEM\_FINALIZED}}\label{subsec:shmem_finalized} +\input{content/shmem_finalized} + \subsubsection{\textbf{SHMEM\_GLOBAL\_EXIT}}\label{subsec:shmem_global_exit} \input{content/shmem_global_exit}