-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathc_api.tex
203 lines (122 loc) · 5.82 KB
/
c_api.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
%
% DATASET FUNCTIONS
%
\subsection*{A.1 Dataset Functions}
\begin{verbatim}
int ncmpi_create(MPI_Comm comm, const char *path, int cmode, MPI_Info info, int *ncidp);
int ncmpi_open(MPI_Comm comm, const char *path, int omode, MPI_Info info, int *ncidp);
int ncmpi_enddef(int ncid);
int ncmpi_redef(int ncid);
int ncmpi_get_file_info(int ncid, MPI_Info *info_used);
int ncmpi_sync(int ncid);
int ncmpi_abort(int ncid);
int ncmpi_begin_indep_data(int ncid);
int ncmpi_end_indep_data(int ncid);
int ncmpi_close(int ncid);
\end{verbatim}
% ncmpi_set_fill has not yet implemented
% int ncmpi_set_fill(int ncid, int fillmode, int *old_modep);
%
% DEFINE FUNCTIONS
%
\subsection*{A.2 Define Mode Functions}
\begin{verbatim}
int ncmpi_def_dim(int ncid, const char *name, MPI_Offset len, int *idp);
int ncmpi_def_var(int ncid, const char *name, nc_type xtype, int ndims,
const int *dimidsp, int *varidp);
int ncmpi_rename_dim(int ncid, int dimid, const char *name);
int ncmpi_rename_var(int ncid, int varid, const char *name);
\end{verbatim}
%
% INQUIRY FUNCTIONS
%
\subsection*{A.3 Inquiry Functions}
\begin{verbatim}
int ncmpi_inq(int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp);
int ncmpi_inq_ndims(int ncid, int *ndimsp);
int ncmpi_inq_nvars(int ncid, int *nvarsp);
int ncmpi_inq_natts(int ncid, int *ngattsp);
int ncmpi_inq_unlimdim(int ncid, int *unlimdimidp);
int ncmpi_inq_dimid(int ncid, const char *name, int *idp);
int ncmpi_inq_dim(int ncid, int dimid, char *name, MPI_Offset *lenp);
int ncmpi_inq_dimname(int ncid, int dimid, char *name);
int ncmpi_inq_dimlen(int ncid, int dimid, MPI_Offset *lenp);
int ncmpi_inq_var(int ncid, int varid, char *name, nc_type *xtypep,
int *ndimsp, int *dimidsp, int *nattsp);
int ncmpi_inq_varid(int ncid, const char *name, int *varidp);
int ncmpi_inq_varname(int ncid, int varid, char *name);
int ncmpi_inq_vartype(int ncid, int varid, nc_type *xtypep);
int ncmpi_inq_varndims(int ncid, int varid, int *ndimsp);
int ncmpi_inq_vardimid(int ncid, int varid, int *dimidsp);
int ncmpi_inq_varnatts(int ncid, int varid, int *nattsp);
\end{verbatim}
%
% ATTRIBUTE FUNCTIONS
%
\subsection*{A.4 Attribute Functions}
\begin{verbatim}
int ncmpi_inq_att(int ncid, int varid, const char *name, nc_type *xtypep,
MPI_Offset *lenp);
int ncmpi_inq_attid(int ncid, int varid, const char *name, int *idp);
int ncmpi_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep);
int ncmpi_inq_attlen(int ncid, int varid, const char *name, MPI_Offset *lenp);
int ncmpi_inq_attname(int ncid, int varid, int attnum, char *name);
int ncmpi_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out,
int varid_out);
int ncmpi_rename_att(int ncid, int varid, const char *name, const char *newname);
int ncmpi_del_att(int ncid, int varid, const char *name);
int ncmpi_put_att_text(int ncid, int varid, const char *name, MPI_Offset len,
const char *op);
int ncmpi_get_att_text(int ncid, int varid, const char *name, char *ip);
int ncmpi_put_att_uchar(int ncid, int varid, const char *name, nc_type xtype,
MPI_Offset len, const unsigned char *op);
int ncmpi_get_att_uchar(int ncid, int varid, const char *name, unsigned char *ip);
int ncmpi_put_att_schar(int ncid, int varid, const char *name, nc_type xtype,
MPI_Offset len, const signed char *op);
int ncmpi_get_att_schar(int ncid, int varid, const char *name, signed char *ip);
int ncmpi_put_att_short(int ncid, int varid, const char *name, nc_type xtype,
MPI_Offset len, const short *op);
int ncmpi_get_att_short(int ncid, int varid, const char *name, short *ip);
int ncmpi_put_att_int(int ncid, int varid, const char *name, nc_type xtype,
MPI_Offset len, const int *op);
int ncmpi_get_att_int(int ncid, int varid, const char *name, int *ip);
int ncmpi_put_att_long(int ncid, int varid, const char *name,
nc_type xtype, MPI_Offset len, const long *op);
int ncmpi_get_att_long(int ncid, int varid, const char *name, long *ip);
int ncmpi_put_att_float(int ncid, int varid, const char *name,
nc_type xtype, MPI_Offset len, const float *op);
int ncmpi_get_att_float(int ncid, int varid, const char *name, float *ip);
int ncmpi_put_att_double(int ncid, int varid, const char *name, nc_type xtype,
MPI_Offset len, const double *op);
int ncmpi_get_att_double(int ncid, int varid, const char *name, double *ip);
\end{verbatim}
%
% DATA FUNCTIONS
%
\subsection*{A.5 Data Mode Functions}
Recall that the data mode functions are split into the High Level data mode interface and the
Flexible data mode interface.
\subsubsection*{A.5.1 High Level Data Mode Interface}
The High Level functions most closely mimic the original NetCDF data mode interface.
% \emph{What about the single variable and varm functions? Are they important?}
\input data_mode_api
\subsubsection*{A.5.2 Flexible Data Mode Interface}
Note that there are considerably fewer functions in the flexible data mode
inteface, because these functions can handle all different types with the same
call. All of the high level functions are written in terms of these
functions.
\input flexible_api
\subsubsection*{A.5.3 Multiple Variable Data Mode Interface}
\input multiple_io
\subsubsection*{A.5.4 Nonblocking Data Mode Interface}
\input nonblocking
\subsubsection*{A.6 Other Utility Interface}
\begin{verbatim}
const char* ncmpi_strerror(int err);
int ncmpi_delete(char *filename, MPI_Info info);
int ncmpi_set_default_format(int format, int *old_formatp);
const char* ncmpi_inq_libvers(void);
int ncmpi_inq_format(int ncid, int *formatp);
int ncmpi_inq_file_format(char *filename, int *formatp);
int ncmpi_inq_version(int ncid, int *NC_mode);
\end{verbatim}