forked from openshmem-org/specification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_spec.tex
351 lines (227 loc) · 10.8 KB
/
main_spec.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
\documentclass[10pt]{book}
\input{utils/packages}
\input{utils/defs}
\begin{document}
\input{content/frontmatter}
\section{The OpenSHMEM Effort}\label{subsec:openshmem_effort}
\input{content/the_openshmem_effort}
\section{Programming Model Overview}\label{subsec:programming_model}
\input{content/programming_model_overview}
\section{Memory Model}\label{subsec:memory_model}
\input{content/memory_model}
\section{Execution Model}\label{subsec:execution_model}
\input{content/execution_model}
\section{Language Bindings and Conformance}\label{subsec:bindings}
\input{content/language_bindings_and_conformance}
\section{Library Constants}\label{subsec:library_constants}
\input{content/library_constants}
\section{Library Handles}\label{subsec:library_handles}
\input{content/library_handles}
\section{Environment Variables }\label{subsec:environment_variables}
\input{content/environment_variables}
\clearpage
\section{OpenSHMEM Library API}\label{sec:openshmem_library_api}
\subsection{Library Setup, Exit, and Query Routines}
The library setup and query interfaces that initialize and monitor the parallel
environment of the \acp{PE}.
\subsubsection{\textbf{SHMEM\_INIT}}\label{subsec:shmem_init}
\input{content/shmem_init}
\subsubsection{\textbf{SHMEM\_MY\_PE}}\label{subsec:shmem_my_pe}
\input{content/shmem_my_pe}
\subsubsection{\textbf{SHMEM\_N\_PES}}\label{subsec:shmem_n_pes}
\input{content/shmem_n_pes}
\subsubsection{\textbf{SHMEM\_FINALIZE}}\label{subsec:shmem_finalize}
\input{content/shmem_finalize}
\subsubsection{\textbf{SHMEM\_GLOBAL\_EXIT}}\label{subsec:shmem_global_exit}
\input{content/shmem_global_exit}
\subsubsection{\textbf{SHMEM\_PE\_ACCESSIBLE}}\label{subsec:shmem_pe_accessible}
\input{content/shmem_pe_accessible}
\subsubsection{\textbf{SHMEM\_ADDR\_ACCESSIBLE}}\label{subsec:shmem_addr_accessible}
\input{content/shmem_addr_accessible}
\subsubsection{\textbf{SHMEM\_PTR}}\label{subsec:shmem_ptr}
\input{content/shmem_ptr}
\subsubsection{\textbf{SHMEM\_INFO\_GET\_VERSION}}\label{subsec:shmem_info_get_version}
\input{content/shmem_info_get_version}
\subsubsection{\textbf{SHMEM\_INFO\_GET\_NAME}}\label{subsec:shmem_info_get_name}
\input{content/shmem_info_get_name}
\subsubsection{\textbf{START\_PES}}\label{subsec:start_pes}
\input{content/start_pes}
\subsection{Thread Support}
\label{subsec:thread_support}
\input{content/threads_intro.tex}
\subsubsection{\textbf{SHMEM\_INIT\_THREAD}}
\label{subsec:shmem_init_thread}
\input{content/shmem_init_thread}
\subsubsection{\textbf{SHMEM\_QUERY\_THREAD}}
\label{subsec:shmem_query_thread}
\input{content/shmem_query_thread}
\subsection{Memory Management Routines}
\label{sec:memory_management}
\openshmem provides a set of \acp{API} for managing the symmetric heap. The
\acp{API} allow one to dynamically allocate, deallocate, reallocate and align
symmetric data objects in the symmetric heap.
\subsubsection{\textbf{SHMEM\_MALLOC, SHMEM\_FREE, SHMEM\_REALLOC, SHMEM\_ALIGN}}\label{subsec:shfree}
\input{content/shmem_malloc.tex}
\subsubsection{\textbf{SHMEM\_CALLOC}}\label{subsec:shmem_calloc}
\input{content/shmem_calloc.tex}
\subsubsection{\textbf{SHPALLOC}}\label{subsec:shpalloc}
\input{content/shpalloc.tex}
\subsubsection{\textbf{SHPCLMOVE}}\label{subsec:shpclmove}
\input{content/shpclmove.tex}
\subsubsection{\textbf{SHPDEALLC}}\label{subsec:shpdeallc}
\input{content/shpdeallc.tex}
\subsection{Communication Management Routines}
\label{sec:ctx}
All \openshmem \ac{RMA}, \ac{AMO}, and memory ordering routines must be
performed on a valid communication context. The communication context defines an
independent ordering and completion environment, allowing users to manage the
overlap of communication with computation and also to manage communication
operations performed by separate threads within a multithreaded \ac{PE}. For
example, in single-threaded environments, contexts may be used to pipeline
communication and computation. In multithreaded environments, contexts may
additionally provide thread isolation, eliminating overheads resulting from
thread interference.
A specific communication context is referenced through a context handle, which is
passed as an argument in the \Cstd \CTYPE{shmem\_ctx\_*} and type-generic \ac{API}
routines. \ac{API} routines that do not accept a context handle argument operate on the
default context. The default context can be used explicitly through the
\LibHandleRef{SHMEM\_CTX\_DEFAULT} handle.
Context handles are of type \CTYPE{shmem\_ctx\_t} and may be used for
language-level assignment and equality comparison.
The default context is valid for the duration of the \openshmem portion of
an application.
Contexts created by a successful call to \FUNC{shmem\_ctx\_create} remain
valid until they are destroyed.
A handle value that does not correspond to a valid context is considered
to be invalid, and its use in \ac{RMA} and \ac{AMO} routines results in
undefined behavior.
A context handle may be initialized to or assigned the value
\CONST{SHMEM\_CTX\_INVALID} to indicate that handle does not reference a
valid communication context.
When managed in this way, applications can use an equality comparison
to test whether a given context handle references a valid context.
\subsubsection{\textbf{SHMEM\_CTX\_CREATE}}
\label{subsec:shmem_ctx_create}
\input{content/shmem_ctx_create.tex}
\subsubsection{\textbf{SHMEM\_CTX\_DESTROY}}
\label{subsec:shmem_ctx_destroy}
\input{content/shmem_ctx_destroy.tex}
\subsection{Remote Memory Access Routines}\label{sec:rma}
\input{content/rma_intro.tex}
\subsubsection{\textbf{SHMEM\_PUT}}\label{subsec:shmem_put}
\input{content/shmem_put.tex}
\subsubsection{\textbf{SHMEM\_P}}\label{subsec:shmem_p}
\input{content/shmem_p.tex}
\subsubsection{\textbf{SHMEM\_IPUT}}\label{subsec:shmem_iput}
\input{content/shmem_iput.tex}
\subsubsection{\textbf{SHMEM\_GET}}\label{subsec:shmem_get}
\input{content/shmem_get.tex}
\subsubsection{\textbf{SHMEM\_G}}\label{subsec:shmem_g}
\input{content/shmem_g.tex}
\subsubsection{\textbf{SHMEM\_IGET}}\label{subsec:shmem_iget}
\input{content/shmem_iget.tex}
\subsection{Non-blocking Remote Memory Access Routines}\label{sec:rma_nbi}
\subsubsection{\textbf{SHMEM\_PUT\_NBI}}\label{subsec:shmem_put_nbi}
\input{content/shmem_put_nbi.tex}
\subsubsection{\textbf{SHMEM\_GET\_NBI}}\label{subsec:shmem_get_nbi}
\input{content/shmem_get_nbi.tex}
\subsection{Atomic Memory Operations}\label{sec:amo}
\input{content/atomics_intro}
\subsubsection{\textbf{SHMEM\_ATOMIC\_FETCH}}
\label{subsec:shmem_atomic_fetch}
\input{content/shmem_atomic_fetch.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_SET}}
\label{subsec:shmem_atomic_set}
\input{content/shmem_atomic_set.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_COMPARE\_SWAP}}
\label{subsec:shmem_atomic_compare_swap}
\input{content/shmem_atomic_compare_swap.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_SWAP}}
\label{subsec:shmem_atomic_swap}
\input{content/shmem_atomic_swap.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_FETCH\_INC}}
\label{subsec:shmem_atomic_fetch_inc}
\input{content/shmem_atomic_fetch_inc.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_INC}}
\label{subsec:shmem_atomic_inc}
\input{content/shmem_atomic_inc.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_FETCH\_ADD}}
\label{subsec:shmem_atomic_fetch_add}
\input{content/shmem_atomic_fetch_add.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_ADD}}
\label{subsec:shmem_atomic_add}
\input{content/shmem_atomic_add.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_FETCH\_AND}}
\label{subsec:shmem_atomic_fetch_and}
\input{content/shmem_atomic_fetch_and.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_AND}}
\label{subsec:shmem_atomic_and}
\input{content/shmem_atomic_and.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_FETCH\_OR}}
\label{subsec:shmem_atomic_fetch_or}
\input{content/shmem_atomic_fetch_or.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_OR}}
\label{subsec:shmem_atomic_or}
\input{content/shmem_atomic_or.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_FETCH\_XOR}}
\label{subsec:shmem_atomic_fetch_xor}
\input{content/shmem_atomic_fetch_xor.tex}
\subsubsection{\textbf{SHMEM\_ATOMIC\_XOR}}
\label{subsec:shmem_atomic_xor}
\input{content/shmem_atomic_xor.tex}
\subsection{Collective Routines}\label{subsec:coll}
\input{content/collective_intro.tex}
\subsubsection{\textbf{SHMEM\_BARRIER\_ALL}}\label{subsec:shmem_barrier_all}
\input{content/shmem_barrier_all.tex}
\subsubsection{\textbf{SHMEM\_BARRIER}}\label{subsec:shmem_barrier}
\input{content/shmem_barrier.tex}
\subsubsection{\textbf{SHMEM\_SYNC\_ALL}}\label{subsec:shmem_sync_all}
\input{content/shmem_sync_all.tex}
\subsubsection{\textbf{SHMEM\_SYNC}}\label{subsec:shmem_sync}
\input{content/shmem_sync.tex}
\subsubsection{\textbf{SHMEM\_BROADCAST}}\label{subsec:shmem_broadcast}
\input{content/shmem_broadcast.tex}
\subsubsection{\textbf{SHMEM\_COLLECT, SHMEM\_FCOLLECT}}\label{subsec:shmem_collect}
\input{content/shmem_collect.tex}
\subsubsection{\textbf{SHMEM\_REDUCTIONS}}\label{subsec:shmem_reductions}
\input{content/shmem_reductions.tex}
\subsubsection{\textbf{SHMEM\_ALLTOALL}}\label{subsec:shmem_alltoall}
\input{content/shmem_alltoall.tex}
\subsubsection{\textbf{SHMEM\_ALLTOALLS}}\label{subsec:shmem_alltoalls}
\input{content/shmem_alltoalls.tex}
\subsection{Point-To-Point Synchronization Routines}\label{subsec:p2p_intro}
\input{content/p2p_sync_intro.tex}
\subsubsection{\textbf{SHMEM\_WAIT\_UNTIL}}\label{subsec:shmem_wait_until}
\input{content/shmem_wait_until.tex}
\subsubsection{\textbf{SHMEM\_TEST}}\label{subsec:shmem_test}
\input{content/shmem_test.tex}
\subsection{Memory Ordering Routines}\label{subsec:memory_order}
The following section discusses \openshmem \acp{API} that provide mechanisms to
ensure ordering and/or delivery of \OPR{Put}, \ac{AMO}, memory store,
and non-blocking \PUT{} and \GET{} routines to symmetric data objects.
\subsubsection{\textbf{SHMEM\_FENCE}}\label{subsec:shmem_fence}
\input{content/shmem_fence.tex}
\subsubsection{\textbf{SHMEM\_QUIET}}\label{subsec:shmem_quiet}
\input{content/shmem_quiet.tex}
\subsubsection{Synchronization and Communication Ordering in OpenSHMEM}
\input{content/synchronization_model.tex}
\subsection{Distributed Locking Routines}
The following section discusses \openshmem locks as a mechanism to provide
mutual exclusion. Three routines are available for distributed locking,
\textit{set, test} and \textit{clear}.
\subsubsection{\textbf{SHMEM\_LOCK}}\label{subsec:shmem_lock}
\input{content/shmem_lock.tex}
\subsection{Cache Management}
All of these routines are deprecated and are provided for backwards
compatibility. Implementations must include all items in this section, and the
routines should function properly and may notify the user about deprecation of
their use.
\subsubsection{\textbf{SHMEM\_CACHE}}\label{subsec:shmem_cache}
\input{content/shmem_cache.tex}
\clearpage
\input{content/backmatter}
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{Index}
\printindex
\end{document}