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