summaryrefslogtreecommitdiff
path: root/src/include/CommOverloadables.h
blob: 361d166f21ea92ec1c518001a5529f4134281cb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
 /*@@
   @header    CommOverloadables.h
   @date      Thu Feb  4 08:11:41 1999
   @author    Tom Goodale
   @desc
              The overloadable functions for the comm layer.
              See OverloadMacros.h to see how to use these.
   @enddesc
   @version   $Header$
 @@*/

#include "cctk_Flesh.h"
#include "cctk_GroupsOnGH.h"

#ifdef OVERLOADABLE_CALL
#undef OVERLOADABLE_CALL
#endif

#ifdef OVERLOABLE_PREFIX
#undef OVERLOADABLE_PREFIX
#endif

#ifdef OVERLOABLE_DUMMY_PREFIX
#undef OVERLOADABLE_DUMMY_PREFIX
#endif

#define OVERLOADABLE_CALL CCTK_
#define OVERLOADABLE_PREFIX CCTK_
#define OVERLOADABLE_DUMMY_PREFIX CCTKi_Dummy

#ifdef ARGUMENTS
#undef ARGUMENTS
#endif

#ifdef USE_ARGUMENTS
#undef USE_ARGUMENTS
#endif

#ifdef RETURN_TYPE
#undef RETURN_TYPE
#endif

#define RETURN_TYPE int
#define ARGUMENTS const cGH *GH, const char *group
#define USE_ARGUMENTS GH = GH; group = group;
OVERLOADABLE(SyncGroup)

OVERLOADABLE(EnableGroupStorage)
OVERLOADABLE(DisableGroupStorage)

OVERLOADABLE(EnableGroupComm)
OVERLOADABLE(DisableGroupComm)

#undef ARGUMENTS
#define ARGUMENTS const cGH *GH, int num_groups, const int *groups, const int *directions
#undef USE_ARGUMENTS
#define USE_ARGUMENTS GH = GH; num_groups = num_groups; groups = groups; directions = directions;
OVERLOADABLE(SyncGroupsByDirI)

#undef ARGUMENTS
#define ARGUMENTS const cGH *GH
#undef USE_ARGUMENTS
#define USE_ARGUMENTS GH = GH;
OVERLOADABLE(Barrier)
OVERLOADABLE(MyProc)
OVERLOADABLE(nProcs)

#undef ARGUMENTS
#define ARGUMENTS cGH *GH
#undef USE_ARGUMENTS
#define USE_ARGUMENTS GH = GH;
OVERLOADABLE(ParallelInit)

#undef ARGUMENTS
#define ARGUMENTS cGH *GH, int retval
#undef USE_ARGUMENTS
#define USE_ARGUMENTS GH = GH; retval = retval;
#undef RETURN_TYPE
#define RETURN_TYPE int
OVERLOADABLE(Exit)
OVERLOADABLE(Abort)

#undef ARGUMENTS
#define ARGUMENTS tFleshConfig *config, int convergence_level
#undef USE_ARGUMENTS
#define USE_ARGUMENTS config = config; convergence_level = convergence_level;
#undef RETURN_TYPE
#define RETURN_TYPE cGH *
OVERLOADABLE(SetupGH)

#undef ARGUMENTS
#define ARGUMENTS const cGH *GH, int dir, int group, const char *groupname
#undef USE_ARGUMENTS
#define USE_ARGUMENTS GH = GH; dir = dir; group = group; groupname = groupname;
#undef RETURN_TYPE
#define RETURN_TYPE const int *
OVERLOADABLE(ArrayGroupSizeB)

#undef ARGUMENTS
#define ARGUMENTS const cGH *GH, int group, const char *groupname
#undef USE_ARGUMENTS
#define USE_ARGUMENTS GH = GH; group = group; groupname = groupname;
#undef RETURN_TYPE
#define RETURN_TYPE int
OVERLOADABLE(QueryGroupStorageB)

#undef ARGUMENTS
#define ARGUMENTS const cGH *GH, int group, cGroupDynamicData *data
#undef USE_ARGUMENTS
#define USE_ARGUMENTS GH = GH; group = group; data = data;
#undef RETURN_TYPE
#define RETURN_TYPE int
OVERLOADABLE(GroupDynamicData)

#undef ARGUMENTS
#undef USE_ARGUMENTS
#undef RETURN_TYPE

#define RETURN_TYPE int
#define ARGUMENTS const cGH *GH, int n_groups,const int *groups,const int *timelevels, int *status
#define USE_ARGUMENTS GH = GH; n_groups=n_groups; groups = groups; timelevels = timelevels; status = status;
OVERLOADABLE(GroupStorageIncrease)
OVERLOADABLE(GroupStorageDecrease)

#undef ARGUMENTS
#undef USE_ARGUMENTS
#undef RETURN_TYPE

/* overloadable routine CCTK_InterpGridArrays() */
#define RETURN_TYPE int
#define ARGUMENTS const cGH *GH,                                              \
                  int N_dims,                                                 \
                  int local_interp_handle,                                    \
                  int param_table_handle,                                     \
                  int coord_system_handle,                                    \
                  int N_interp_points,                                        \
                    int interp_coords_type,                                   \
                    const void *const interp_coords[],                        \
                  int N_input_arrays,                                         \
                    const CCTK_INT input_array_indices[],                     \
                  int N_output_arrays,                                        \
                    const CCTK_INT output_array_types[],                      \
                    void *const output_arrays[]
#define USE_ARGUMENTS (void) (GH + 0);                                        \
                      (void) (N_dims + 0);                                    \
                      (void) (local_interp_handle + 0);                       \
                      (void) (param_table_handle + 0);                        \
                      (void) (coord_system_handle + 0);                       \
                      (void) (N_interp_points + 0);                           \
                      (void) (interp_coords_type + 0);                        \
                      (void) (interp_coords + 0);                             \
                      (void) (N_input_arrays + 0);                            \
                      (void) (input_array_indices + 0);                       \
                      (void) (N_output_arrays + 0);                           \
                      (void) (output_array_types + 0);                        \
                      (void) (output_arrays + 0);
OVERLOADABLE(InterpGridArrays)

#undef ARGUMENTS
#undef USE_ARGUMENTS
#undef RETURN_TYPE

#undef OVERLOADABLE_CALL
#undef OVERLOADABLE_PREFIX
#undef OVERLOADABLE_DUMMY_PREFIX