SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
sion_serial.c
Go to the documentation of this file.
1 /****************************************************************************
2 ** SIONLIB http://www.fz-juelich.de/jsc/sionlib **
3 *****************************************************************************
4 ** Copyright (c) 2008-2019 **
5 ** Forschungszentrum Juelich, Juelich Supercomputing Centre **
6 ** **
7 ** See the file COPYRIGHT in the package base directory for details **
8 ****************************************************************************/
9 
16 #define _XOPEN_SOURCE 700
17 
18 #include <stdlib.h>
19 #include <stdio.h>
20 #include <string.h>
21 #include <time.h>
22 #include <assert.h>
23 
24 #include <sys/time.h>
25 
26 #include "sion_debug.h"
27 #include "sion_filedesc.h"
28 #include "sion_internal.h"
29 #include "sion_printts.h"
30 
31 #include "sion_const.h"
32 #include "sion_common.h"
33 #include "sion_serial.h"
34 
35 
54 int sion_open(char *fname, const char *file_mode, int *ntasks, int *nfiles, sion_int64 **chunksizes, sion_int32 *fsblksize, int **globalranks, FILE **fileptr)
55 {
56 
57  int sid=0;
58 
59  DPRINTFP((1, "sion_open", 0, "enter open of file %s in %s mode\n", fname, file_mode));
60 
61  sid=_sion_open(fname,file_mode,ntasks,nfiles,chunksizes,fsblksize,globalranks,fileptr);
62 
63  return (sid);
64 
65 }
66 
83 int sion_open_rank(char *fname, const char *file_mode, sion_int64 *chunksize, sion_int32 *fsblksize, int *rank, FILE **fileptr)
84 {
85  int sid;
86 
87  /* */ DPRINTFTS(*rank, "before open rank");
88  DPRINTFP((1, "sion_open_rank", *rank, "enter open of file %s in %s mode\n", fname, file_mode));
89  sid=_sion_open_rank(fname, file_mode, chunksize, fsblksize, rank, fileptr);
90  DPRINTFP((1, "sion_open_rank", 0, "leave open of file %s in %s mode sid=%d\n", fname, file_mode,sid));
91  /* */ DPRINTFTS(*rank, "after open rank");
92 
93  return (sid);
94 
95 }
96 
106 int sion_close(int sid)
107 {
108 
109  int rc = 0;
110  DPRINTFP((1, "sion_close", -1, "enter close sid=%d\n", sid));
111  rc=_sion_close_sid(sid);
112  DPRINTFP((1, "sion_close", -1, "leave close sid=%d\n", sid));
113 
114  sion_dclose();
115 
116  return (rc);
117 }
void sion_dclose(void)
Definition: sion_debug.c:289
Sion Time Stamp Header.
int sion_open_rank(char *fname, const char *file_mode, sion_int64 *chunksize, sion_int32 *fsblksize, int *rank, FILE **fileptr)
Open a sion file for a specific rank.
Definition: sion_serial.c:83
int sion_open(char *fname, const char *file_mode, int *ntasks, int *nfiles, sion_int64 **chunksizes, sion_int32 *fsblksize, int **globalranks, FILE **fileptr)
Open a sion file in serial mode.
Definition: sion_serial.c:54
int sion_close(int sid)
Close a sion file.
Definition: sion_serial.c:106