forked from pmix/pmix-standard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App_Support.tex
84 lines (58 loc) · 2.69 KB
/
App_Support.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Appendix: Support functions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{PMIx Support Functions}
\label{app:support}
This chapter describes some additional support APIs that are provided in the \ac{PRI} headers, but are not part of the core \ac{PMIx} standard specification as the macros reference internal \ac{PRI} functions exposed in the \ac{PRI}'s external headers.
%%%%%%%%%%%
\section{Data Structure Support}
This section describes some additional support macros focused on the data structures defined in \chapterref{chap:struct}.
%%%%%%%%%%%
\subsection{Argument array extension}
\declaremacro{PMIX_ARGV_APPEND}
%%%%
\summary
Append a string to a NULL-terminated, argv-style array of strings.
\cspecificstart
\begin{codepar}
PMIX_ARGV_APPEND(r, a, b);
\end{codepar}
\cspecificend
\begin{arglist}
\argout{r}{Status code indicating success or failure of the operation (\refstruct{pmix_status_t})}
\arginout{a}{Argument list (pointer to NULL-terminated array of strings)}
\argin{b}{Argument to append to the list (string)}
\end{arglist}
%%%%
\descr
This function helps the caller build the \code{argv} portion of \refstruct{pmix_app_t} structure, arrays of keys for querying, or other places where argv-style string arrays are required in the way that the \ac{PRI} expects it to be constructed.
\adviceuserstart
The provided argument is copied into the destination array - thus, the source string can be free'd without affecting the array once the macro has completed.
\adviceuserend
%%%%%%%%%%%
\section{Environment Manipulation Support}
This section describes some additional support APIs focused on environment manipulation.
%%%%%%%%%%%
\subsection{Set an environment variable}
\declaremacro{PMIX_SETENV}
%%%%
\summary
Set an environment variable in a NULL-terminated, env-style array
\cspecificstart
\begin{codepar}
PMIX_SETENV(r, name, value, env);
\end{codepar}
\cspecificend
\begin{arglist}
\argout{r}{Status code indicating success or failure of the operation (\refstruct{pmix_status_t})}
\argin{name}{Argument name (string)}
\argin{value}{Argument value (string)}
\arginout{env}{Environment array to update (pointer to array of strings)}
\end{arglist}
%%%%
\descr
Similar to \code{setenv} from the C API, this allows the caller to set an environment variable in the specified \code{env} array, which could then be passed to the \refstruct{pmix_app_t} structure or any other destination.
\adviceuserstart
The provided name and value are copied into the destination environment array - thus, the source strings can be free'd without affecting the array once the macro has completed.
\adviceuserend
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%