1
#ifndef __DenseArray_h__
2
#define __DenseArray_h__
10
* DataColl abstraction for a GlobalArray.
12
* A limited abstraction for GA data movement to be managed by the
13
* tascel runtime. Note that the same GA could be wrapped by many
14
* DenseArray objects, each providing a potentially different block
15
* view of the same array.
17
class DenseArray : public DataColl {
19
const int ga; /**< GA being wrapped */
20
const int ndim; /**< Number of dimensions of GA */
21
std::vector<int> block; /**< The blocking for this wrapper*/
22
std::vector<int> dims; /**< The dimensions of the GA */
25
* Compute low index for use in GA call.
27
* Low index for the block pointed to by idx.
28
* @param[in] idx Pointer to index
29
* @param[in] idxlen Length of index (in bytes)
30
* @param[out] lo Lower bound for the block
33
void computeLo(const void *idx, int idxlen, int *lo);
36
* Compute high index for use in GA call.
38
* High index for the block pointed to by idx.
39
* @param[in] idx Pointer to index
40
* @param[in] idxlen Length of index (in bytes)
41
* @param[out] hi Upper bound for the block
44
void computeHi(const void *idx, int idxlen, int *hi);
47
* Compute stride (ld) for use in GA call.
49
* High index for the block pointed to by idx.
50
* @param[in] idx Pointer to index
51
* @param[in] idxlen Length of index (in bytes)
52
* @param[out] ld ld values for the block
55
void computeLd(const void *idx, int idxlen, int *ld);
58
* Combimes computation of lo, hi, and ld arguments of a GA call.
60
* @param[in] idx Pointer to index
61
* @param[in] idxlen Length of index (in bytes)
62
* @param[out] lo lo values for the block
63
* @param[out] hi hi values for the block
64
* @param[out] ld ld values for the block
67
void computeBounds(const void *idx, int idxlen, int *lo, int *hi, int *ld);
72
* Construct a dense array object to wrap a GA
74
* A GA itself it not created. The user is still responsible to
75
* pass a valid GA, and destroy the GA after this object if
77
* @param[in] ga Handle to ga to be wrapped
78
* @param[in] block The size of each block being put of get.
79
* @param[in] len Number of integers pointed to by block. This
80
* should match the number of dimensions of ga.
82
DenseArray(int ga, const int *block, int len);
85
* @copybrief DataColl::getSize(const void*,int)
86
* @copydetails DataColl::getSize(const void*,int)
88
int getSize(const void *idx, int idxlen);
91
* @copybrief DataColl::getProc(const void*,int)
92
* @copydetails DataColl::getProc(const void*,int)
94
int getProc(const void *idx, int idxlen);
97
* @copybrief DataColl::get(const void*,int,void*,int)
98
* @copydetails DataColl::get(const void*,int,void*,int)
100
void get(const void *idx, int idxlen, void *buf, int buflen);
103
* @copybrief DataColl::put(const void*,int,const void*,int)
104
* @copydetails DataColl::put(const void*,int,const void*,int)
106
void put(const void *idx, int idxlen, const void *buf, int buflen);
109
* @copybrief DataColl::add(const void*,int,const void*,int)
110
* @copydetails DataColl::add(const void*,int,const void*,int)
112
void add(const void *idx, int idxlen, const void *buf, int buflen);
115
* @copybrief DataColl::nbGet(const void*,int,void*,int,nbh_t)
116
* @copydetails DataColl::nbGet(const void*,int,void*,int,nbh_t)
118
virtual nbh_t nbGet(const void *idx, int idxlen, void *buf, int buflen, nbh_t nbh=0);
121
* @copybrief DataColl::nbPut(const void*,int,const void*,int,nbh_t)
122
* @copydetails DataColl::nbPut(const void*,int,const void*,int,nbh_t)
124
virtual nbh_t nbPut(const void *idx, int idxlen, const void *buf, int buflen, nbh_t nbh=0);
127
* @copybrief DataColl::nbAdd(const void*,int,const void*,int,nbh_t)
128
* @copydetails DataColl::nbAdd(const void*,int,const void*,int,nbh_t)
130
virtual void *nbAdd(const void *idx, int idxlen, const void *buf, int buflen, nbh_t nbh=0);
133
* @copybrief DataColl::waitHandle(nbh_t)
134
* @copydetails DataColl::waitHandle(nbh_t)
136
virtual void waitHandle(nbh_t nbh);
143
#endif /*__DenseArray_h__*/