SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
Macros | Functions | Variables
sion_mpi_gen.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include "mpi.h"
#include "sion.h"
#include "sion_debug.h"
#include "sion_error_handler.h"
#include "sion_internal.h"
#include "sion_fd.h"
#include "sion_filedesc.h"
#include "sion_printts.h"
#include "sion_flags.h"
#include "sion_generic.h"
#include "sion_mpi.h"
#include "sion_mpi_internal_gen.h"
#include "sion_mpi_cb_gen.h"
Include dependency graph for sion_mpi_gen.c:

Go to the source code of this file.

Macros

#define _XOPEN_SOURCE   700
 

Functions

int sion_paropen_mpi (const char *fname, const char *file_mode, int *numFiles, MPI_Comm gComm, const MPI_Comm *lComm, sion_int64 *chunksize, sion_int32 *fsblksize, int *globalrank, FILE **fileptr, char **newfname)
 Open a sion file using MPI. More...
 
int sion_parclose_mpi (int sid)
 Close a sion file using MPI. More...
 
int sion_parreinit_mpi (int sid, sion_int64 chunksize)
 
int sion_paropen_mapped_mpi (char *fname, const char *file_mode, int *numFiles, MPI_Comm gComm, int *nlocaltasks, int **globalranks, sion_int64 **chunksizes, int **mapping_filenrs, int **mapping_lranks, sion_int32 *fsblksize, FILE **fileptr)
 
int sion_parclose_mapped_mpi (int sid)
 

Variables

int _sion_mpi_api_aid = -1
 

Detailed Description

MPI Implementation

Definition in file sion_mpi_gen.c.

Function Documentation

◆ sion_parclose_mpi()

int sion_parclose_mpi ( int  sid)

Close a sion file using MPI.

For more description please see the description of sion_parclose_mpi.

Parameters
[in]sidsion file handle
Return values
successvalue (SION_SUCCESS or SION_NOT_SUCCESS)

Definition at line 230 of file sion_mpi_gen.c.

Referenced by fsion_parclose_mpi_c().

◆ sion_paropen_mpi()

int sion_paropen_mpi ( const char *  fname,
const char *  file_mode,
int *  numFiles,
MPI_Comm  gComm,
const MPI_Comm *  lComm,
sion_int64 *  chunksize,
sion_int32 *  fsblksize,
int *  globalrank,
FILE **  fileptr,
char **  newfname 
)

Open a sion file using MPI.

This function opens a sion file using MPI. It processes the MPI specific parts and then passes its arguments on to sion_generic_paropen().

For more description please see the description of sion_paropen_mpi.

Parameters
[in]fnamename of file, should be equal on all tasks
[in]file_modelike the type parameter of fopen. See file mode description for details
[in,out]numFilesnumber of multi files to use (-1 for automatic choosing from local communicator)
[in]gCommglobal MPI communicator (typically MPI_COMM_WORLD)
[in]lCommlocal MPI communicator (= gComm if no adaption to I/O nodes is needed) lComm should be a partition of gComm, i.e. a disjoint cover
[in,out]chunksizemaximum size to be written with single write call
[in,out]fsblksizefile system block size. Must be equal on all processes (-1 for automatic)
[in,out]globalrankglobal rank of process any globally unique id for current task. It will be stored in sion file. Useful if comm is not MPI_COMM_WORLD (typically: globalrank = rank in MPI_COMM_WORLD)
[out]fileptrfile pointer (NULL for not using an external which allows for more optimisation)
[out]newfnamereturn value for actual file name if using multi files. NULL does not return the name. If passed non NULL pointer the memory needs to be freed by the user.
Return values
sidsion file handle or -1 if error occurred

Definition at line 85 of file sion_mpi_gen.c.

Referenced by fsion_paropen_mpi_c().