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