SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
sion_mpi.h
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 #ifndef SION_SION_MPI_H
17 #define SION_SION_MPI_H
18 
19 #if defined(MPI_VERSION) || defined(SION_MPI)
20 
21 #include <stdio.h>
22 
23 #include "mpi.h"
24 
25 #include "sion_const.h"
26 #include "sion_datatypes.h"
27 #include "sion_datatypes_mpi.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33  int sion_paropen_mpi( const char *fname,
34  const char *file_mode,
35  int *numFiles,
36  MPI_Comm gComm,
37  const MPI_Comm *lComm,
38  sion_int64 *chunksize,
39  sion_int32 *fsblksize,
40  int *globalrank,
41  FILE **fileptr,
42  char **newfname);
43 
44  int sion_parclose_mpi( int sid );
45  int sion_parreinit_mpi( int sid,
46  sion_int64 chunksize );
47 
48 /* new mapped functions */
49 
50 /* open function:
51  write-mode:
52  if numFiles > 1 --> mapping_filenrs, mapping_lranks contains local mappping
53  */
54 
55  int sion_paropen_mapped_mpi( char *fname,
56  const char *file_mode,
57  int *numFiles,
58  MPI_Comm gComm,
59  int *nlocaltasks,
60  int **globalranks,
61  sion_int64 **chunksizes,
62  int **mapping_filenrs,
63  int **mapping_lranks,
64  sion_int32 *fsblksize,
65  FILE **fileptr);
66 
67  int sion_parclose_mapped_mpi( int sid );
68 
69  /* Serialization */
70  int sion_startof_transaction_mpi( int sid );
71  int sion_endof_transaction_mpi ( int sid );
72  size_t sion_coll_fwrite_mpi(const void *data, size_t size, size_t nitems, int sid);
73  size_t sion_coll_fread_mpi( void *data, size_t size, size_t nitems, int sid);
74 
75  /* for backward compatibility */
76  int sion_paropen_comms_mpi(char *fname,
77  const char *file_mode,
78  int *numFiles,
79  MPI_Comm gComm,
80  MPI_Comm lComm, sion_int64 *chunksize, sion_int32 *fsblksize, int *globalrank, FILE **fileptr, char *newfname);
81  int sion_paropen_multi_mpi(char *fname,
82  const char *file_mode,
83  int *numFiles,
84  MPI_Comm gComm,
85  MPI_Comm *lComm, sion_int64 *chunksize, sion_int32 *fsblksize, int *globalrank, FILE **fileptr, char *newfname);
86 
87  /* for file check */
89  sion_file_check_par_args_mpi *sion_file_check_par_args_init_mpi( const char *file_mode,
90  MPI_Comm gComm,
91  int numfiles,
92  MPI_Comm lComm
93  );
94  int sion_file_check_par_args_free_mpi( sion_file_check_par_args_mpi *args );
95  int sion_file_check_par_cb_mpi( char *fname, void *args );
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif
102 
103 #endif
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.
Definition: sion_mpi_gen.c:85
int sion_parclose_mpi(int sid)
Close a sion file using MPI.
Definition: sion_mpi_gen.c:230