ESIO  0.2.0
esio.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // ExaScale IO library for turbulence simulation restart files
5 // http://github.com/RhysU/ESIO
6 //
7 // Copyright (C) 2010-2017, 2022, 2026 Rhys Ulerich
8 // Copyright (C) 2010-2017 The PECOS Development Team
9 //
10 // This file is part of ESIO.
11 //
12 // ESIO is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU Lesser General Public License as published
14 // by the Free Software Foundation, either version 3.0 of the License, or
15 // (at your option) any later version.
16 //
17 // ESIO is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU Lesser General Public License for more details.
21 //
22 // You should have received a copy of the GNU Lesser General Public License
23 // along with ESIO. If not, see <http://www.gnu.org/licenses/>.
24 //
25 //-----------------------------------------------------------------------el-
26 
27 #ifndef ESIO_ESIO_H
28 #define ESIO_ESIO_H
29 
30 #include <mpi.h>
31 #include <esio/visibility.h>
32 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
44 typedef struct esio_handle_s *esio_handle;
45 
50 /*\@{*/
51 
62 esio_handle esio_handle_initialize(MPI_Comm comm) ESIO_API;
63 
75 esio_handle esio_handle_initialize_fortran(MPI_Fint fcomm) ESIO_API;
88 int esio_handle_comm_size(const esio_handle h, int *size) ESIO_API;
89 
101 int esio_handle_comm_rank(const esio_handle h, int *rank) ESIO_API;
102 
110 int esio_handle_finalize(esio_handle h) ESIO_API;
111 /*\@}*/
112 
113 
118 /*\@{*/
119 
132 int esio_file_create(esio_handle h, const char *file, int overwrite) ESIO_API;
133 
146 int esio_file_open(esio_handle h, const char *file, int readwrite) ESIO_API;
147 
162  const char *srcfile,
163  const char *dstfile,
164  int overwrite) ESIO_API;
165 
183 char* esio_file_path(const esio_handle h) ESIO_API;
184 
192 int esio_file_flush(esio_handle h) ESIO_API;
193 
202 int esio_file_close(esio_handle h) ESIO_API;
203 
234  const char *restart_template,
235  int retain_count) ESIO_API;
236 /*\@}*/
237 
238 
242 /*\@{*/
243 
257 int
259  const char *location,
260  const char *name,
261  const char *value) ESIO_API;
262 
279 char*
281  const char *location,
282  const char *name) ESIO_API;
283 /*\@}*/
284 
285 
287 #define ESIO_ATTRIBUTE_WRITE_GEN(TYPE) \
288 int \
289 esio_attribute_write_##TYPE(const esio_handle h, \
290  const char *location, \
291  const char *name, \
292  const TYPE *value) \
293  ESIO_API;
294 
295 #ifdef __cplusplus
296 #define ESIO_ATTRIBUTE_WRITE_GEN_CXX(TYPE) \
297 extern "C++" inline int \
298 esio_attribute_write(const esio_handle h, \
299  const char *location, \
300  const char *name, \
301  const TYPE *value) \
302 { return esio_attribute_write_##TYPE(h,location,name,value); }
303 
304 /* Writing scalar attributes by value is too handy to skip. */
305 #define ESIO_ATTRIBUTE_WRITE_GEN_CXX_BY_VALUE(TYPE) \
306 extern "C++" inline int \
307 esio_attribute_write(const esio_handle h, \
308  const char *location, \
309  const char *name, \
310  const TYPE value) \
311 { return esio_attribute_write_##TYPE(h,location,name,&value); }
312 #endif
313 
314 #define ESIO_ATTRIBUTE_READ_GEN(TYPE) \
315 int \
316 esio_attribute_read_##TYPE(const esio_handle h, \
317  const char *location, \
318  const char *name, \
319  TYPE *value) \
320  ESIO_API;
321 
322 #ifdef __cplusplus
323 #define ESIO_ATTRIBUTE_READ_GEN_CXX(TYPE) \
324 extern "C++" inline int \
325 esio_attribute_read(const esio_handle h, \
326  const char *location, \
327  const char *name, \
328  TYPE *value) \
329 { return esio_attribute_read_##TYPE(h,location,name,value); }
330 #endif
331 
332 #define ESIO_ATTRIBUTE_WRITEV_GEN(TYPE) \
333 int \
334 esio_attribute_writev_##TYPE(const esio_handle h, \
335  const char *location, \
336  const char *name, \
337  const TYPE *value, \
338  int ncomponents) \
339  ESIO_API;
340 
341 #ifdef __cplusplus
342 #define ESIO_ATTRIBUTE_WRITEV_GEN_CXX(TYPE) \
343 extern "C++" inline int \
344 esio_attribute_writev(const esio_handle h, \
345  const char *location, \
346  const char *name, \
347  const TYPE *value, \
348  int ncomponents) \
349 { return esio_attribute_writev_##TYPE(h,location,name,value,ncomponents); }
350 #endif
351 
352 #define ESIO_ATTRIBUTE_READV_GEN(TYPE) \
353 int \
354 esio_attribute_readv_##TYPE(const esio_handle h, \
355  const char *location, \
356  const char *name, \
357  TYPE *value, \
358  int ncomponents) \
359  ESIO_API;
360 
361 #ifdef __cplusplus
362 #define ESIO_ATTRIBUTE_READV_GEN_CXX(TYPE) \
363 extern "C++" inline int \
364 esio_attribute_readv(const esio_handle h, \
365  const char *location, \
366  const char *name, \
367  TYPE *value, \
368  int ncomponents) \
369 { return esio_attribute_readv_##TYPE(h,location,name,value,ncomponents); }
370 #endif
371 
380 /*\@{*/
381 
395 ESIO_ATTRIBUTE_WRITE_GEN(double)
396 
397 #ifdef __cplusplus
398 
399 ESIO_ATTRIBUTE_WRITE_GEN_CXX(double)
400 
401 
402 ESIO_ATTRIBUTE_WRITE_GEN_CXX_BY_VALUE(double)
403 #endif
404 
409 ESIO_ATTRIBUTE_WRITE_GEN(float)
410 
411 #ifdef __cplusplus
412 
413 ESIO_ATTRIBUTE_WRITE_GEN_CXX(float)
414 
415 
416 ESIO_ATTRIBUTE_WRITE_GEN_CXX_BY_VALUE(float)
417 #endif
418 
423 ESIO_ATTRIBUTE_WRITE_GEN(int)
424 
425 #ifdef __cplusplus
426 
427 ESIO_ATTRIBUTE_WRITE_GEN_CXX(int)
428 
429 
430 ESIO_ATTRIBUTE_WRITE_GEN_CXX_BY_VALUE(int)
431 #endif
432 
445 ESIO_ATTRIBUTE_READ_GEN(double)
446 
447 #ifdef __cplusplus
448 
449 ESIO_ATTRIBUTE_READ_GEN_CXX(double)
450 #endif
451 
456 ESIO_ATTRIBUTE_READ_GEN(float)
457 
458 #ifdef __cplusplus
459 
460 ESIO_ATTRIBUTE_READ_GEN_CXX(float)
461 #endif
462 
467 ESIO_ATTRIBUTE_READ_GEN(int)
468 
469 #ifdef __cplusplus
470 
471 ESIO_ATTRIBUTE_READ_GEN_CXX(int)
472 #endif
473 /*\@}*/
474 
482 /*\@{*/
483 
498 ESIO_ATTRIBUTE_WRITEV_GEN(double)
499 
500 #ifdef __cplusplus
501 
502 ESIO_ATTRIBUTE_WRITEV_GEN_CXX(double)
503 #endif
504 
509 ESIO_ATTRIBUTE_WRITEV_GEN(float)
510 
511 #ifdef __cplusplus
512 
513 ESIO_ATTRIBUTE_WRITEV_GEN_CXX(float)
514 #endif
515 
520 ESIO_ATTRIBUTE_WRITEV_GEN(int)
521 
522 #ifdef __cplusplus
523 
524 ESIO_ATTRIBUTE_WRITEV_GEN_CXX(int)
525 #endif
526 
540 ESIO_ATTRIBUTE_READV_GEN(double)
541 
542 #ifdef __cplusplus
543 
544 ESIO_ATTRIBUTE_READV_GEN_CXX(double)
545 #endif
546 
551 ESIO_ATTRIBUTE_READV_GEN(float)
552 
553 #ifdef __cplusplus
554 
555 ESIO_ATTRIBUTE_READV_GEN_CXX(float)
556 #endif
557 
562 ESIO_ATTRIBUTE_READV_GEN(int)
563 
564 #ifdef __cplusplus
565 
566 ESIO_ATTRIBUTE_READV_GEN_CXX(int)
567 #endif
568 
585 int
587  const char *location,
588  const char *name,
589  int *ncomponents) ESIO_API;
590 /*\@}*/
591 
595 /*\@{*/
596 
609 int
611  int aglobal, int astart, int alocal) ESIO_API;
612 
629 int
631  int bglobal, int bstart, int blocal,
632  int aglobal, int astart, int alocal) ESIO_API;
633 
653 int
655  int cglobal, int cstart, int clocal,
656  int bglobal, int bstart, int blocal,
657  int aglobal, int astart, int alocal) ESIO_API;
658 
665 int
667  int *aglobal, int *astart, int *alocal) ESIO_API;
668 
675 int
677  int *bglobal, int *bstart, int *blocal,
678  int *aglobal, int *astart, int *alocal) ESIO_API;
679 
686 int
688  int *cglobal, int *cstart, int *clocal,
689  int *bglobal, int *bstart, int *blocal,
690  int *aglobal, int *astart, int *alocal) ESIO_API;
691 
692 /*\@}*/
693 
695 #undef ESIO_ATTRIBUTE_WRITE_GEN
696 #undef ESIO_ATTRIBUTE_READ_GEN
697 #undef ESIO_ATTRIBUTE_WRITEV_GEN
698 #undef ESIO_ATTRIBUTE_READV_GEN
699 #ifdef __cplusplus
700 #undef ESIO_ATTRIBUTE_WRITE_GEN_CXX
701 #undef ESIO_ATTRIBUTE_READ_GEN_CXX
702 #undef ESIO_ATTRIBUTE_WRITEV_GEN_CXX
703 #undef ESIO_ATTRIBUTE_READV_GEN_CXX
704 #endif
705 
706 #define ESIO_LINE_WRITE_GEN(TYPE) \
707 int \
708 esio_line_write_##TYPE(const esio_handle h, \
709  const char *name, \
710  const TYPE *line, \
711  int astride, \
712  const char *comment) \
713  ESIO_API;
714 
715 #ifdef __cplusplus
716 #define ESIO_LINE_WRITE_GEN_CXX(TYPE) \
717 extern "C++" inline int \
718 esio_line_write(const esio_handle h, \
719  const char *name, \
720  const TYPE *line, \
721  int astride, \
722  const char *comment = 0) \
723 { return esio_line_write_##TYPE(h,name,line,astride,comment); }
724 #endif
725 
726 #define ESIO_LINE_READ_GEN(TYPE) \
727 int \
728 esio_line_read_##TYPE(const esio_handle h, \
729  const char *name, \
730  TYPE *line, \
731  int astride) \
732  ESIO_API;
733 
734 #ifdef __cplusplus
735 #define ESIO_LINE_READ_GEN_CXX(TYPE) \
736 extern "C++" inline int \
737 esio_line_read(const esio_handle h, \
738  const char *name, \
739  TYPE *line, \
740  int astride) \
741 { return esio_line_read_##TYPE(h,name,line,astride); }
742 #endif
743 
744 #define ESIO_LINE_WRITEV_GEN(TYPE) \
745 int \
746 esio_line_writev_##TYPE(const esio_handle h, \
747  const char *name, \
748  const TYPE *line, \
749  int astride, \
750  int ncomponents, \
751  const char *comment) \
752  ESIO_API;
753 
754 #ifdef __cplusplus
755 #define ESIO_LINE_WRITEV_GEN_CXX(TYPE) \
756 extern "C++" inline int \
757 esio_line_writev(const esio_handle h, \
758  const char *name, \
759  const TYPE *line, \
760  int astride, \
761  int ncomponents, \
762  const char *comment = 0) \
763 { return esio_line_writev_##TYPE(h,name,line,astride,ncomponents, \
764  comment); }
765 #endif
766 
767 #define ESIO_LINE_READV_GEN(TYPE) \
768 int \
769 esio_line_readv_##TYPE(const esio_handle h, \
770  const char *name, \
771  TYPE *line, \
772  int astride, \
773  int ncomponents) \
774  ESIO_API;
775 
776 #ifdef __cplusplus
777 #define ESIO_LINE_READV_GEN_CXX(TYPE) \
778 extern "C++" inline int \
779 esio_line_readv(const esio_handle h, \
780  const char *name, \
781  TYPE *line, \
782  int astride, \
783  int ncomponents) \
784 { return esio_line_readv_##TYPE(h,name,line,astride,ncomponents); }
785 #endif
786 
795 /*\@{*/
796 
813 ESIO_LINE_WRITE_GEN(double)
814 
815 #ifdef __cplusplus
816 
817 ESIO_LINE_WRITE_GEN_CXX(double)
818 #endif
819 
824 ESIO_LINE_WRITE_GEN(float)
825 
826 #ifdef __cplusplus
827 
828 ESIO_LINE_WRITE_GEN_CXX(float)
829 #endif
830 
835 ESIO_LINE_WRITE_GEN(int)
836 
837 #ifdef __cplusplus
838 
839 ESIO_LINE_WRITE_GEN_CXX(int)
840 #endif
841 
856 ESIO_LINE_READ_GEN(double)
857 
858 #ifdef __cplusplus
859 
860 ESIO_LINE_READ_GEN_CXX(double)
861 #endif
862 
867 ESIO_LINE_READ_GEN(float)
868 
869 #ifdef __cplusplus
870 
871 ESIO_LINE_READ_GEN_CXX(float)
872 #endif
873 
878 ESIO_LINE_READ_GEN(int)
879 
880 #ifdef __cplusplus
881 
882 ESIO_LINE_READ_GEN_CXX(int)
883 #endif
884 
896 int
898  const char *name,
899  int *aglobal) ESIO_API;
900 
901 /*\@}*/
902 
910 /*\@{*/
911 
930 ESIO_LINE_WRITEV_GEN(double)
931 
932 #ifdef __cplusplus
933 
934 ESIO_LINE_WRITEV_GEN_CXX(double)
935 #endif
936 
941 ESIO_LINE_WRITEV_GEN(float)
942 
943 #ifdef __cplusplus
944 
945 ESIO_LINE_WRITEV_GEN_CXX(float)
946 #endif
947 
952 ESIO_LINE_WRITEV_GEN(int)
953 
954 #ifdef __cplusplus
955 
956 ESIO_LINE_WRITEV_GEN_CXX(int)
957 #endif
958 
975 ESIO_LINE_READV_GEN(double)
976 
977 #ifdef __cplusplus
978 
979 ESIO_LINE_READV_GEN_CXX(double)
980 #endif
981 
986 ESIO_LINE_READV_GEN(float)
987 
988 #ifdef __cplusplus
989 
990 ESIO_LINE_READV_GEN_CXX(float)
991 #endif
992 
997 ESIO_LINE_READV_GEN(int)
998 
999 #ifdef __cplusplus
1000 
1001 ESIO_LINE_READV_GEN_CXX(int)
1002 #endif
1003 
1019 int
1021  const char *name,
1022  int *aglobal,
1023  int *ncomponents) ESIO_API;
1024 /*\@}*/
1025 
1027 #undef ESIO_LINE_WRITE_GEN
1028 #undef ESIO_LINE_READ_GEN
1029 #undef ESIO_LINE_WRITEV_GEN
1030 #undef ESIO_LINE_READV_GEN
1031 #ifdef __cplusplus
1032 #undef ESIO_LINE_WRITE_GEN_CXX
1033 #undef ESIO_LINE_READ_GEN_CXX
1034 #undef ESIO_LINE_WRITEV_GEN_CXX
1035 #undef ESIO_LINE_READV_GEN_CXX
1036 #endif
1037 
1038 #define ESIO_PLANE_WRITE_GEN(TYPE) \
1039 int \
1040 esio_plane_write_##TYPE(const esio_handle h, \
1041  const char *name, \
1042  const TYPE *plane, \
1043  int bstride, int astride, \
1044  const char *comment) \
1045  ESIO_API;
1046 
1047 #ifdef __cplusplus
1048 #define ESIO_PLANE_WRITE_GEN_CXX(TYPE) \
1049 extern "C++" inline int \
1050 esio_plane_write(const esio_handle h, \
1051  const char *name, \
1052  const TYPE *plane, \
1053  int bstride, int astride, \
1054  const char *comment = 0) \
1055 { return esio_plane_write_##TYPE(h,name,plane,bstride,astride,comment); }
1056 #endif
1057 
1058 #define ESIO_PLANE_READ_GEN(TYPE) \
1059 int \
1060 esio_plane_read_##TYPE(const esio_handle h, \
1061  const char *name, \
1062  TYPE *plane, \
1063  int bstride, int astride) \
1064  ESIO_API;
1065 
1066 #ifdef __cplusplus
1067 #define ESIO_PLANE_READ_GEN_CXX(TYPE) \
1068 extern "C++" inline int \
1069 esio_plane_read(const esio_handle h, \
1070  const char *name, \
1071  TYPE *plane, \
1072  int bstride, int astride) \
1073 { return esio_plane_read_##TYPE(h,name,plane,bstride,astride); }
1074 #endif
1075 
1076 #define ESIO_PLANE_WRITEV_GEN(TYPE) \
1077 int \
1078 esio_plane_writev_##TYPE(const esio_handle h, \
1079  const char *name, \
1080  const TYPE *plane, \
1081  int bstride, int astride, \
1082  int ncomponents, \
1083  const char *comment) \
1084  ESIO_API;
1085 
1086 #ifdef __cplusplus
1087 #define ESIO_PLANE_WRITEV_GEN_CXX(TYPE) \
1088 extern "C++" inline int \
1089 esio_plane_writev(const esio_handle h, \
1090  const char *name, \
1091  const TYPE *plane, \
1092  int bstride, int astride, \
1093  int ncomponents, \
1094  const char *comment = 0) \
1095 { return esio_plane_writev_##TYPE(h,name,plane,bstride,astride,ncomponents, \
1096  comment); }
1097 #endif
1098 
1099 #define ESIO_PLANE_READV_GEN(TYPE) \
1100 int \
1101 esio_plane_readv_##TYPE(const esio_handle h, \
1102  const char *name, \
1103  TYPE *plane, \
1104  int bstride, int astride, \
1105  int ncomponents) \
1106  ESIO_API;
1107 
1108 #ifdef __cplusplus
1109 #define ESIO_PLANE_READV_GEN_CXX(TYPE) \
1110 extern "C++" inline int \
1111 esio_plane_readv(const esio_handle h, \
1112  const char *name, \
1113  TYPE *plane, \
1114  int bstride, int astride, \
1115  int ncomponents) \
1116 { return esio_plane_readv_##TYPE(h,name,plane,bstride,astride,ncomponents); }
1117 #endif
1118 
1127 /*\@{*/
1128 
1149 ESIO_PLANE_WRITE_GEN(double)
1150 
1151 #ifdef __cplusplus
1152 
1153 ESIO_PLANE_WRITE_GEN_CXX(double)
1154 #endif
1155 
1160 ESIO_PLANE_WRITE_GEN(float)
1161 
1162 #ifdef __cplusplus
1163 
1164 ESIO_PLANE_WRITE_GEN_CXX(float)
1165 #endif
1166 
1171 ESIO_PLANE_WRITE_GEN(int)
1172 
1173 #ifdef __cplusplus
1174 
1175 ESIO_PLANE_WRITE_GEN_CXX(int)
1176 #endif
1177 
1196 ESIO_PLANE_READ_GEN(double)
1197 
1198 #ifdef __cplusplus
1199 
1200 ESIO_PLANE_READ_GEN_CXX(double)
1201 #endif
1202 
1207 ESIO_PLANE_READ_GEN(float)
1208 
1209 #ifdef __cplusplus
1210 
1211 ESIO_PLANE_READ_GEN_CXX(float)
1212 #endif
1213 
1218 ESIO_PLANE_READ_GEN(int)
1219 
1220 #ifdef __cplusplus
1221 
1222 ESIO_PLANE_READ_GEN_CXX(int)
1223 #endif
1224 
1240 int
1242  const char *name,
1243  int *bglobal, int *aglobal) ESIO_API;
1244 /*\@}*/
1245 
1253 /*\@{*/
1254 
1277 ESIO_PLANE_WRITEV_GEN(double)
1278 
1279 #ifdef __cplusplus
1280 
1281 ESIO_PLANE_WRITEV_GEN_CXX(double)
1282 #endif
1283 
1288 ESIO_PLANE_WRITEV_GEN(float)
1289 
1290 #ifdef __cplusplus
1291 
1292 ESIO_PLANE_WRITEV_GEN_CXX(float)
1293 #endif
1294 
1299 ESIO_PLANE_WRITEV_GEN(int)
1300 
1301 #ifdef __cplusplus
1302 
1303 ESIO_PLANE_WRITEV_GEN_CXX(int)
1304 #endif
1305 
1326 ESIO_PLANE_READV_GEN(double)
1327 
1328 #ifdef __cplusplus
1329 
1330 ESIO_PLANE_READV_GEN_CXX(double)
1331 #endif
1332 
1337 ESIO_PLANE_READV_GEN(float)
1338 
1339 #ifdef __cplusplus
1340 
1341 ESIO_PLANE_READV_GEN_CXX(float)
1342 #endif
1343 
1348 ESIO_PLANE_READV_GEN(int)
1349 
1350 #ifdef __cplusplus
1351 
1352 ESIO_PLANE_READV_GEN_CXX(int)
1353 #endif
1354 
1373 int
1375  const char *name,
1376  int *bglobal, int *aglobal,
1377  int *ncomponents) ESIO_API;
1378 /*\@}*/
1379 
1381 #undef ESIO_PLANE_WRITE_GEN
1382 #undef ESIO_PLANE_READ_GEN
1383 #undef ESIO_PLANE_WRITEV_GEN
1384 #undef ESIO_PLANE_READV_GEN
1385 #ifdef __cplusplus
1386 #undef ESIO_PLANE_WRITE_GEN_CXX
1387 #undef ESIO_PLANE_READ_GEN_CXX
1388 #undef ESIO_PLANE_WRITEV_GEN_CXX
1389 #undef ESIO_PLANE_READV_GEN_CXX
1390 #endif
1391 
1392 #define ESIO_FIELD_WRITE_GEN(TYPE) \
1393 int \
1394 esio_field_write_##TYPE(const esio_handle h, \
1395  const char *name, \
1396  const TYPE *field, \
1397  int cstride, int bstride, int astride, \
1398  const char *comment) \
1399  ESIO_API;
1400 
1401 #ifdef __cplusplus
1402 #define ESIO_FIELD_WRITE_GEN_CXX(TYPE) \
1403 extern "C++" inline int \
1404 esio_field_write(const esio_handle h, \
1405  const char *name, \
1406  const TYPE *field, \
1407  int cstride, int bstride, int astride, \
1408  const char *comment = 0) \
1409 { return esio_field_write_##TYPE(h,name,field,cstride,bstride,astride, \
1410  comment); }
1411 #endif
1412 
1413 #define ESIO_FIELD_READ_GEN(TYPE) \
1414 int \
1415 esio_field_read_##TYPE(const esio_handle h, \
1416  const char *name, \
1417  TYPE *field, \
1418  int cstride, int bstride, int astride) \
1419  ESIO_API;
1420 
1421 #ifdef __cplusplus
1422 #define ESIO_FIELD_READ_GEN_CXX(TYPE) \
1423 extern "C++" inline int \
1424 esio_field_read(const esio_handle h, \
1425  const char *name, \
1426  TYPE *field, \
1427  int cstride, int bstride, int astride) \
1428 { return esio_field_read_##TYPE(h,name,field,cstride,bstride,astride); }
1429 #endif
1430 
1431 #define ESIO_FIELD_WRITEV_GEN(TYPE) \
1432 int \
1433 esio_field_writev_##TYPE(const esio_handle h, \
1434  const char *name, \
1435  const TYPE *field, \
1436  int cstride, int bstride, int astride, \
1437  int ncomponents, \
1438  const char *comment) \
1439  ESIO_API;
1440 
1441 #ifdef __cplusplus
1442 #define ESIO_FIELD_WRITEV_GEN_CXX(TYPE) \
1443 extern "C++" inline int \
1444 esio_field_writev(const esio_handle h, \
1445  const char *name, \
1446  const TYPE *field, \
1447  int cstride, int bstride, int astride, \
1448  int ncomponents, \
1449  const char *comment = 0) \
1450 { return esio_field_writev_##TYPE(h,name,field,cstride,bstride,astride, \
1451  ncomponents,comment); }
1452 #endif
1453 
1454 #define ESIO_FIELD_READV_GEN(TYPE) \
1455 int \
1456 esio_field_readv_##TYPE(const esio_handle h, \
1457  const char *name, \
1458  TYPE *field, \
1459  int cstride, int bstride, int astride, \
1460  int ncomponents) \
1461  ESIO_API;
1462 
1463 #ifdef __cplusplus
1464 #define ESIO_FIELD_READV_GEN_CXX(TYPE) \
1465 extern "C++" inline int \
1466 esio_field_readv(const esio_handle h, \
1467  const char *name, \
1468  TYPE *field, \
1469  int cstride, int bstride, int astride, \
1470  int ncomponents) \
1471 { return esio_field_readv_##TYPE(h,name,field,cstride,bstride,astride, \
1472  ncomponents); }
1473 #endif
1474 
1483 /*\@{*/
1484 
1507 ESIO_FIELD_WRITE_GEN(double)
1508 
1509 #ifdef __cplusplus
1510 
1511 ESIO_FIELD_WRITE_GEN_CXX(double)
1512 #endif
1513 
1518 ESIO_FIELD_WRITE_GEN(float)
1519 
1520 #ifdef __cplusplus
1521 
1522 ESIO_FIELD_WRITE_GEN_CXX(float)
1523 #endif
1524 
1529 ESIO_FIELD_WRITE_GEN(int)
1530 
1531 #ifdef __cplusplus
1532 
1533 ESIO_FIELD_WRITE_GEN_CXX(int)
1534 #endif
1535 
1556 ESIO_FIELD_READ_GEN(double)
1557 
1558 #ifdef __cplusplus
1559 
1560 ESIO_FIELD_READ_GEN_CXX(double)
1561 #endif
1562 
1567 ESIO_FIELD_READ_GEN(float)
1568 
1569 #ifdef __cplusplus
1570 
1571 ESIO_FIELD_READ_GEN_CXX(float)
1572 #endif
1573 
1578 ESIO_FIELD_READ_GEN(int)
1579 
1580 #ifdef __cplusplus
1581 
1582 ESIO_FIELD_READ_GEN_CXX(int)
1583 #endif
1584 
1602 int
1604  const char *name,
1605  int *cglobal, int *bglobal, int *aglobal) ESIO_API;
1606 /*\@}*/
1607 
1608 
1616 /*\@{*/
1617 
1642 ESIO_FIELD_WRITEV_GEN(double)
1643 
1644 #ifdef __cplusplus
1645 
1646 ESIO_FIELD_WRITEV_GEN_CXX(double)
1647 #endif
1648 
1653 ESIO_FIELD_WRITEV_GEN(float)
1654 
1655 #ifdef __cplusplus
1656 
1657 ESIO_FIELD_WRITEV_GEN_CXX(float)
1658 #endif
1659 
1664 ESIO_FIELD_WRITEV_GEN(int)
1665 
1666 #ifdef __cplusplus
1667 
1668 ESIO_FIELD_WRITEV_GEN_CXX(int)
1669 #endif
1670 
1693 ESIO_FIELD_READV_GEN(double)
1694 
1695 #ifdef __cplusplus
1696 
1697 ESIO_FIELD_READV_GEN_CXX(double)
1698 #endif
1699 
1704 ESIO_FIELD_READV_GEN(float)
1705 
1706 #ifdef __cplusplus
1707 
1708 ESIO_FIELD_READV_GEN_CXX(float)
1709 #endif
1710 
1715 ESIO_FIELD_READV_GEN(int)
1716 
1717 #ifdef __cplusplus
1718 
1719 ESIO_FIELD_READV_GEN_CXX(int)
1720 #endif
1721 
1742 int
1744  const char *name,
1745  int *cglobal, int *bglobal, int *aglobal,
1746  int *ncomponents) ESIO_API;
1747 /*\@}*/
1748 
1750 #undef ESIO_FIELD_WRITE_GEN
1751 #undef ESIO_FIELD_READ_GEN
1752 #undef ESIO_FIELD_WRITEV_GEN
1753 #undef ESIO_FIELD_READV_GEN
1754 #ifdef __cplusplus
1755 #undef ESIO_FIELD_WRITE_GEN_CXX
1756 #undef ESIO_FIELD_READ_GEN_CXX
1757 #undef ESIO_FIELD_WRITEV_GEN_CXX
1758 #undef ESIO_FIELD_READV_GEN_CXX
1759 #endif
1760 
1766 /*\@{*/
1767 
1774 int esio_field_layout_count(void) ESIO_API;
1775 
1786 int esio_field_layout_get(const esio_handle h) ESIO_API;
1787 
1798 int esio_field_layout_set(esio_handle h, int layout_index) ESIO_API;
1799 /*\@}*/
1800 
1801 #ifdef __cplusplus
1802 } /* extern "C" */
1803 #endif
1804 
1805 #endif /* ESIO_ESIO_H */
esio_field_size
int esio_field_size(const esio_handle h, const char *name, int *cglobal, int *bglobal, int *aglobal)
Write a scalar-valued double field.
esio_file_close
int esio_file_close(esio_handle h)
Close any currently open file.
esio_plane_established
int esio_plane_established(esio_handle h, int *bglobal, int *bstart, int *blocal, int *aglobal, int *astart, int *alocal)
Retrieve any parallel decomposition previously established for plane operations.
esio_line_established
int esio_line_established(esio_handle h, int *aglobal, int *astart, int *alocal)
Retrieve any parallel decomposition previously established for line operations.
esio_field_layout_get
int esio_field_layout_get(const esio_handle h)
Get the default layout associated with the given handle.
esio_handle_initialize
esio_handle esio_handle_initialize(MPI_Comm comm)
Initialize a handle against the given MPI communicator.
esio_attribute_sizev
int esio_attribute_sizev(const esio_handle h, const char *location, const char *name, int *ncomponents)
Write a vector-valued double attribute.
esio_line_size
int esio_line_size(const esio_handle h, const char *name, int *aglobal)
Write a scalar-valued double line.
esio_field_layout_set
int esio_field_layout_set(esio_handle h, int layout_index)
Set the default layout associated with the given handle.
esio_string_set
int esio_string_set(const esio_handle h, const char *location, const char *name, const char *value)
Set a string-valued attribute.
esio_field_sizev
int esio_field_sizev(const esio_handle h, const char *name, int *cglobal, int *bglobal, int *aglobal, int *ncomponents)
Write a vector-valued double field.
esio_plane_sizev
int esio_plane_sizev(const esio_handle h, const char *name, int *bglobal, int *aglobal, int *ncomponents)
Write a vector-valued double plane.
esio_line_sizev
int esio_line_sizev(const esio_handle h, const char *name, int *aglobal, int *ncomponents)
Write a vector-valued double line.
esio_file_flush
int esio_file_flush(esio_handle h)
Flush buffers associated with any currently open file.
esio_file_create
int esio_file_create(esio_handle h, const char *file, int overwrite)
Create a new file or overwrite an existing one.
esio_file_path
char * esio_file_path(const esio_handle h)
Get the canonical path to the currently open file.
esio_field_establish
int esio_field_establish(esio_handle h, int cglobal, int cstart, int clocal, int bglobal, int bstart, int blocal, int aglobal, int astart, int alocal)
Establish the parallel decomposition to use for subsequent field operations.
esio_plane_establish
int esio_plane_establish(esio_handle h, int bglobal, int bstart, int blocal, int aglobal, int astart, int alocal)
Establish the parallel decomposition to use for subsequent plane operations.
esio_field_established
int esio_field_established(esio_handle h, int *cglobal, int *cstart, int *clocal, int *bglobal, int *bstart, int *blocal, int *aglobal, int *astart, int *alocal)
Retrieve any parallel decomposition previously established for field operations.
esio_field_layout_count
int esio_field_layout_count(void)
Query the number of layouts available within ESIO.
esio_handle_comm_rank
int esio_handle_comm_rank(const esio_handle h, int *rank)
Retrieve the rank of the local MPI process as seen by the MPI communicator over which the handle coll...
esio_file_close_restart
int esio_file_close_restart(esio_handle h, const char *restart_template, int retain_count)
Close the currently open file and rename it to match the path given in restart_template.
esio_plane_size
int esio_plane_size(const esio_handle h, const char *name, int *bglobal, int *aglobal)
Write a scalar-valued double plane.
esio_file_open
int esio_file_open(esio_handle h, const char *file, int readwrite)
Open an existing file.
esio_line_establish
int esio_line_establish(esio_handle h, int aglobal, int astart, int alocal)
Establish the parallel decomposition to use for subsequent line operations.
esio_handle_finalize
int esio_handle_finalize(esio_handle h)
Finalize a handle.
esio_file_clone
int esio_file_clone(esio_handle h, const char *srcfile, const char *dstfile, int overwrite)
Create and open a new file by cloning the contents of an existing file.
esio_string_get
char * esio_string_get(const esio_handle h, const char *location, const char *name)
Get a string-valued attribute.
esio_handle_comm_size
int esio_handle_comm_size(const esio_handle h, int *size)
Retrieve the size of the MPI communicator over which the handle collectively operates.
esio_handle
struct esio_handle_s * esio_handle
An opaque type following ESIO's handle concept.
Definition: esio.h:44

Generated on Sat Jul 4 2026 17:52:45 for ESIO by  doxygen 1.8.17