SIONlib  2.0.0-rc.1
Scalable I/O library for parallel access to task-local files
sion_serial.h
1 /****************************************************************************
2 ** SIONLIB http://www.fz-juelich.de/jsc/sionlib **
3 *****************************************************************************
4 ** Copyright (c) 2008-2018 **
5 ** Forschungszentrum Juelich, Juelich Supercomputing Centre **
6 ** **
7 ** See the file COPYRIGHT in the package base directory for details **
8 ****************************************************************************/
9 
10 #ifndef SION_SION_SERIAL_H
11 #define SION_SION_SERIAL_H
12 
20 #include <stdint.h>
21 #include <stdio.h>
22 
23 #include "sion_enums.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /* open/close */
48 int sion_open(char *fname, const char *file_mode, int *ntasks, int *nfiles, int64_t **chunksizes, int32_t *fsblksize,
49  int **globalranks, FILE **fileptr);
50 
67 int sion_open_rank(char *fname, const char *file_mode, int64_t *chunksize, int32_t *fsblksize, int *rank, FILE **fileptr);
68 
78 int sion_close(int sid);
79 
80 typedef struct {
81  int n_chunksizes; // default: 0
82  int64_t *chunksizes; // default: fsblksize
83  int32_t fsblksize; // default: auto-detect
84 
85  int n_multifile; // default: 1
86 
87  sion_keyval_mode keyval_mode; // default: SION_KEYVAL_MODE_NONE
88 
89  sion_lowlevel_api lowlevel_api; // default: SION_LOWLEVEL_API_C
90 } sion_options;
91 
92 sion_options sion_options_new();
93 
94 void sion_options_set_chunksizes(sion_options *options, int n, int64_t chunksizes[]);
95 void sion_options_set_fsblksize(sion_options *options, int32_t fsblksize);
96 
97 void sion_options_set_multifile_number(sion_options *options, int multifile_number);
98 
99 void sion_options_set_keyval_mode(sion_options *options, sion_keyval_mode keyval_mode);
100 
101 void sion_options_set_lowlevel_api(sion_options *options, sion_lowlevel_api lowlevel_api);
102 
103 int sion_open_with_options(const char *fname, sion_open_mode mode, int n, const sion_options *options);
104 #ifdef __cplusplus
105 }
106 #endif
107 
109 
110 #endif
int sion_open_rank(char *fname, const char *file_mode, int64_t *chunksize, int32_t *fsblksize, int *rank, FILE **fileptr)
Open a sion file for a specific rank.
Definition: sion_serial.c:45
int sion_close(int sid)
Close a sion file.
Definition: sion_serial.c:58
int sion_open(char *fname, const char *file_mode, int *ntasks, int *nfiles, int64_t **chunksizes, int32_t *fsblksize, int **globalranks, FILE **fileptr)
Open a sion file in serial mode.
Definition: sion_serial.c:26