Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions content/shmem_ctx_session_start.tex
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,28 @@
about \VAR{shmem\_ctx\_session\_config\_t} parameters.
} \hline

\sessiontablerow{\LibConstRef{SHMEM\_CTX\_SESSION\_SAME\_AMO}}{
The \VAR{SHMEM\_CTX\_SESSION\_SAME\_AMO} hint indicates the session will
contain a series of calls to AMO routines where each call performs the same
atomic operation (e.g., using only the \textit{increment} operation) on the
same datatype (e.g., only on objects of type \textit{int}).
As a more specific example, this hint would apply to a session that
includes \textit{only} calls to \FUNC{shmem\_int\_atomic\_inc}.
However, this hint would not apply to a session that includes both calls to
\FUNC{shmem\_int\_atomic\_inc} and \FUNC{shmem\_int\_atomic\_fetch},
because the operation \textit{fetch} differs from \textit{increment}.
(Similarly, this hint would not apply to a session that includes both calls to
\FUNC{shmem\_int\_atomic\_inc} and \FUNC{shmem\_long\_atomic\_inc},
because the datatype \textit{long} differs from \textit{int}.)
This hint does not restrict the application from calling other RMA and/or
signaling routines within the session.

The \VAR{total\_ops} field of \VAR{config} indicates the expected maximum
number of calls to \openshmem RMA routines within the session.
See Section~\ref{subsec:shmem_ctx_session_config_t} for details about
\VAR{shmem\_ctx\_session\_config\_t} parameters.
} \hline

\sessiontableend

\apinotes{
Expand Down
3 changes: 2 additions & 1 deletion example_code/shmem_ctx_session_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ int main(void) {
long config_mask;
config.total_ops = N_UPDATES;
config_mask = SHMEM_CTX_SESSION_TOTAL_OPS;
long options = SHMEM_CTX_SESSION_BATCH | SHMEM_CTX_SESSION_SAME_AMO;

shmem_ctx_session_start(ctx, SHMEM_CTX_SESSION_BATCH, &config, config_mask);
shmem_ctx_session_start(ctx, options, &config, config_mask);

for (size_t i = 0; i < N_UPDATES; i++) {
int random_pe = rand() % npes;
Expand Down