-
Notifications
You must be signed in to change notification settings - Fork 42
Add shmem_{initialized, finalized} #470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want "has been" or "is currently"? |
||
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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want "has been" or "is currently"? The problem with "has been" is that it tells you whether the API was ever called. If we assume that an OpenSHMEM library can't be reinitialized, then this is enough information to tell you the library state. If an OpenSHMEM library supports reinitialization then "has been" is not enough information to know the state of the library. You need to know "is currently".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, here is the NVSHMEM library state query function: https://docs.nvidia.com/hpc-sdk/nvshmem/api/docs/gen/api/setup.html#nvshmemx-init-status