SIONlib  1.6.1
Scalable I/O library for parallel access to task-local files
sion_mpi_cb_gen.h
1 /****************************************************************************
2 ** SIONLIB http://www.fz-juelich.de/jsc/sionlib **
3 *****************************************************************************
4 ** Copyright (c) 2008-2014 **
5 ** Forschungszentrum Juelich, Juelich Supercomputing Centre **
6 ** **
7 ** See the file COPYRIGHT in the package base directory for details **
8 ****************************************************************************/
9 #ifndef SION_SION_MPI_CB_GEN
10 #define SION_SION_MPI_CB_GEN
11 
12 #ifdef SION_MPI
13 
16  MPI_Comm comm;
17  int commset;
18  int commcreated;
19  int rank;
20  int size;
21  int local; /* is local communicator */
22 
23  _mpi_api_commdata *lcommgroup; /* contains pointer to local commgroup */
24 
25  /* needed for transaction */
26  double ts;
27  int blocksize;
28  int step;
29 
30 };
31 
32 int _sion_register_callbacks_mpi();
33 
34 int _sion_mpi_create_lcg_cb(void **local_commgroup, void *global_commgroup,
35  int grank, int gsize,
36  int lrank, int lsize,
37  int filenumber, int numfiles
38  );
39 int _sion_mpi_free_lcg_cb(void *local_commgroup);
40 
41 
42 int _sion_mpi_barrier_cb(void *commdata);
43 int _sion_mpi_bcastr_cb(void *data, void *commdata, int dtype, int nelem, int root);
44 int _sion_mpi_gatherr_cb(void *indata, void *outdata, void *commdata, int dtype, int nelem, int root);
45 int _sion_mpi_scatterr_cb(void *indata, void *outdata, void *commdata, int dtype, int nelem, int root);
46 int _sion_mpi_gathervr_cb(void *indata, void *outdata, void *commdata, int dtype, int *counts, int nelem, int root);
47 int _sion_mpi_scattervr_cb(void *indata, void *outdata, void *commdata, int dtype, int *counts, int nelem, int root);
48 
49 /* collective gather/scatter & process operation: */
50 /* this function collects on tasks <collector> data from a number of
51  tasks (<range_start> to <range_end>) and calls for each tasks the process function.
52  Additionally to the binary data a spec vector has also to be collected.
53  the process function has two parameters: indata and spec (from each task)
54  spec[0] -> offset, spec[1] -> len
55  Constraints:
56  - process must be called in the order of the ranks from data is collected
57  - process can be called multiple times if data is split in multiple parts (because of buffer size)
58  spec[0] and spec[1] have to be adjusted in that case
59 */
60 
61 int _sion_mpi_gather_process_cb(const void *indata, sion_int64 *spec, int spec_len, sion_int64 fsblksize,
62  void *commdata, int collector, int range_start, int range_end, int sid,
63  int process_cb(const void *,sion_int64 *, int ) );
64 
65 int _sion_mpi_process_scatter_cb(void *outdata, sion_int64 *spec, int spec_len, sion_int64 fsblksize,
66  void *commdata, int collector, int range_start, int range_end, int sid,
67  int process_cb(void *,sion_int64 *, int ) );
68 
69 int _sion_mpi_get_capability_cb(void *commdata );
70 
71 #endif
72 
73 #endif