SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
sion_mpi_cb_gen.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 
14 #ifndef SION_SION_MPI_CB_GEN_H
15 #define SION_SION_MPI_CB_GEN_H
16 
17 #ifdef SION_MPI
18 
19 #include "mpi.h"
20 
21 #include "sion_datatypes.h"
22 #include "sion_filedesc.h"
23 
26  MPI_Comm comm;
27  int commset;
28  int commcreated;
29  int rank;
30  int size;
31  int local; /* is local communicator */
32 
33  _mpi_api_commdata *lcommgroup; /* contains pointer to local commgroup */
34 
35  /* needed for transaction */
36  double ts;
37  int blocksize;
38  int step;
39 
40 };
41 
42 int _sion_register_callbacks_mpi(void);
43 
44 int _sion_mpi_create_lcg_cb(void **local_commgroup, void *global_commgroup,
45  int grank, int gsize,
46  int lrank, int lsize,
47  int filenumber, int numfiles
48  );
49 int _sion_mpi_free_lcg_cb(void *local_commgroup);
50 
51 
52 int _sion_mpi_barrier_cb(void *commdata);
53 int _sion_mpi_bcastr_cb(void *data, void *commdata, int dtype, int nelem, int root);
54 int _sion_mpi_gatherr_cb(void *indata, void *outdata, void *commdata, int dtype, int nelem, int root);
55 int _sion_mpi_scatterr_cb(void *indata, void *outdata, void *commdata, int dtype, int nelem, int root);
56 int _sion_mpi_gathervr_cb(void *indata, void *outdata, void *commdata, int dtype, int *counts, int nelem, int root);
57 int _sion_mpi_scattervr_cb(void *indata, void *outdata, void *commdata, int dtype, int *counts, int nelem, int root);
58 
59 /* collective gather/scatter & process operation: */
60 /* this function collects on tasks <collector> data from a number of
61  tasks (<range_start> to <range_end>) and calls for each tasks the process function.
62  Additionally to the binary data a spec vector has also to be collected.
63  the process function has two parameters: indata and spec (from each task)
64  spec[0] -> offset, spec[1] -> len
65  Constraints:
66  - process must be called in the order of the ranks from data is collected
67  - process can be called multiple times if data is split in multiple parts (because of buffer size)
68  spec[0] and spec[1] have to be adjusted in that case
69 */
70 
71 int _sion_mpi_gather_process_cb(const void *indata, sion_int64 *spec, int spec_len, sion_int64 fsblksize,
72  void *commdata, int collector, int range_start, int range_end, int sid,
73  int process_cb(const void *,sion_int64 *, int ) );
74 
75 int _sion_mpi_process_scatter_cb(void *outdata, sion_int64 *spec, int spec_len, sion_int64 fsblksize,
76  void *commdata, int collector, int range_start, int range_end, int sid,
77  int process_cb(void *,sion_int64 *, int ) );
78 
79 int _sion_mpi_get_capability_cb(void *commdata );
80 
81 #endif
82 
83 #endif