diff --git a/content/shmem_ctx_session_start.tex b/content/shmem_ctx_session_start.tex index 7c771d24..4546a9a0 100644 --- a/content/shmem_ctx_session_start.tex +++ b/content/shmem_ctx_session_start.tex @@ -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{ diff --git a/example_code/shmem_ctx_session_example.c b/example_code/shmem_ctx_session_example.c index 8c96f49f..45f036ff 100644 --- a/example_code/shmem_ctx_session_example.c +++ b/example_code/shmem_ctx_session_example.c @@ -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;