Skip to content
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

Nonblocking Collectives #456

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4b9f48d
Adding first draft for nb collective intro, broadcast, and test
manjugv Oct 26, 2020
bb13dd6
Update: Addressing feedback from WG - Oct 26
manjugv Oct 26, 2020
df261dd
Adding NB blocking a2a; minor updates
manjugv Jan 21, 2022
48a012c
Adding collective wait
manjugv Jan 19, 2023
d3a7ac9
Adding shmem barrier all nonblocking
manjugv Mar 13, 2023
a3c8b15
Fixing description of SHMEM Collective Wait
manjugv Mar 31, 2023
1becb00
Change collective wait to shmem_req_wait
manjugv Mar 31, 2023
1cbd79a
Fix description of request param
manjugv Mar 31, 2023
f98cdf7
Add req object to NB barrier arguments
manjugv Sep 14, 2023
cc72331
Remove tagged collectives
manjugv Sep 28, 2023
a972738
Add missing 32 and 64 bit interfaces; minor edits
manjugv Sep 29, 2023
db8528c
Update content/nb_collectives_intro.tex
manjugv Sep 29, 2023
558e0d3
Update content/shmem_alltoall_nb.tex
manjugv Sep 29, 2023
ef3ecf1
Update content/shmem_barrier_all_nb.tex
manjugv Sep 29, 2023
db79fcb
Update content/shmem_broadcast_nb.tex
manjugv Sep 29, 2023
7d74314
Update content/shmem_broadcast_nb.tex
manjugv Sep 29, 2023
2355bf8
Remove 32 and 64 bit nb variants
manjugv Sep 30, 2023
b15c727
Minor edits: Remove active set mention
manjugv Sep 30, 2023
030a019
Make shmem_req_test/wait functions neutral
manjugv Sep 30, 2023
82e5d54
Update content/nb_collectives_intro.tex
Apr 12, 2024
fb0b482
Update content/shmem_alltoall_nb.tex
Apr 12, 2024
930b39c
Update content/shmem_broadcast_nb.tex
Apr 12, 2024
96f0b97
Update content/shmem_barrier_all_nb.tex
Apr 12, 2024
ff96cf5
Update content/shmem_collective_test.tex
Apr 12, 2024
ef49e8f
Update content/shmem_collective_wait.tex
Apr 12, 2024
e40b263
Minor update to nb_collectives_intro
May 10, 2024
02a539a
Inclusion of text from PR #507
Aug 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions content/library_constants.tex
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@
See Section~\ref{subsec:shmem_ctx_create} for more detail about its use.
\tabularnewline \hline
%%
\LibConstDecl{SHMEM\_REQ\_INVALID} &
A value corresponding to an invalid request handle.
This value can be used to initialize or update request handles to indicate
that they do not reference a valid request.
When managed in this way, applications can use an equality comparison
to test whether a given request handle references a valid request.
See Section~\ref{subsec:nb_coll} for more detail about its use.
\tabularnewline \hline
%%
\LibConstDecl{SHMEM\_SIGNAL\_SET} &
An integer constant expression corresponding to the signal update set operation.
See Section~\ref{subsec:shmem_put_signal} and
Expand Down
19 changes: 10 additions & 9 deletions content/nb_collectives_intro.tex
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
An \openshmem nonblocking collective operation, like a blocking collective
operation, is a group communication operation among the
participants of the team. All participants of the team are required to call the
collective operation.
participants of the team. All \acp{PE} in the team are required to call the
collective operation and each collective operation must be initiated in the same
order across all \acp{PE} while the execution may be performed in any order.

\begin{enumerate}

\item Invocation semantics: Upon invocation of a nonblocking collective routine,
the operation is initiated and the routine returns without ensuring completion. All participants of the Team
the operation is initiated and the routine returns without ensuring completion. All \acp{PE} in the team
must call this routine with identical arguments.

\item Collective Types: The nonblocking variants supported include barrier all, alltoall,
and broadcast collectives. Other collective operations such as
reductions, collect, barrier, alltoalls, and sync will not have nonblocking variants.
\item Collective Types: The nonblocking variants supported include the alltoall
and broadcast collectives. All other collective operations such as
reductions, collect, fcollect, barrier, barrier all, alltoalls, sync, and sync all will not have nonblocking variants.

Copy link
Collaborator

@davidozog davidozog Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should sync_all be supported? My hunch is it seems possibly useful...

\item Completion semantics: \openshmem programs can learn the status of the collective operations
\item Completion semantics: \openshmem programs can learn the status of the collective operations
using the \FUNC{shmem\_req\_test} routine. The operation is completed after
at least one call to \FUNC{shmem\_req\_test} or a call to \FUNC{shmem\_req\_wait}.
a call to \FUNC{shmem\_req\_test} or a call to \FUNC{shmem\_req\_wait}.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to what @kwaters4 mentioned. Add something like "Completion of the operation can be observed through one or more calls to \FUNC{shmem_req_test} or a single call to \FUNC{shmem_req_wait}."

\item Threads: While using SHMEM\_THREAD\_MULTIPLE, the \openshmem
programs are not allowed to call multiple collective operations on different threads
and the same Team.
and the same team.

\end{enumerate}

Expand Down
2 changes: 1 addition & 1 deletion content/shmem_alltoall_nb.tex
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
{\bf Invocation and completion}: A call to the nonblocking alltoall routine initiates the operation and returns
immediately without necessarily completing the operation. On success,
an opaque request handle is created and returned. The
operation is completed after at least one call to \FUNC{shmem\_req\_test} or
operation is completed after a call to \FUNC{shmem\_req\_test} or
a call to \FUNC{shmem\_req\_wait}. When the operation is complete, the request handle
is deallocated and cannot be reused.
Copy link
Contributor

@kwaters4 kwaters4 Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my understanding, this is currently worded in a way that both shmem_req_test and shmem_req_wait guarantee completion.

I believe the correct language exists in the intro on lines 17 and 18.

\item Completion semantics: \openshmem programs can learn the status of the collective operations using the \FUNC{shmem\_req\_test} routine and can be completed using the \FUNC{shmem\_req\_wait} routine.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwaters4 line 17 and 18 of the intro (completion semantics) states:

\item Completion semantics: \openshmem programs can learn the status of the collective operations using the \FUNC{shmem\_req\_test} routine. The operation is completed after a call to \FUNC{shmem\_req\_test} or a call to \FUNC{shmem\_req\_wait}.

This is the same as here other than the ability to observe the status of the collective. I believe the text you are quoting is older.

Copy link
Contributor

@kwaters4 kwaters4 Aug 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I misunderstand.

I thought shmem_req_test only checks the status of the collective. but then the program continues even if the non-blocking call is incomplete. While shmem_req_wait waits and guarantees completion.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shmem_req_test checks for completion and if complete, will deallocate the request handle, set the handle to SHMEM_REQ_INVALID, and returns 0.

I feel like this wording may be the confusing part:

The operation is completed after a call to \FUNC{shmem\_req\_test} or a call to \FUNC{shmem\_req\_wait}.

Maybe this wording is more clear:
Completion of the operation can be observed through one or more calls to \FUNC{shmem\_req\_test} or a single call to \FUNC{shmem\_req\_wait}.


Expand Down
47 changes: 0 additions & 47 deletions content/shmem_barrier_all_nb.tex

This file was deleted.

8 changes: 4 additions & 4 deletions content/shmem_broadcast_nb.tex
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
A call to the nonblocking broadcast routine initiates the operation and returns
immediately without necessarily completing the operation. On success,
an opaque request handle is created and returned. The
operation is completed after at least one call to \FUNC{shmem\_req\_test} or a
operation is completed after a call to \FUNC{shmem\_req\_test} or a
call to \FUNC{shmem\_req\_wait}. When the operation is complete, the request handle
is deallocated and cannot be reused.
Copy link
Contributor

@kwaters4 kwaters4 Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my understanding, this is currently worded in a way that both shmem_req_test and shmem_req_wait guarantee completion.

I believe the correct language exists in the intro on lines 17 and 18.

\item Completion semantics: \openshmem programs can learn the status of the collective operations using the \FUNC{shmem\_req\_test} routine and can be completed using the \FUNC{shmem\_req\_wait} routine.


Expand All @@ -82,9 +82,9 @@
Upon completion of a nonblocking broadcast routine, the following are true for the local
\ac{PE}:
\begin{itemize}
\item The \dest{} data object is
updated.
\item The \source{} data object may be safely reused.
\item The \dest{} data object is updated.
\item If the local \ac{PE} is \VAR{PE\_root}, the data has been copied
out of the \source{} data object.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this change to a separate PR and ask section committee to add it. @davidozog

\end{itemize}
}

Expand Down
9 changes: 5 additions & 4 deletions content/shmem_collective_test.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
\begin{apidefinition}

\begin{Csynopsis}
int @\FuncDecl{shmem\_req\_test}@(shmem_req_h request);
int @\FuncDecl{shmem\_req\_test}@(shmem_req_h *request);
\end{Csynopsis}

\begin{apiarguments}
Expand All @@ -17,9 +17,10 @@
\apidescription{
A call to \FUNC{shmem\_req\_test} returns immediately. If the
operation identified by the request is completed, it returns
zero, and the request object is deallocated and cannot be reused.
If the operation is not completed, it returns a non-negative integer. If
the request object is not valid, behavior is undefined.
zero, and the request object is deallocated and set to \LibConstRef{SHMEM\_REQ\_INVALID}.
If the operation is not completed, it returns a non-negative integer.
If the request object is not valid (i.e., it is set to \LibConstRef{SHMEM\_REQ\_INVALID}),
no operation is performed and a negative value is returned.

In a multithreaded environment, \FUNC{shmem\_req\_test} can be called by
different threads but on different request objects. It is the responsibility
Expand Down
15 changes: 8 additions & 7 deletions content/shmem_collective_wait.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
\begin{apidefinition}

\begin{Csynopsis}
int @\FuncDecl{shmem\_req\_wait}@(shmem_req_h request);
int @\FuncDecl{shmem\_req\_wait}@(shmem_req_h *request);
\end{Csynopsis}

\begin{apiarguments}
Expand All @@ -17,12 +17,13 @@

\apidescription{

The \FUNC{shmem\_req\_wait} function is a blocking operation used to determine whether an
operation identified by the request object has been completed. If the operation
is completed, \FUNC{shmem\_req\_wait} returns zero, and the request object is
deallocated and cannot be reused. If the operation has not been completed,
\FUNC{shmem\_req\_wait} blocks until the operation completes and then returns
zero. If the request object is not valid, behavior is undefined.
The \FUNC{shmem\_req\_wait} function is a blocking operation used to
determine whether an operation identified by the request object has
been completed. When the operation is completed, \FUNC{shmem\_req\_wait} returns
zero, and the request object is deallocated and set to \LibConstRef{SHMEM\_REQ\_INVALID}.
If the request object is not valid (i.e., it is set to
\LibConstRef{SHMEM\_REQ\_INVALID}), no operation is performed and a negative
value is returned.

In a multithreaded environment, \FUNC{shmem\_req\_wait} can be called by different
threads but on different request objects. It is the responsibility of the
Expand Down
3 changes: 0 additions & 3 deletions main_spec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,6 @@ \subsubsection{\textbf{SHMEM\_REDUCTIONS}}\label{subsec:shmem_reductions}
\subsection{Nonblocking Collective Routines}\label{subsec:nb_coll}
\input{content/nb_collectives_intro.tex}

\subsubsection{\textbf{SHMEM\_BARRIER\_ALL\_NB}}\label{subsec:shmem_barrier_all_nb}
\input{content/shmem_barrier_all_nb.tex}

\subsubsection{\textbf{SHMEM\_BROADCAST\_NB}}\label{subsec:shmem_broadcast_nb}
\input{content/shmem_broadcast_nb.tex}

Expand Down