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