SIONlib  1.7.0
Scalable I/O library for parallel access to task-local files
sion_ompi_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_OMPI
18 
19 typedef struct _ompi_api_commdata_struct _ompi_api_commdata;
20 struct _ompi_api_commdata_struct {
21  MPI_Comm comm;
22  int commset;
23  int commcreated;
24  int rank;
25  int size;
26  int thread_num;
27  int num_threads;
28  int local; /* is local communicator */
29 
30  _ompi_api_commdata *lcommgroup; /* contains pointer to local commgroup */
31 
32  /* needed for transaction */
33  double ts;
34  int blocksize;
35  int step;
36 
37 };
38 
39 int _sion_register_callbacks_ompi();
40 
41 int _sion_ompi_create_lcg_cb(void **local_commgroup, void *global_commgroup,
42  int grank, int gsize,
43  int lrank, int lsize,
44  int filenumber, int numfiles
45  );
46 int _sion_ompi_free_lcg_cb(void *local_commgroup);
47 
48 
49 int _sion_ompi_barrier_cb(void *commdata);
50 int _sion_ompi_bcastr_cb(void *data, void *commdata, int dtype, int nelem, int root);
51 int _sion_ompi_gatherr_cb(void *indata, void *outdata, void *commdata, int dtype, int nelem, int root);
52 int _sion_ompi_scatterr_cb(void *indata, void *outdata, void *commdata, int dtype, int nelem, int root);
53 int _sion_ompi_gathervr_cb(void *indata, void *outdata, void *commdata, int dtype, int *counts, int nelem, int root);
54 int _sion_ompi_scattervr_cb(void *indata, void *outdata, void *commdata, int dtype, int *counts, int nelem, int root);
55 
56 /* collective gather/scatter & process operation: */
57 /* this function collects on tasks <collector> data from a number of
58  tasks (<range_start> to <range_end>) and calls for each tasks the process function.
59  Additionally to the binary data a spec vector has also to be collected.
60  the process function has two parameters: indata and spec (from each task)
61  spec[0] -> offset, spec[1] -> len
62  Constraints:
63  - process must be called in the order of the ranks from data is collected
64  - process can be called multiple times if data is split in multiple parts (because of buffer size)
65  spec[0] and spec[1] have to be adjusted in that case
66 */
67 
68 int _sion_ompi_gather_process_cb(const void *indata, sion_int64 *spec, int spec_len, sion_int64 fsblksize,
69  void *commdata, int collector, int range_start, int range_end, int sid,
70  int process_cb(const void *,sion_int64 *, int ) );
71 
72 int _sion_ompi_process_scatter_cb(void *outdata, sion_int64 *spec, int spec_len, sion_int64 fsblksize,
73  void *commdata, int collector, int range_start, int range_end, int sid,
74  int process_cb(void *,sion_int64 *, int ) );
75 
76 int _sion_ompi_get_capability_cb(void *commdata );
77 
78 #endif
79 
80 #endif