SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
sion_omp_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_OMP_CB_GEN_H
15 #define SION_SION_OMP_CB_GEN_H
16 
17 #ifdef SION_OMP
18 
19 #include "sion_datatypes.h"
20 #include "sion_filedesc.h"
21 
22 typedef struct _omp_api_commdata_struct _omp_api_commdata;
23 struct _omp_api_commdata_struct {
24  int commset;
25  int thread_num;
26  int num_threads;
27 };
28 
29 int _sion_register_callbacks_omp(void);
30 
31 int _sion_omp_create_lcg_cb(void **local_commgroup, void *global_commgroup,
32  int grank, int gsize,
33  int lrank, int lsize,
34  int filenumber, int numfiles
35  );
36 int _sion_omp_free_lcg_cb(void *local_commgroup);
37 
38 
39 int _sion_omp_barrier_cb(void *commdata);
40 int _sion_omp_bcastr_cb(void *data, void *commdata, int dtype, int nelem, int root);
41 int _sion_omp_gatherr_cb(void *indata, void *outdata, void *commdata, int dtype, int nelem, int root);
42 int _sion_omp_scatterr_cb(void *indata, void *outdata, void *commdata, int dtype, int nelem, int root);
43 int _sion_omp_gathervr_cb(void *indata, void *outdata, void *commdata, int dtype, int *counts, int nelem, int root);
44 int _sion_omp_scattervr_cb(void *indata, void *outdata, void *commdata, int dtype, int *counts, int nelem, int root);
45 
46 /* collective gather/scatter & process operation: */
47 /* this function collects on tasks <collector> data from a number of
48  tasks (<range_start> to <range_end>) and calls for each tasks the process function.
49  Additionally to the binary data a spec vector has also to be collected.
50  the process function has two parameters: indata and spec (from each task)
51  spec[0] -> offset, spec[1] -> len
52  Constraints:
53  - process must be called in the order of the ranks from data is collected
54  - process can be called multiple times if data is split in multiple parts (because of buffer size)
55  spec[0] and spec[1] have to be adjusted in that case
56 */
57 
58 int _sion_omp_gather_process_cb(const void *indata, sion_int64 *spec, int spec_len, sion_int64 fsblksize,
59  void *commdata, int collector, int range_start, int range_end, int sid,
60  int process_cb(const void *,sion_int64 *, int ) );
61 
62 int _sion_omp_process_scatter_cb(void *outdata, sion_int64 *spec, int spec_len, sion_int64 fsblksize,
63  void *commdata, int collector, int range_start, int range_end, int sid,
64  int process_cb(void *,sion_int64 *, int ) );
65 
66 int _sion_omp_get_capability_cb(void *commdata );
67 
68 #endif
69 
70 #endif