forked from openshmem-org/specification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshmem_finalize.tex
59 lines (48 loc) · 1.95 KB
/
shmem_finalize.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
\apisummary{
A collective operation that releases resources used by the \openshmem
library. This only terminates the \openshmem portion of a program, not the
entire program.
}
\begin{apidefinition}
\begin{Csynopsis}
void shmem_finalize(void);
\end{Csynopsis}
\begin{Fsynopsis}
CALL SHMEM_FINALIZE()
\end{Fsynopsis}
\begin{apiarguments}
\apiargument{None.}{}{}
\end{apiarguments}
\apidescription{
\FUNC{shmem\_finalize} is a collective operation that ends the \openshmem
portion of a program previously initialized by \FUNC{shmem\_init} and
releases resources used by the \openshmem library. This collective
operation requires all \acp{PE} to participate in the call. There is an
implicit global barrier in \FUNC{shmem\_finalize} so that pending
communications are completed, and no resources can be released until all
\acp{PE} have entered \FUNC{shmem\_finalize}. \FUNC{shmem\_finalize} must be
the last \openshmem library call encountered in the \openshmem portion of a
program. A call to \FUNC{shmem\_finalize} will release any resources
initialized by a corresponding call to \FUNC{shmem\_init}. All processes
that represent the \acp{PE} will still exist after the
call to \FUNC{shmem\_finalize} returns, but they will no longer have access
to any resources that have been released.
}
\apireturnvalues{
None.
}
\apinotes{
\FUNC{shmem\_finalize} releases all resources used by the \openshmem library
including the symmetric memory heap and pointers initiated by
\FUNC{shmem\_ptr}. This collective operation requires all \acp{PE} to
participate in the call, not just a subset of the \acp{PE}. The
non-\openshmem portion of a program may continue after a call to
\FUNC{shmem\_finalize} by all \acp{PE}.
}
\begin{apiexamples}
\apicexample
{The following finalize example is for C11 programs:}
{./example_code/shmem_finalize_example.c}
{}
\end{apiexamples}
\end{apidefinition}