8.3
general documentation
cs_io.h
Go to the documentation of this file.
1#ifndef __CS_IO_H__
2#define __CS_IO_H__
3
4/*============================================================================
5 * Low level file I/O utility functions for Preprocessor and restart files
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2024 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30#include "cs_defs.h"
31
32/*----------------------------------------------------------------------------
33 * Local headers
34 *----------------------------------------------------------------------------*/
35
36#include "cs_base.h"
37#include "cs_file.h"
38
39/*----------------------------------------------------------------------------*/
40
42
43/*=============================================================================
44 * Local Macro Definitions
45 *============================================================================*/
46
47#define CS_IO_NAME_LEN 32 /* Section header name length */
48
49#define CS_IO_ECHO_NONE -2 /* No verbosity at all */
50#define CS_IO_ECHO_OPEN_CLOSE -1 /* Echo open or close operations */
51#define CS_IO_ECHO_HEADERS 0 /* Echo headers */
52
53/*============================================================================
54 * Type definitions
55 *============================================================================*/
56
57/* Input or output mode */
58
59 typedef enum {
60
63
65
66/* Structure associated with opaque pre-processing structure object */
67
68typedef struct _cs_io_t cs_io_t;
69
70/* Structure used to save section header data, so as to simplify
71 passing this data to various functions */
72
73typedef struct {
74
75 const char *sec_name; /* Pointer to section name */
76 cs_file_off_t n_vals; /* Number of associated values */
77 size_t location_id; /* Id of associated location, or 0 */
78 size_t index_id; /* Id of associated index, or 0 */
79 size_t n_location_vals; /* Number of values per location */
80 cs_datatype_t elt_type; /* Type if n_elts > 0 */
81 cs_datatype_t type_read; /* Type in file */
82
84
85/*=============================================================================
86 * Global variables
87 *============================================================================*/
88
89/* Default hints for files using this API (for MPI-IO) */
90
91extern int cs_glob_io_hints;
92
93/*============================================================================
94 * Public function prototypes
95 *============================================================================*/
96
97/*----------------------------------------------------------------------------
98 * Initialize a kernel IO file structure.
99 *
100 * The magic string may be null only in read mode;
101 *
102 * If the position of section bodies is already known (after initial
103 * analysis for example), the file may be opened for reading section bodies
104 * only by using "seek_read_section_bodies_only" as a magic string. This may
105 * be used to map another type of file to kernel io files, if header data is
106 * different but body data is similar (binary, using the same datatypes).
107 *
108 * parameters:
109 * name <-- file name
110 * magic_string <-- magic string associated with file type
111 * mode <-- read or write
112 * method <-- file access method
113 * echo <-- echo on main output (< 0 if none, header if 0,
114 * n first and last elements if n > 0)
115 * hints <-- associated hints for MPI-IO, or MPI_INFO_NULL
116 * block_comm <-- handle to MPI communicator used for distributed file
117 * block access (may be a subset of comm if some ranks do
118 * not directly access distributed data blocks)
119 * comm <-- handle to main MPI communicator
120 *
121 * returns:
122 * pointer to kernel IO structure
123 *----------------------------------------------------------------------------*/
124
125#if defined(HAVE_MPI)
126
127cs_io_t *
128cs_io_initialize(const char *file_name,
129 const char *magic_string,
130 cs_io_mode_t mode,
131 cs_file_access_t method,
132 long echo,
133 MPI_Info hints,
134 MPI_Comm block_comm,
135 MPI_Comm comm);
136
137#else
138
139cs_io_t *
140cs_io_initialize(const char *file_name,
141 const char *magic_string,
142 cs_io_mode_t mode,
143 cs_file_access_t method,
144 long echo);
145
146#endif /* HAVE_MPI */
147
148/*----------------------------------------------------------------------------
149 * Initialize a kernel IO file structure in read mode, building an index.
150 *
151 * The magic string may be null, if we choose to ignore it.
152 *
153 * parameters:
154 * name <-- file name
155 * magic_string <-- magic string associated with file type
156 * method <-- file access method
157 * echo <-- echo on main output (< 0 if none, header if 0,
158 * n first and last elements if n > 0)
159 * hints <-- associated hints for MPI-IO, or MPI_INFO_NULL
160 * block_comm <-- handle to MPI communicator used for distributed file
161 * block access (may be a subset of comm if some ranks do
162 * not directly access distributed data blocks)
163 * comm <-- handle to main MPI communicator
164
165 * returns:
166 * pointer to kernel IO structure
167 *----------------------------------------------------------------------------*/
168
169#if defined(HAVE_MPI)
170
171cs_io_t *
172cs_io_initialize_with_index(const char *file_name,
173 const char *magic_string,
174 cs_file_access_t method,
175 long echo,
176 MPI_Info hints,
177 MPI_Comm block_comm,
178 MPI_Comm comm);
179#else
180
181cs_io_t *
182cs_io_initialize_with_index(const char *file_name,
183 const char *magic_string,
184 cs_file_access_t method,
185 long echo);
186
187#endif /* HAVE_MPI */
188
189/*----------------------------------------------------------------------------
190 * Initialize a kernel IO file structure with in-memory data,
191 * building an index.
192 *
193 * The magic string may be null, if we choose to ignore it.
194 *
195 * parameters:
196 * name <-- file name
197 * magic_string <-- magic string associated with file type
198 * method <-- file access method
199 * echo <-- echo on main output (< 0 if none, header if 0,
200 * n first and last elements if n > 0)
201 * nb <-- number of matching bytes for data
202 * data <-- data buffer (ownership is relinquished by caller)
203 * block_comm <-- handle to MPI communicator used for distributed file
204 * block access (may be a subset of comm if some ranks do
205 * not directly access distributed data blocks)
206 * comm <-- handle to main MPI communicator
207 *
208 * returns:
209 * pointer to kernel IO structure
210 *----------------------------------------------------------------------------*/
211
212#if defined(HAVE_MPI)
213cs_io_t *
214cs_io_initialize_with_index_from_mem(const char *file_name,
215 const char *magic_string,
216 cs_file_access_t method,
217 long echo,
218 size_t nb,
219 void *data,
220 MPI_Comm block_comm,
221 MPI_Comm comm);
222#else
223cs_io_t *
224cs_io_initialize_with_index_from_mem(const char *file_name,
225 const char *magic_string,
226 cs_file_access_t method,
227 long echo,
228 size_t nb,
229 void *data);
230#endif
231
232/*----------------------------------------------------------------------------
233 * Free a preprocessor output file structure, closing the associated file.
234 *
235 * parameters:
236 * pp_io <-> kernel IO structure
237 *----------------------------------------------------------------------------*/
238
239void
240cs_io_finalize(cs_io_t **pp_io);
241
242/*----------------------------------------------------------------------------
243 * Return a pointer to a preprocessor IO structure's name.
244 *
245 * parameters:
246 * pp_io <-- kernel IO structure
247 *----------------------------------------------------------------------------*/
248
249const char *
250cs_io_get_name(const cs_io_t *pp_io);
251
252/*----------------------------------------------------------------------------
253 * Return the number of indexed entries in a kernel IO structure.
254 *
255 * parameters:
256 * inp <-- input kernel IO structure
257 *
258 * returns:
259 * size of index if present, 0 otherwise,
260 *----------------------------------------------------------------------------*/
261
262size_t
264
265/*----------------------------------------------------------------------------
266 * Return the name of an indexed section in a kernel IO structure.
267 *
268 * parameters:
269 * inp <-- input kernel IO structure
270 * id <-- id of section in index (0 to n-1 numbering)
271 *
272 * returns:
273 * pointer to section name if id in index range, null otherwise
274 *----------------------------------------------------------------------------*/
275
276const char *
278 size_t id);
279
280/*----------------------------------------------------------------------------
281 * Return header data for an indexed section in a kernel IO structure.
282 *
283 * parameters:
284 * inp <-- input kernel IO structure
285 * id <-- id of section in index (0 to n-1 numbering)
286 *
287 * returns:
288 * section header data (if id not in index range, fields set to zero)
289 *----------------------------------------------------------------------------*/
290
293 size_t id);
294
295/*----------------------------------------------------------------------------
296 * Return a kernel IO structure's echo (verbosity) level.
297 *
298 * parameters:
299 * pp_io <-- kernel IO structure
300 *----------------------------------------------------------------------------*/
301
302size_t
303cs_io_get_echo(const cs_io_t *pp_io);
304
305/*----------------------------------------------------------------------------*/
306/*
307 * \brief Access raw restart data serialized in memory.
308 *
309 * \param[in] pp_io kernel IO structure
310 * \param[out] nb size of data
311 * \param[out] data pointer to data
312 */
313/*----------------------------------------------------------------------------*/
314
315void
316cs_io_get_data_in_mem(const cs_io_t *pp_io,
317 size_t *nb,
318 void **data);
319
320/*----------------------------------------------------------------------------
321 * Read a message header.
322 *
323 * parameters:
324 * pp_io <-- kernel IO structure
325 * header --> header structure
326 *
327 * returns:
328 * 0 if a header was read, 1 in case of error or end-of-file
329 *----------------------------------------------------------------------------*/
330
331int
333 cs_io_sec_header_t *header);
334
335/*----------------------------------------------------------------------------
336 * Set a kernel IO's state so as to be ready to read an indexed section.
337 *
338 * The header values and position in the file are set so as to be equivalent
339 * to those they would have if the corresponding header had just been read.
340 *
341 * parameters:
342 * inp <-> input kernel IO structure
343 * header --> associated header
344 * id <-- id of section in index (0 to n-1 numbering)
345 *
346 * returns:
347 * 0 in case of success, 1 in case of error
348 *----------------------------------------------------------------------------*/
349
350int
352 cs_io_sec_header_t *header,
353 size_t id);
354
355/*----------------------------------------------------------------------------
356 * Set a section's final data type to int.
357 *
358 * It the datatype is not compatible, throw an error.
359 *
360 * parameters:
361 * header <-- header structure
362 * cs_io --> kernel IO structure
363 *----------------------------------------------------------------------------*/
364
365void
367 const cs_io_t *cs_io);
368
369/*----------------------------------------------------------------------------
370 * Set a message's final data type to cs_lnum_t.
371 *
372 * It the datatype is not compatible, throw an error.
373 *
374 * parameters:
375 * header <-- header structure
376 * pp_io --> kernel IO structure
377 *----------------------------------------------------------------------------*/
378
379void
381 const cs_io_t *pp_io);
382
383/*----------------------------------------------------------------------------
384 * Set a message's final data type to cs_gnum_t.
385 *
386 * It the datatype is not compatible, throw an error.
387 *
388 * parameters:
389 * header <-> header structure
390 * pp_io <-- kernel IO structure
391 *----------------------------------------------------------------------------*/
392
393void
395 const cs_io_t *pp_io);
396
397/*----------------------------------------------------------------------------
398 * Check that a message's final data type corresponds to cs_real_t.
399 *
400 * parameters:
401 * header <-- header structure
402 * pp_io <-- kernel IO structure
403 *----------------------------------------------------------------------------*/
404
405void
407 const cs_io_t *pp_io);
408
409/*----------------------------------------------------------------------------
410 * Read a message body and replicate it to all processors.
411 *
412 * If the array intended to receive the data already exists, we pass an
413 * "elt" pointer to this array; this same pointer is then returned.
414 * Otherwise, if this pointer is passed as null, memory is allocated
415 * by this function, and the corresponding pointer is returned. It is
416 * the caller's responsibility to free this array.
417 *
418 * parameters:
419 * header <-- header structure
420 * elts <-> pointer to data array, or null
421 * pp_io --> kernel IO structure
422 *
423 * returns:
424 * elts if non-null, or pointer to allocated array otherwise
425 *----------------------------------------------------------------------------*/
426
427void *
429 void *elts,
430 cs_io_t *pp_io);
431
432/*----------------------------------------------------------------------------
433 * Read a message body, assigning a different block to each processor.
434 *
435 * If location_id > 0 and header->n_location_vals > 1, then
436 * global_num_start and global_num_end will be based on location element
437 * numbers, so the total number of values read equals
438 * (global_num_end - global_num_start) * header->n_location_vals.
439 *
440 * If the array intended to receive the data already exists, we pass an
441 * "elt" pointer to this array; this same pointer is then returned.
442 * Otherwise, if this pointer is passed as null, memory is allocated
443 * by this function, and the corresponding pointer is returned. It is
444 * the caller's responsibility to free this array.
445 *
446 * parameters:
447 * header <-- header structure
448 * global_num_start <-- global number of first block item (1 to n numbering)
449 * global_num_end <-- global number of past-the end block item
450 * (1 to n numbering)
451 * elts <-> pointer to data array, or null
452 * pp_io --> kernel IO structure
453 *
454 * returns:
455 * elts if non-null, or pointer to allocated array otherwise
456 *----------------------------------------------------------------------------*/
457
458void *
460 cs_gnum_t global_num_start,
461 cs_gnum_t global_num_end,
462 void *elts,
463 cs_io_t *pp_io);
464
465/*----------------------------------------------------------------------------
466 * Read a message body, assigning a different block to each processor,
467 * when the body corresponds to an index.
468 *
469 * In serial mode, this function behaves just like cs_io_read_block(),
470 * except that it allows only unsigned integer values (cs_gnum_t).
471 *
472 * In parallel mode, global_num_end should be set to the past-the-end value
473 * of the base data block, the same as for regular data (and not increased
474 * by 1 for the last rank, as this will be handled internally).
475 * On each rank, the buffer size should be:
476 * global_num_end - global_num_start + 1, as the past-the end index
477 * for the local block is added automatically.
478 *
479 * If the array intended to receive the data already exists, we pass an
480 * "elt" pointer to this array; this same pointer is then returned.
481 * Otherwise, if this pointer is passed as null, memory is allocated
482 * by this function, and the corresponding pointer is returned. It is
483 * the caller's responsibility to free this array.
484 *
485 * parameters:
486 * header <-- header structure
487 * global_num_start <-- global number of first block item (1 to n numbering)
488 * global_num_end <-- global number of past-the end block item
489 * (1 to n numbering)
490 * elts <-> pointer to data array, or null
491 * pp_io --> kernel IO structure
492 *
493 * returns:
494 * elts if non-null, or pointer to allocated array otherwise
495 *----------------------------------------------------------------------------*/
496
497void *
499 cs_gnum_t global_num_start,
500 cs_gnum_t global_num_end,
501 cs_gnum_t *elts,
502 cs_io_t *pp_io);
503
504/*----------------------------------------------------------------------------
505 * Write a global section.
506 *
507 * Under MPI, data is only written by the associated communicator's root
508 * rank. The section data on other ranks is ignored, though the file offset
509 * is updated (i.e. the call to this function is collective).
510 *
511 * parameters:
512 * section_name <-- section name
513 * n_vals <-- total number of values
514 * location_id <-- id of associated location, or 0
515 * index_id <-- id of associated index, or 0
516 * n_location_vals <-- number of values per location
517 * elt_type <-- element type
518 * elts <-- pointer to element data
519 * outp <-> output kernel IO structure
520 *----------------------------------------------------------------------------*/
521
522void
523cs_io_write_global(const char *sec_name,
524 cs_gnum_t n_vals,
525 size_t location_id,
526 size_t index_id,
527 size_t n_location_vals,
528 cs_datatype_t elt_type,
529 const void *elts,
530 cs_io_t *outp);
531
532/*----------------------------------------------------------------------------
533 * Write a section to file, each associated process providing a contiguous
534 * of the section's body.
535 *
536 * Each process should provide a (possibly empty) block of the body,
537 * and we should have:
538 * global_num_start at rank 0 = 1
539 * global_num_start at rank i+1 = global_num_end at rank i.
540 * Otherwise, behavior (especially positioning for future reads) is undefined.
541 *
542 * If location_id > 0 and n_location_vals > 1, then global_num_start
543 * and global_num_end will be based on location element numbers, so the
544 * total number of values read equals
545 * (global_num_end - global_num_start) * header->n_location_vals.
546 *
547 * This function does not modify the values in its input buffer (notably,
548 * a copy is used to convert from little-endian to big-endian or vice-versa
549 * if necessary).
550 *
551 * parameters:
552 * section_name <-- section name
553 * n_g_elts <-- number of global elements (locations)
554 * global_num_start <-- global number of first block item (1 to n numbering)
555 * global_num_end <-- global number of past-the end block item
556 * location_id <-- id of associated location, or 0
557 * index_id <-- id of associated index, or 0
558 * n_location_vals <-- number of values per location
559 * elt_type <-- element type
560 * (1 to n numbering)
561 * elts <-- pointer to element data
562 * outp <-> output kernel IO structure
563 *----------------------------------------------------------------------------*/
564
565void
566cs_io_write_block(const char *sec_name,
567 cs_gnum_t n_g_elts,
568 cs_gnum_t global_num_start,
569 cs_gnum_t global_num_end,
570 size_t location_id,
571 size_t index_id,
572 size_t n_location_vals,
573 cs_datatype_t elt_type,
574 const void *elts,
575 cs_io_t *outp);
576
577/*----------------------------------------------------------------------------
578 * Write a section to file, each associated process providing a contiguous
579 * of the section's body.
580 *
581 * Each process should provide a (possibly empty) block of the body,
582 * and we should have:
583 * global_num_start at rank 0 = 1
584 * global_num_start at rank i+1 = global_num_end at rank i.
585 * Otherwise, behavior (especially positioning for future reads) is undefined.
586 *
587 * If location_id > 0 and n_location_vals > 1, then global_num_start
588 * and global_num_end will be based on location element numbers, so the
589 * total number of values read equals
590 * (global_num_end - global_num_start) * header->n_location_vals.
591 *
592 * This function is intended to be used mainly on data that is already of
593 * copy of original data (such as data that has been redistributed across
594 * processors just for the sake of output), or that is to be deleted after
595 * writing, so it may modify the values in its input buffer (notably to
596 * convert from little-endian to big-endian or vice-versa if necessary).
597 *
598 * parameters:
599 * section_name <-- section name
600 * n_g_elts <-- number of global elements (locations)
601 * global_num_start <-- global number of first block item (1 to n numbering)
602 * global_num_end <-- global number of past-the end block item
603 * location_id <-- id of associated location, or 0
604 * index_id <-- id of associated index, or 0
605 * n_location_vals <-- number of values per location
606 * elt_type <-- element type
607 * (1 to n numbering)
608 * elts <-- pointer to element data
609 * outp <-> output kernel IO structure
610 *----------------------------------------------------------------------------*/
611
612void
613cs_io_write_block_buffer(const char *sec_name,
614 cs_gnum_t n_g_elts,
615 cs_gnum_t global_num_start,
616 cs_gnum_t global_num_end,
617 size_t location_id,
618 size_t index_id,
619 size_t n_location_vals,
620 cs_datatype_t elt_type,
621 void *elts,
622 cs_io_t *outp);
623
624/*----------------------------------------------------------------------------
625 * Skip a message.
626 *
627 * parameters:
628 * header <-- header structure
629 * pp_io --> kernel IO structure
630 *----------------------------------------------------------------------------*/
631
632void
633cs_io_skip(const cs_io_sec_header_t *header,
634 cs_io_t *pp_io);
635
636/*----------------------------------------------------------------------------
637 * Return the position of the file pointer for an open kernel IO file.
638 *
639 * parameters:
640 * inp <-- input kernel IO structure
641 *
642 * returns:
643 * offset in file
644 *----------------------------------------------------------------------------*/
645
648
649/*----------------------------------------------------------------------------
650 * Set the position of the file pointer for an open kernel IO file.
651 *
652 * parameters:
653 * inp <-- input kernel IO structure
654 * offset <-- offset in file
655 *----------------------------------------------------------------------------*/
656
657void
659 cs_file_off_t offset);
660
661/*----------------------------------------------------------------------------
662 * Initialize performance logging for cs_io_t structures.
663 *----------------------------------------------------------------------------*/
664
665void
667
668/*----------------------------------------------------------------------------
669 * Finalize performance logging for cs_io_t structures.
670 *----------------------------------------------------------------------------*/
671
672void
674
675/*----------------------------------------------------------------------------
676 * Dump a kernel IO file handle's metadata.
677 *
678 * parameters:
679 * cs_io <-- kernel IO structure
680 *----------------------------------------------------------------------------*/
681
682void
683cs_io_dump(const cs_io_t *cs_io);
684
685/*----------------------------------------------------------------------------*/
686
688
689#endif /* __CS_IO_H__ */
cs_datatype_t
Definition: cs_defs.h:300
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
uint64_t cs_gnum_t
global mesh entity number
Definition: cs_defs.h:325
#define MPI_Info
Definition: cs_defs.h:94
#define END_C_DECLS
Definition: cs_defs.h:543
long long cs_file_off_t
Definition: cs_file.h:108
cs_file_access_t
Definition: cs_file.h:84
cs_io_t * cs_io_initialize_with_index(const char *file_name, const char *magic_string, cs_file_access_t method, long echo, MPI_Info hints, MPI_Comm block_comm, MPI_Comm comm)
Definition: cs_io.cpp:2026
void cs_io_log_finalize(void)
Definition: cs_io.cpp:3398
const char * cs_io_get_name(const cs_io_t *pp_io)
Definition: cs_io.cpp:2211
cs_io_mode_t
Definition: cs_io.h:59
@ CS_IO_MODE_READ
Definition: cs_io.h:61
@ CS_IO_MODE_WRITE
Definition: cs_io.h:62
int cs_glob_io_hints
size_t cs_io_get_echo(const cs_io_t *pp_io)
Definition: cs_io.cpp:2321
void cs_io_set_int(cs_io_sec_header_t *header, const cs_io_t *cs_io)
Definition: cs_io.cpp:2642
const char * cs_io_get_indexed_sec_name(const cs_io_t *inp, size_t id)
Definition: cs_io.cpp:2251
size_t cs_io_get_index_size(const cs_io_t *inp)
Definition: cs_io.cpp:2229
void cs_io_write_global(const char *sec_name, cs_gnum_t n_vals, size_t location_id, size_t index_id, size_t n_location_vals, cs_datatype_t elt_type, const void *elts, cs_io_t *outp)
Definition: cs_io.cpp:3028
void cs_io_log_initialize(void)
Definition: cs_io.cpp:3381
void cs_io_get_data_in_mem(const cs_io_t *pp_io, size_t *nb, void **data)
Definition: cs_io.cpp:2339
void cs_io_finalize(cs_io_t **pp_io)
Definition: cs_io.cpp:2173
int cs_io_read_header(cs_io_t *inp, cs_io_sec_header_t *header)
Definition: cs_io.cpp:2367
void cs_io_write_block(const char *sec_name, cs_gnum_t n_g_elts, cs_gnum_t global_num_start, cs_gnum_t global_num_end, size_t location_id, size_t index_id, size_t n_location_vals, cs_datatype_t elt_type, const void *elts, cs_io_t *outp)
Definition: cs_io.cpp:3119
void cs_io_assert_cs_real(const cs_io_sec_header_t *header, const cs_io_t *pp_io)
Definition: cs_io.cpp:2750
void * cs_io_read_block(const cs_io_sec_header_t *header, cs_gnum_t global_num_start, cs_gnum_t global_num_end, void *elts, cs_io_t *pp_io)
Definition: cs_io.cpp:2819
void cs_io_set_cs_lnum(cs_io_sec_header_t *header, const cs_io_t *pp_io)
Definition: cs_io.cpp:2679
cs_io_sec_header_t cs_io_get_indexed_sec_header(const cs_io_t *inp, size_t id)
Definition: cs_io.cpp:2278
void cs_io_write_block_buffer(const char *sec_name, cs_gnum_t n_g_elts, cs_gnum_t global_num_start, cs_gnum_t global_num_end, size_t location_id, size_t index_id, size_t n_location_vals, cs_datatype_t elt_type, void *elts, cs_io_t *outp)
Definition: cs_io.cpp:3220
void cs_io_set_cs_gnum(cs_io_sec_header_t *header, const cs_io_t *pp_io)
Definition: cs_io.cpp:2716
cs_io_t * cs_io_initialize(const char *file_name, const char *magic_string, cs_io_mode_t mode, cs_file_access_t method, long echo, MPI_Info hints, MPI_Comm block_comm, MPI_Comm comm)
Definition: cs_io.cpp:1963
int cs_io_set_indexed_position(cs_io_t *inp, cs_io_sec_header_t *header, size_t id)
Definition: cs_io.cpp:2578
cs_file_off_t cs_io_get_offset(cs_io_t *inp)
Definition: cs_io.cpp:3348
void cs_io_set_offset(cs_io_t *inp, cs_file_off_t offset)
Definition: cs_io.cpp:3365
void * cs_io_read_index_block(cs_io_sec_header_t *header, cs_gnum_t global_num_start, cs_gnum_t global_num_end, cs_gnum_t *elts, cs_io_t *pp_io)
Definition: cs_io.cpp:2868
void * cs_io_read_global(const cs_io_sec_header_t *header, void *elts, cs_io_t *pp_io)
Definition: cs_io.cpp:2785
void cs_io_dump(const cs_io_t *cs_io)
Definition: cs_io.cpp:3504
struct _cs_io_t cs_io_t
Definition: cs_io.h:68
void cs_io_skip(const cs_io_sec_header_t *header, cs_io_t *pp_io)
Definition: cs_io.cpp:3294
cs_io_t * cs_io_initialize_with_index_from_mem(const char *file_name, const char *magic_string, cs_file_access_t method, long echo, size_t nb, void *data, MPI_Comm block_comm, MPI_Comm comm)
Definition: cs_io.cpp:2114
integer(c_int), dimension(:), pointer, save inp
Definition: cpincl.f90:130
Definition: cs_io.h:73
const char * sec_name
Definition: cs_io.h:75
size_t location_id
Definition: cs_io.h:77
size_t n_location_vals
Definition: cs_io.h:79
cs_datatype_t elt_type
Definition: cs_io.h:80
size_t index_id
Definition: cs_io.h:78
cs_file_off_t n_vals
Definition: cs_io.h:76
cs_datatype_t type_read
Definition: cs_io.h:81