aboutsummaryrefslogtreecommitdiff
path: root/src/include/pughi.h
blob: abb33304a35760cd0b07e28eb241e1c3e6b74c9d (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
166
167
168
169
170
 /*@@
   @header    pughi.h
   @date      Tue Apr 18 21:22:42 2000
   @author    Tom Goodale
   @desc 
   Internal stuff for PUGH
   @enddesc 
   @version $Header$
 @@*/

#ifndef _PUGHI_H_
#define _PUGHI_H_ 1

#ifdef __cplusplus
extern "C" 
{
#endif

pConnectivity *PUGH_SetupConnectivity(int dim, 
                                      int total_procs, 
                                      int *nprocs,
                                      int *perme);

pGExtras *PUGH_SetupPGExtras(int dim, 
                             int *perme,
                             int stagger,
                             int *sh,
                             int *nghosts,
                             int total_procs,
                             int *nprocs,
                             int this_proc);

pComm *PUGH_SetupGArrayGroupComm(pGH *pughGH,
                                 int dim,
                                 int first_var,
                                 int n_vars,
                                 int sync_timelevel,
                                 int vartype,
                                 pGExtras *extras);

void pGH_DumpInfo(pGH *pughGH);
int  PUGH_SetupDefaultTopology(int dim, int *nprocs);
void PUGH_DestroyGArray(pGA **GA);
void PUGH_DestroyComm(pComm **comm);
void PUGH_DestroyConnectivity(pConnectivity **conn);
void PUGH_DestroyPGExtras(pGExtras **PGExtras);
void PUGH_DestroyPGH(pGH **pughGH);

int PUGH_GenerateTopology(int dim, int total_procs, int *nprocs);

int PUGH_GenerateNeighbours(int dim, 
                            int total_procs, 
                            int *nprocs, 
                            int **neighbours, 
                            int *perme);

int PUGH_DecomposeIJK(int dim, int ijk, int *nprocs, int *pos);

int PUGH_ComposeIJK(int dim, 
                    int *nprocs, 
                    int *pos);

int PUGH_SetupPGExtrasMemory(int dim, 
                             int total_procs,
                             int *nprocs,
                             pGExtras *this);

int PUGH_SetupPGExtrasSizes(int dim, 
                            int *perme,
                            int stagger,
                            int *sh,
                            int *nghosts,
                            int total_procs,
                            int *nprocs,
                            int this_proc,
                            pGExtras *this);

int PUGH_SetupPGExtrasOwnership(int dim, 
                               int *perme,
                               int stagger,
                               int *sh,
                               int *nghosts,
                               int total_procs,
                               int *nprocs,
                               int this_proc,
                               pGExtras *this);

int PUGH_SetupBoundingBox(int dim, 
                          int *perme,
                          int stagger,
                          int *sh,
                          int *nghosts,
                          int total_procs,
                          int *nprocs,
                          pGExtras *this);

int PUGH_SetupRemoteSizes(int dim, 
                          int *perme,
                          int stagger,
                          int *sh,
                          int *nghosts,
                          int total_procs,
                          int *nprocs,
                          pGExtras *this);

int PUGH_SetupPGExtrasStaggering(int dim,
                                 int *perme,
                                 int stagger,
                                 int *sh,
                                 int *nghosts,
                                 int total_procs,
                                 int *nprocs,
                                 int this_proc,
                                 pGExtras *this);

pGA *PUGH_SetupGArray(void *parent,
                      pGExtras *extras,
                      pConnectivity *connectivity,
                      pComm *groupcomm,
                      const char *name,
                      int id,
                      int arrayid,
                      int varsize, 
                      int vtype, 
                      int stagger,
                      int vector_size,
                      int vector_entry,
                      pGA *vector_base);

pComm *PUGH_SetupGArrayComm(pGH *pughGH,
                            int dim,
                            int var,
                            int sync_timelevel,
                            int vartype,
                            pGExtras *extras);

int PUGH_EnableGArrayDataStorage(pGA *GA,
                                 int this_proc,
                                 const char *initialize_memory,
                                 int padding_active,
                                 int padding_cacheline_bits,
                                 int padding_size,
                                 int padding_address_spacing);

int PUGH_EnableGArrayComm(pGA *GA,
                          int commflag);

int PUGH_DisableGArrayDataStorage(pGA *GA);

int PUGH_DisableGArrayComm(pGA *GA);

int PUGH_DisableGArrayGroupComm(pGH *pughGH,
                                int first_var,
                                pComm *groupcomm);

int PUGH_SyncGArray(pGA *GA);

int PUGH_NumTimeLevels(const pGH *pughGH, int var);

#ifdef CCTK_MPI
void PostSendGA     (pGH *pughGH, int dir, pComm *comm);
void PostReceiveGA  (pGH *pughGH, int dir, pComm *comm);
void FinishReceiveGA(pGH *pughGH, int dir, pComm *comm);
#endif

#ifdef __cplusplus
}
#endif

#endif /* defined _PUGHI_H_ */