SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
Macros | Functions
sion_fortran_mpi.c File Reference

Fortran API. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mpi.h"
#include "sion.h"
#include "sion_debug.h"
#include "sion_fd.h"
#include "sion_filedesc.h"
#include "sion_mpi.h"
#include "sion_fortran_mpi.h"
Include dependency graph for sion_fortran_mpi.c:

Go to the source code of this file.

Macros

#define _XOPEN_SOURCE   700
 

Functions

void fsion_paropen_mpi_c (char *fname, char *file_mode, int *numFiles, MPI_Fint *fgComm, MPI_Fint *flComm, sion_int64 *chunksize, sion_int32 *fsblksize, int *globalrank, char *newfname, int *sid, int fname_len, int file_mode_len, int newfname_len)
 Wrapper function that calls fsion_paropen_multi_mpi for 1 file. More...
 
void fsion_paropen_multi_mpi_c (char *fname, char *file_mode, int *numFiles, MPI_Fint *fgComm, MPI_Fint *flComm, sion_int64 *chunksize, sion_int32 *fsblksize, int *globalrank, int *sid, char *newfname, int fname_len, int file_mode_len, int newfname_len)
 Fortran procedure to open multiple sion files in parallel. More...
 
void fsion_parclose_mpi_c (int *sid, int *ierr)
 Fortran procedure to close a sion file in parallel. More...
 

Detailed Description

Fortran API.

Author
Ventsislav Petkov
Date
14.08.2008

Definition in file sion_fortran_mpi.c.

Function Documentation

◆ fsion_parclose_mpi_c()

void fsion_parclose_mpi_c ( int *  sid,
int *  ierr 
)

Fortran procedure to close a sion file in parallel.

This function closes the sion in parallel on all tasks included in comm. The communicator should be the same used in the parallel open statement.

Parameters
[in]sidsion file handle
Return values
ierr1 if close is ok

Definition at line 233 of file sion_fortran_mpi.c.

References sion_parclose_mpi().

◆ fsion_paropen_mpi_c()

void fsion_paropen_mpi_c ( char *  fname,
char *  file_mode,
int *  numFiles,
MPI_Fint *  fgComm,
MPI_Fint *  flComm,
sion_int64 *  chunksize,
sion_int32 *  fsblksize,
int *  globalrank,
char *  newfname,
int *  sid,
int  fname_len,
int  file_mode_len,
int  newfname_len 
)

Wrapper function that calls fsion_paropen_multi_mpi for 1 file.

This function opens the file in parallel. It has to be called from each processor at the same time (like a MPI collective operation).

Parameters
[in]fnamename of file, should equal on all tasks
[in]file_modelike the type parameter of fopen ("rb", "wb")
[in]numFilesnumber of physical files
[in]fgCommMPI communicator, which contains all tasks involved in this operation typical: MPI_COMM_WORLD
[in]flCommMPI communicator, which contains all tasks writing to the same file
[in,out]chunksizechunksize for this task
[in,out]fsblksizefilesystem blocksize, must be equal on all processors
[in,out]globalrankany global unique id for this task will be stored in sion file, usefull if comm is not MPI_COMM_WORLD typical: globalrank= rank in MPI_COMM_WORLD
[out]newfnameactual filename (differs from fname when using multiple physical files
[in]fname_len(internal) length of the fname string *
[in]file_mode_len(internal) length of the file_mode string
[out]newfname_lenlength of actual filename (see newfname)
Return values
sidsion file handle or -1 if error occured

Definition at line 62 of file sion_fortran_mpi.c.

References sion_paropen_mpi().

◆ fsion_paropen_multi_mpi_c()

void fsion_paropen_multi_mpi_c ( char *  fname,
char *  file_mode,
int *  numFiles,
MPI_Fint *  fgComm,
MPI_Fint *  flComm,
sion_int64 *  chunksize,
sion_int32 *  fsblksize,
int *  globalrank,
int *  sid,
char *  newfname,
int  fname_len,
int  file_mode_len,
int  newfname_len 
)

Fortran procedure to open multiple sion files in parallel.

This function opens numFiles files in parallel. It has to be called from each processor at the same time (like a MPI collective operation).

Parameters
[in]fnamename of file, should equal on all tasks
[in]file_modelike the type parameter of fopen ("rb", "wb")
[in]numFilesnumber of files to open
[in]fgCommglobal MPI communicator, which contains all tasks writing to the files typical: MPI_COMM_WORLD
[in,out]flCommnew local MPI communicator, which contains all tasks writing to the current file
[in,out]chunksizechunksize for this task
[in,out]fsblksizefilesystem blocksize, must be equal on all processors
[in,out]globalrankany global unique id for this task will be stored in sion file, usefull if comm is not MPI_COMM_WORLD typical: globalrank= rank in MPI_COMM_WORLD
[in]fname_len(internal) length of the fname string *
[in]file_mode_len(internal) length of the file_mode string
[in]newfname_len(internal) length of the newfname string
Return values
sidsion file handle or -1 if error occured
newfnamefilename of the new file

Definition at line 163 of file sion_fortran_mpi.c.