SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
Macros | Functions
sion_serial.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <assert.h>
#include <sys/time.h>
#include "sion_debug.h"
#include "sion_filedesc.h"
#include "sion_internal.h"
#include "sion_printts.h"
#include "sion_const.h"
#include "sion_common.h"
#include "sion_serial.h"
Include dependency graph for sion_serial.c:

Go to the source code of this file.

Macros

#define _XOPEN_SOURCE   700
 

Functions

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. More...
 
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. More...
 
int sion_close (int sid)
 Close a sion file. More...
 

Detailed Description

API Overview

Definition in file sion_serial.c.

Function Documentation

◆ sion_close()

int sion_close ( int  sid)

Close a sion file.

See sion_close_description .

Parameters
[in]sidsion file handle
Returns
SION_SUCCESS if close is ok
Examples
simple/sionser.c.

Definition at line 106 of file sion_serial.c.

Referenced by fsion_close_c().

◆ sion_open()

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.

See sion_open_description.

Parameters
[in]fnamename of file, should be equal on all tasks
[in]file_modelike the type parameter of fopen. See file_mode_description .
[in,out]ntasksnumber of tasks used to write this file
[in,out]nfilesnumber of physical files
[in,out]chunksizeschunksize for each task
[in,out]fsblksizeblocksize of filesystem, must be equal on all processors
[in]globalranksrank numbers for which the file should be opened; will be stored in sion file, useful if comm is not MPI_COMM_WORLD typical: globalrank = rank in MPI_COMM_WORLD
[out]fileptrfile pointer for this task
Return values
sidsion file handle or -1 if error occured
Examples
simple/sionser.c.

Definition at line 54 of file sion_serial.c.

◆ sion_open_rank()

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.

See sion_open_rank_description

Parameters
[in]fnamename of file, should be equal on all tasks
[in,out]file_modelike the type parameter of fopen (currently recognized options: "rb", "wb")
[in,out]chunksizechunksize for this task
[in,out]fsblksizeblocksize of filesystem, must be equal on all processors
[in]rankrank number for which the file should be open; will be stored in sion file, usefull if comm is not MPI_COMM_WORLD typical: globalrank= rank in MPI_COMM_WORLD
[out]fileptrfile pointer for this task
Return values
sidsion file handle or -1 if error occured

Definition at line 83 of file sion_serial.c.

Referenced by fsion_open_rank_c().