aboutsummaryrefslogtreecommitdiff
path: root/src/PUGHSlab.h
blob: b1af99af100b457d922a9b8238470e5aad000d93 (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
 /*@@
   @header    PUGHSlab.h
   @date      Sun 28 May 2000
   @author    Thomas Radke
   @desc
              Global function declarations of thorn PUGHSlab
   @enddesc
   @version   $Header$
 @@*/


#ifndef _PUGHSLAB_PUGHSLAB_H_
#define _PUGHSLAB_PUGHSLAB_H_ 1

#ifdef __cplusplus
extern "C"
{
#endif

/* prototype of a datatype conversion routine */
typedef void (*t_hslabConversionFn) (const void *src,
                                     void *dst,
                                     CCTK_INT nelems,
                                     CCTK_INT src_stride,
                                     CCTK_INT dst_stride);

/* function prototypes */
CCTK_INT PUGHSlab_Get (const cGH *GH,
                       CCTK_INT   mapping_handle,
                       CCTK_INT   proc,
                       CCTK_INT   vindex,
                       CCTK_INT   timelevel,
                       CCTK_INT   hdatatype,
                       void      *hdata);
CCTK_INT PUGHSlab_GetList (const cGH *GH,
                           CCTK_INT mapping_handle,
                           CCTK_INT num_arrays,
                           const CCTK_INT *procs,       /* num_arrays */
                           const CCTK_INT *vindices,    /* num_arrays */
                           const CCTK_INT *timelevels,  /* num_arrays */
                           const CCTK_INT *hdatatypes,  /* num_arrays */
                           void *const *hdata,          /* num_arrays */
                           CCTK_INT *retvals            /* num_arrays */);
CCTK_INT PUGHSlab_DefineLocalMappingByIndex (
           const cGH *GH,
           CCTK_INT vindex,
           CCTK_INT hdim,
           const CCTK_INT *direction, /* vdim*hdim */
           const CCTK_INT *origin,    /* vdim */
           const CCTK_INT *extent,    /* hdim */
           const CCTK_INT *downsample,/* hdim */
           CCTK_INT table_handle,
           t_hslabConversionFn conversion_fn,
           CCTK_INT *hsize_local,     /* hdim */
           CCTK_INT *hsize_global,    /* hdim */
           CCTK_INT *hoffset_global   /* hdim */);

CCTK_INT PUGHSlab_DefineGlobalMappingByIndex (
           const cGH *GH,
           CCTK_INT vindex,
           CCTK_INT hdim,
           const CCTK_INT *direction, /* vdim*hdim */
           const CCTK_INT *origin,    /* vdim */
           const CCTK_INT *extent,    /* hdim */
           const CCTK_INT *downsample,/* hdim */
           CCTK_INT table_handle,
           t_hslabConversionFn conversion_fn,
           CCTK_INT *hsize            /* hdim */);
CCTK_INT PUGHSlab_FreeMapping (CCTK_INT mapping_handle);


int Hyperslab_GetLocalHyperslab (const cGH *GH,
                                 int vindex,
                                 int vtimelvl,
                                 int hdim,
                                 const int global_startpoint [/*vdim*/],
                                 const int directions [/*vdim*/],
                                 const int lengths [/*hdim*/],
                                 const int downsample_ [/*hdim*/],
                                 void **hdata,
                                 int hsize [/*hdim*/], int ghsize [/*hdim*/],
                                 int hoffset [/*hdim*/]);
int Hyperslab_GetHyperslab (const cGH *GH,
                            int proc,
                            int vindex,
                            int vtimelvl,
                            int hdim,
                            const int global_startpoint [/*vdim*/],
                            const int directions [/*vdim*/],
                            const int lengths [/*hdim*/],
                            const int downsample_ [/*hdim*/],
                            void **hdata, int hsize [/*hdim*/]);

#ifdef __cplusplus
}
#endif

#endif  /* _PUGHSLAB_PUGHSLAB_H_ */