~ubuntu-branches/ubuntu/trusty/nwchem/trusty-proposed

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/ga++/src/GlobalArray.cc

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#if HAVE_CONFIG_H
2
 
#   include "config.h"
3
 
#endif
4
 
 
5
 
#include "ga++.h"
6
 
 
7
 
#define GA_DATA_TYPE     C_DBL
8
 
#define INVALID_HANDLE   -1000
9
 
 
10
 
static int sTmpVar = 0;
11
 
 
12
 
 
13
 
/**
14
 
 * Constructors and Destructor of GlobalArray          
15
 
 */
16
 
 
17
 
 
18
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], char *arrayname,
19
 
                             int chunk[]) {
20
 
  mHandle = NGA_Create(type, ndim, dims, arrayname, chunk);
21
 
  if(!mHandle)  GA_Error((char *)" GA creation failed",0);
22
 
}
23
 
 
24
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], char *arrayname,
25
 
                             int chunk[], GA::PGroup * p_handle) {
26
 
  mHandle = NGA_Create_config(type, ndim, dims, arrayname, chunk,
27
 
                              p_handle->handle());
28
 
  if(!mHandle)  GA_Error((char *)" GA creation failed",0);
29
 
}
30
 
 
31
 
GA::GlobalArray::GlobalArray(int type, int ndim, int64_t dims[],
32
 
                             char *arrayname, int64_t chunk[]) {
33
 
  mHandle = NGA_Create64(type, ndim, dims, arrayname, chunk);
34
 
  if(!mHandle)  GA_Error((char *)" GA creation failed",0);
35
 
}
36
 
 
37
 
GA::GlobalArray::GlobalArray(int type, int ndim, int64_t dims[],
38
 
                             char *arrayname, int64_t chunk[],
39
 
                             GA::PGroup * p_handle) {
40
 
  mHandle = NGA_Create_config64(type, ndim, dims, arrayname, chunk,
41
 
                                p_handle->handle());
42
 
  if(!mHandle)  GA_Error((char *)" GA creation failed",0);
43
 
}
44
 
 
45
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], char *arrayname,
46
 
                             int block[], int maps[]) {
47
 
  mHandle = NGA_Create_irreg(type, ndim, dims, arrayname, block, maps);
48
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
49
 
}
50
 
 
51
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], char *arrayname,
52
 
                             int block[], int maps[], GA::PGroup * p_handle) {
53
 
  mHandle = NGA_Create_irreg_config(type, ndim, dims, arrayname, block, maps,
54
 
                                    p_handle->handle());
55
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
56
 
}
57
 
 
58
 
GA::GlobalArray::GlobalArray(int type, int ndim, int64_t dims[],
59
 
                             char *arrayname, int64_t block[],
60
 
                             int64_t maps[]) {
61
 
  mHandle = NGA_Create_irreg64(type, ndim, dims, arrayname, block, maps);
62
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
63
 
}
64
 
 
65
 
GA::GlobalArray::GlobalArray(int type, int ndim, int64_t dims[],
66
 
                             char *arrayname, int64_t block[], int64_t maps[],
67
 
                             GA::PGroup * p_handle) {
68
 
  mHandle = NGA_Create_irreg_config64(type, ndim, dims, arrayname, block, maps,
69
 
                                      p_handle->handle());
70
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
71
 
}
72
 
 
73
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], int width[], 
74
 
                             char *arrayname, int chunk[], char ghosts) {
75
 
  mHandle = NGA_Create_ghosts(type, ndim, dims, width, arrayname, chunk);
76
 
  if(!mHandle)  GA_Error((char *)" GA creation failed",0);
77
 
}
78
 
 
79
 
GA::GlobalArray::GlobalArray(int type, int ndim, int64_t dims[], int64_t width[], 
80
 
                             char *arrayname, int64_t chunk[], char ghosts) {
81
 
  mHandle = NGA_Create_ghosts64(type, ndim, dims, width, arrayname, chunk);
82
 
  if(!mHandle)  GA_Error((char *)" GA creation failed",0);
83
 
}
84
 
 
85
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], int width[], 
86
 
                             char *arrayname, int chunk[],
87
 
                             GA::PGroup * p_handle, char ghosts) {
88
 
  mHandle = NGA_Create_ghosts_config(type, ndim, dims, width, arrayname, chunk,
89
 
                                     p_handle->handle());
90
 
  if(!mHandle)  GA_Error((char *)" GA creation failed",0);
91
 
}
92
 
 
93
 
GA::GlobalArray::GlobalArray(int type, int ndim, int64_t dims[], int64_t width[], 
94
 
                             char *arrayname, int64_t chunk[],
95
 
                             GA::PGroup * p_handle, char ghosts) {
96
 
  mHandle = NGA_Create_ghosts_config64(type, ndim, dims, width, arrayname, chunk,
97
 
                                     p_handle->handle());
98
 
  if(!mHandle)  GA_Error((char *)" GA creation failed",0);
99
 
}
100
 
 
101
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], int width[], 
102
 
                             char *arrayname, int block[], int maps[], 
103
 
                             char ghosts) {
104
 
  mHandle = NGA_Create_ghosts_irreg(type, ndim, dims, width, arrayname, block, 
105
 
                                    maps);
106
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
107
 
}
108
 
 
109
 
GA::GlobalArray::GlobalArray(int type, int ndim, int64_t dims[], int64_t width[], 
110
 
                             char *arrayname, int64_t block[], int64_t maps[], 
111
 
                             char ghosts) {
112
 
  mHandle = NGA_Create_ghosts_irreg64(type, ndim, dims, width, arrayname, block, 
113
 
                                    maps);
114
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
115
 
}
116
 
 
117
 
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], int width[], 
118
 
                             char *arrayname, int block[], int maps[],
119
 
                             GA::PGroup * p_handle,
120
 
                             char ghosts) {
121
 
  mHandle = NGA_Create_ghosts_irreg_config(type, ndim, dims, width, arrayname,
122
 
                                           block, maps, p_handle->handle());
123
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
124
 
}
125
 
 
126
 
GA::GlobalArray::GlobalArray(int type, int ndim, int64_t dims[], int64_t width[], 
127
 
                             char *arrayname, int64_t block[], int64_t maps[],
128
 
                             GA::PGroup * p_handle,
129
 
                             char ghosts) {
130
 
  mHandle = NGA_Create_ghosts_irreg_config64(type, ndim, dims, width, arrayname,
131
 
                                           block, maps, p_handle->handle());
132
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
133
 
}
134
 
 
135
 
GA::GlobalArray::GlobalArray(const GA::GlobalArray &g_a, char *arrayname) {
136
 
  mHandle = GA_Duplicate(g_a.mHandle, arrayname);
137
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
138
 
}
139
 
 
140
 
GA::GlobalArray::GlobalArray(const GA::GlobalArray &g_a) {
141
 
  char temp_name[20];
142
 
  
143
 
  sprintf(temp_name, "tmpGA%d", sTmpVar++);
144
 
  mHandle = GA_Duplicate(g_a.mHandle, temp_name);
145
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
146
 
  GA_Copy(g_a.mHandle, mHandle);
147
 
}
148
 
 
149
 
GA::GlobalArray::GlobalArray() {
150
 
  mHandle = GA_Create_handle();
151
 
  if(!mHandle) GA_Error((char *)" GA creation failed",0);
152
 
}
153
 
 
154
 
GA::GlobalArray::~GlobalArray() {
155
 
  GA_Destroy(mHandle); 
156
 
  mHandle = INVALID_HANDLE;
157
 
}
158
 
 
159
 
 
160
 
/*********************************************************************
161
 
 *          Member functions of GA::GlobalArray                          *
162
 
 *********************************************************************/
163
 
 
164
 
void 
165
 
GA::GlobalArray::acc(int lo[], int hi[], void *buf, int ld[], void *alpha) const {
166
 
  NGA_Acc(mHandle, lo, hi, buf, ld, alpha);
167
 
}
168
 
 
169
 
void 
170
 
GA::GlobalArray::acc(int64_t lo[], int64_t hi[], void *buf, int64_t ld[], void *alpha) const {
171
 
  NGA_Acc64(mHandle, lo, hi, buf, ld, alpha);
172
 
}
173
 
 
174
 
void 
175
 
GA::GlobalArray::access(int lo[], int hi[], void *ptr, int ld[]) const {
176
 
  NGA_Access(mHandle, lo, hi, ptr, ld);
177
 
}
178
 
 
179
 
void 
180
 
GA::GlobalArray::access(int64_t lo[], int64_t hi[], void *ptr,
181
 
                        int64_t ld[]) const {
182
 
  NGA_Access64(mHandle, lo, hi, ptr, ld);
183
 
}
184
 
 
185
 
void
186
 
GA::GlobalArray::accessBlock(int idx, void *ptr, int ld[]) const {
187
 
    NGA_Access_block(mHandle, idx, ptr, ld);
188
 
}
189
 
 
190
 
void
191
 
GA::GlobalArray::accessBlock(int64_t idx, void *ptr, int64_t ld[]) const {
192
 
    NGA_Access_block64(mHandle, idx, ptr, ld);
193
 
}
194
 
 
195
 
void
196
 
GA::GlobalArray::accessBlockGrid(int index[], void *ptr, int ld[]) const {
197
 
    NGA_Access_block_grid(mHandle, index, ptr, ld);
198
 
}
199
 
 
200
 
void
201
 
GA::GlobalArray::accessBlockGrid(int64_t index[], void *ptr, int64_t ld[]) const {
202
 
    NGA_Access_block_grid64(mHandle, index, ptr, ld);
203
 
}
204
 
 
205
 
void
206
 
GA::GlobalArray::accessBlockSegment(int proc, void *ptr, int *len) const {
207
 
    NGA_Access_block_segment(mHandle, proc, ptr, len);
208
 
}
209
 
 
210
 
void
211
 
GA::GlobalArray::accessBlockSegment(int proc, void *ptr, int64_t *len) const {
212
 
    NGA_Access_block_segment64(mHandle, proc, ptr, len);
213
 
}
214
 
 
215
 
void 
216
 
GA::GlobalArray::accessGhosts(int dims[], void *ptr, int ld[]) const {
217
 
  NGA_Access_ghosts(mHandle, dims, ptr, ld);
218
 
}
219
 
 
220
 
void 
221
 
GA::GlobalArray::accessGhosts(int64_t dims[], void *ptr, int64_t ld[]) const {
222
 
  NGA_Access_ghosts64(mHandle, dims, ptr, ld);
223
 
}
224
 
 
225
 
void 
226
 
GA::GlobalArray::accessGhostElement(void *ptr, int subscript[], int ld[]) const {
227
 
  NGA_Access_ghost_element(mHandle, ptr, subscript, ld);
228
 
}
229
 
 
230
 
void 
231
 
GA::GlobalArray::accessGhostElement(void *ptr, int64_t subscript[], int64_t ld[]) const {
232
 
  NGA_Access_ghost_element64(mHandle, ptr, subscript, ld);
233
 
}
234
 
 
235
 
void 
236
 
GA::GlobalArray::add(void *alpha, const GA::GlobalArray * g_a, 
237
 
                     void *beta,  const GA::GlobalArray * g_b) const {
238
 
  GA_Add(alpha, g_a->mHandle, beta, g_b->mHandle, mHandle);
239
 
240
 
 
241
 
void  
242
 
GA::GlobalArray::addPatch (void *alpha, 
243
 
                           const GA::GlobalArray * g_a, int alo[], int ahi[],
244
 
                           void *beta,  
245
 
                           const GA::GlobalArray * g_b, int blo[], int bhi[],
246
 
                           int clo[], int chi[]) const {
247
 
  NGA_Add_patch(alpha, g_a->mHandle, alo, ahi, beta, 
248
 
                g_b->mHandle, blo, bhi, mHandle, clo, chi);
249
 
}
250
 
 
251
 
void  
252
 
GA::GlobalArray::addPatch (void *alpha, 
253
 
                           const GA::GlobalArray * g_a, int64_t alo[], int64_t ahi[],
254
 
                           void *beta,  
255
 
                           const GA::GlobalArray * g_b, int64_t blo[], int64_t bhi[],
256
 
                           int64_t clo[], int64_t chi[]) const {
257
 
  NGA_Add_patch64(alpha, g_a->mHandle, alo, ahi, beta, 
258
 
                g_b->mHandle, blo, bhi, mHandle, clo, chi);
259
 
}
260
 
 
261
 
int
262
 
GA::GlobalArray::allocate() const {
263
 
  return GA_Allocate(mHandle);
264
 
}
265
 
 
266
 
void  
267
 
GA::GlobalArray::checkHandle(char* string) const {
268
 
  GA_Check_handle(mHandle, string);
269
 
}
270
 
 
271
 
int 
272
 
GA::GlobalArray::compareDistr(const GA::GlobalArray *g_a) const {
273
 
  return GA_Compare_distr(mHandle, g_a->mHandle);
274
 
}
275
 
 
276
 
void 
277
 
GA::GlobalArray::copy(const GA::GlobalArray *g_a) const {
278
 
  GA_Copy(g_a->mHandle, mHandle);
279
 
}
280
 
 
281
 
void 
282
 
GA::GlobalArray::copyPatch(char trans, const GA::GlobalArray* ga, int alo[], 
283
 
                           int ahi[], int blo[], int bhi[]) const {
284
 
  NGA_Copy_patch(trans, ga->mHandle, alo, ahi, mHandle, blo, bhi);
285
 
}
286
 
 
287
 
void 
288
 
GA::GlobalArray::copyPatch(char trans, const GA::GlobalArray* ga, int64_t alo[], 
289
 
                           int64_t ahi[], int64_t blo[], int64_t bhi[]) const {
290
 
  NGA_Copy_patch64(trans, ga->mHandle, alo, ahi, mHandle, blo, bhi);
291
 
}
292
 
 
293
 
double 
294
 
GA::GlobalArray::ddot(const GA::GlobalArray * g_a) const {
295
 
  return GA_Ddot(mHandle, g_a->mHandle);
296
 
}
297
 
 
298
 
double 
299
 
GA::GlobalArray::ddotPatch(char ta, int alo[], int ahi[],
300
 
                           const GA::GlobalArray * g_a, char tb, 
301
 
                           int blo[], int bhi[]) const {
302
 
  return NGA_Ddot_patch(mHandle, ta, alo, ahi, g_a->mHandle, tb, blo, bhi);
303
 
}
304
 
 
305
 
double 
306
 
GA::GlobalArray::ddotPatch(char ta, int64_t alo[], int64_t ahi[],
307
 
                           const GA::GlobalArray * g_a, char tb, 
308
 
                           int64_t blo[], int64_t bhi[]) const {
309
 
  return NGA_Ddot_patch64(mHandle, ta, alo, ahi, g_a->mHandle, tb, blo, bhi);
310
 
}
311
 
 
312
 
void 
313
 
GA::GlobalArray::destroy() {
314
 
  GA_Destroy(mHandle);
315
 
  mHandle = INVALID_HANDLE;
316
 
}
317
 
 
318
 
void 
319
 
GA::GlobalArray::dgemm(char ta, char tb, int m, int n, int k, double alpha,  
320
 
                       const GA::GlobalArray *g_a, const GA::GlobalArray *g_b, 
321
 
                       double beta) const {
322
 
  GA_Dgemm(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle, 
323
 
           beta, mHandle);
324
 
}
325
 
 
326
 
void 
327
 
GA::GlobalArray::dgemm(char ta, char tb, int64_t m, int64_t n, int64_t k, double alpha,  
328
 
                       const GA::GlobalArray *g_a, const GA::GlobalArray *g_b, 
329
 
                       double beta) const {
330
 
  GA_Dgemm64(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle, 
331
 
           beta, mHandle);
332
 
}
333
 
 
334
 
void 
335
 
GA::GlobalArray::diag(const GA::GlobalArray *g_s, GA::GlobalArray *g_v, 
336
 
                      void *eval) const {
337
 
  GA_Diag(mHandle, g_s->mHandle, g_v->mHandle, eval);
338
 
}
339
 
 
340
 
void 
341
 
GA::GlobalArray::diagReuse(int control, const GA::GlobalArray *g_s, 
342
 
                           GA::GlobalArray *g_v, void *eval) const {
343
 
  GA_Diag_reuse(control, mHandle, g_s->mHandle, g_v->mHandle, eval);
344
 
}
345
 
 
346
 
void 
347
 
GA::GlobalArray::diagStd(GlobalArray *g_v, void *eval) const {
348
 
  GA_Diag_std(mHandle, g_v->mHandle, eval);
349
 
}
350
 
 
351
 
void 
352
 
GA::GlobalArray::diagSeq(const GA::GlobalArray * g_s, 
353
 
                         const GA::GlobalArray * g_v, void *eval) const {
354
 
  GA_Diag_seq(mHandle, g_s->mHandle, g_v->mHandle, eval);
355
 
}
356
 
 
357
 
void 
358
 
GA::GlobalArray::diagStdSeq(const GA::GlobalArray * g_v, void *eval) const {
359
 
  GA_Diag_std_seq(mHandle, g_v->mHandle, eval);
360
 
}
361
 
 
362
 
void 
363
 
GA::GlobalArray::distribution(int me, int* lo, int* hi) const {
364
 
  NGA_Distribution(mHandle, me, lo, hi);
365
 
}
366
 
 
367
 
void 
368
 
GA::GlobalArray::distribution(int me, int64_t* lo, int64_t* hi) const {
369
 
  NGA_Distribution64(mHandle, me, lo, hi);
370
 
}
371
 
 
372
 
float 
373
 
GA::GlobalArray::fdot(const GA::GlobalArray * g_a) const {
374
 
  return GA_Fdot(mHandle, g_a->mHandle);
375
 
}
376
 
 
377
 
float 
378
 
GA::GlobalArray::fdotPatch(char t_a, int alo[], int ahi[], 
379
 
                           const GA::GlobalArray * g_b, char t_b, int blo[], 
380
 
                           int bhi[]) const {
381
 
  return NGA_Fdot_patch(mHandle, t_a, alo, ahi,
382
 
                        g_b->mHandle, t_b, blo, bhi);
383
 
}
384
 
 
385
 
float 
386
 
GA::GlobalArray::fdotPatch(char t_a, int64_t alo[], int64_t ahi[], 
387
 
                           const GA::GlobalArray * g_b, char t_b, int64_t blo[], 
388
 
                           int64_t bhi[]) const {
389
 
  return NGA_Fdot_patch64(mHandle, t_a, alo, ahi,
390
 
                        g_b->mHandle, t_b, blo, bhi);
391
 
}
392
 
 
393
 
void 
394
 
GA::GlobalArray::fill(void *value) const {
395
 
  GA_Fill(mHandle, value);
396
 
}
397
 
 
398
 
void 
399
 
GA::GlobalArray::fillPatch (int lo[], int hi[], void *val) const {
400
 
  NGA_Fill_patch(mHandle, lo, hi, val);
401
 
}
402
 
 
403
 
void 
404
 
GA::GlobalArray::fillPatch (int64_t lo[], int64_t hi[], void *val) const {
405
 
  NGA_Fill_patch64(mHandle, lo, hi, val);
406
 
}
407
 
 
408
 
void 
409
 
GA::GlobalArray::gather(void *v, int * subsarray[], int n) const {
410
 
  NGA_Gather(mHandle, v, subsarray, n);
411
 
}
412
 
 
413
 
void 
414
 
GA::GlobalArray::gather(void *v, int64_t * subsarray[], int64_t n) const {
415
 
  NGA_Gather64(mHandle, v, subsarray, n);
416
 
}
417
 
 
418
 
void 
419
 
GA::GlobalArray::get(int lo[], int hi[], void *buf, int ld[])  const {
420
 
  NGA_Get(mHandle, lo, hi, buf, ld);
421
 
}
422
 
 
423
 
void 
424
 
GA::GlobalArray::get(int64_t lo[], int64_t hi[], void *buf,
425
 
                     int64_t ld[]) const {
426
 
  NGA_Get64(mHandle, lo, hi, buf, ld);
427
 
}
428
 
 
429
 
void
430
 
GA::GlobalArray::getBlockInfo(int num_blocks[], int block_dims[]) {
431
 
  GA_Get_block_info(mHandle, num_blocks, block_dims);
432
 
}
433
 
 
434
 
int 
435
 
GA::GlobalArray::hasGhosts()  const {
436
 
  return GA_Has_ghosts(mHandle);
437
 
}
438
 
 
439
 
int 
440
 
GA::GlobalArray::idot(const GA::GlobalArray * g_a)  const {
441
 
  return GA_Idot(mHandle, g_a->mHandle);
442
 
}
443
 
 
444
 
long 
445
 
GA::GlobalArray::idotPatch(char ta, int alo[], int ahi[],
446
 
                           const GA::GlobalArray * g_a, char tb, 
447
 
                           int blo[], int bhi[])  const {
448
 
  return NGA_Idot_patch(mHandle, ta, alo, ahi, g_a->mHandle, tb, blo, bhi);
449
 
}
450
 
 
451
 
long 
452
 
GA::GlobalArray::idotPatch(char ta, int64_t alo[], int64_t ahi[],
453
 
                           const GA::GlobalArray * g_a, char tb, 
454
 
                           int64_t blo[], int64_t bhi[])  const {
455
 
  return NGA_Idot_patch64(mHandle, ta, alo, ahi, g_a->mHandle, tb, blo, bhi);
456
 
}
457
 
 
458
 
void 
459
 
GA::GlobalArray::inquire(int *type, int *ndim, int dims[])  const {
460
 
  NGA_Inquire(mHandle, type, ndim, dims);
461
 
}
462
 
 
463
 
void 
464
 
GA::GlobalArray::inquire(int *type, int *ndim, int64_t dims[])  const {
465
 
  NGA_Inquire64(mHandle, type, ndim, dims);
466
 
}
467
 
 
468
 
char* 
469
 
GA::GlobalArray::inquireName()  const {
470
 
  return GA_Inquire_name(mHandle);
471
 
}
472
 
 
473
 
long 
474
 
GA::GlobalArray::ldot(const GA::GlobalArray * g_a)  const {
475
 
  return GA_Ldot(mHandle, g_a->mHandle);
476
 
}
477
 
 
478
 
long 
479
 
GA::GlobalArray::ldotPatch(char ta, int alo[], int ahi[],
480
 
                           const GA::GlobalArray * g_a, char tb, 
481
 
                           int blo[], int bhi[])  const {
482
 
  return NGA_Ldot_patch(mHandle, ta, alo, ahi, g_a->mHandle, tb, blo, bhi);
483
 
}
484
 
 
485
 
long 
486
 
GA::GlobalArray::ldotPatch(char ta, int64_t alo[], int64_t ahi[],
487
 
                           const GA::GlobalArray * g_a, char tb, 
488
 
                           int64_t blo[], int64_t bhi[])  const {
489
 
  return NGA_Ldot_patch64(mHandle, ta, alo, ahi, g_a->mHandle, tb, blo, bhi);
490
 
}
491
 
 
492
 
int 
493
 
GA::GlobalArray::lltSolve(const GA::GlobalArray * g_a)  const {
494
 
  return GA_Llt_solve(g_a->mHandle, mHandle);
495
 
}
496
 
 
497
 
int 
498
 
GA::GlobalArray::locate(int subscript[])  const {
499
 
  return NGA_Locate(mHandle, subscript);
500
 
501
 
 
502
 
int 
503
 
GA::GlobalArray::locate(int64_t subscript[])  const {
504
 
  return NGA_Locate64(mHandle, subscript);
505
 
506
 
 
507
 
int 
508
 
GA::GlobalArray::locateRegion(int lo[], int hi[], int map[], int procs[])  const {
509
 
  return NGA_Locate_region(mHandle, lo, hi, map, procs);
510
 
}
511
 
 
512
 
int 
513
 
GA::GlobalArray::locateRegion(int64_t lo[], int64_t hi[], int64_t map[], int procs[])  const {
514
 
  return NGA_Locate_region64(mHandle, lo, hi, map, procs);
515
 
}
516
 
 
517
 
void 
518
 
GA::GlobalArray::luSolve(char trans, const GA::GlobalArray * g_a)  const {
519
 
  GA_Lu_solve(trans, g_a->mHandle, mHandle);
520
 
}
521
 
 
522
 
void 
523
 
GA::GlobalArray::matmulPatch(char transa, char transb, void* alpha, 
524
 
                             void *beta, const GA::GlobalArray *g_a, 
525
 
                             int ailo, int aihi, int ajlo, int ajhi,
526
 
                             const GA::GlobalArray *g_b, 
527
 
                             int bilo, int bihi, int bjlo, int bjhi,
528
 
                             int cilo, int cihi, int cjlo, int cjhi)  const {
529
 
  GA_Matmul_patch(transa, transb, alpha, beta, 
530
 
                  g_a->mHandle, ailo, aihi, ajlo, ajhi, 
531
 
                  g_b->mHandle, bilo, bihi, bjlo, bjhi, 
532
 
                  mHandle, cilo, cihi, cjlo, cjhi);
533
 
}
534
 
 
535
 
void 
536
 
GA::GlobalArray::matmulPatch(char transa, char transb, void* alpha, 
537
 
                             void *beta, const GA::GlobalArray *g_a, 
538
 
                             int64_t ailo, int64_t aihi, int64_t ajlo, int64_t ajhi,
539
 
                             const GA::GlobalArray *g_b, 
540
 
                             int64_t bilo, int64_t bihi, int64_t bjlo, int64_t bjhi,
541
 
                             int64_t cilo, int64_t cihi, int64_t cjlo, int64_t cjhi)  const {
542
 
  GA_Matmul_patch64(transa, transb, alpha, beta, 
543
 
                  g_a->mHandle, ailo, aihi, ajlo, ajhi, 
544
 
                  g_b->mHandle, bilo, bihi, bjlo, bjhi, 
545
 
                  mHandle, cilo, cihi, cjlo, cjhi);
546
 
}
547
 
 
548
 
void 
549
 
GA::GlobalArray::matmulPatch(char transa, char transb, void* alpha, void *beta,
550
 
                             const GA::GlobalArray *g_a, int *alo, int *ahi,
551
 
                             const GA::GlobalArray *g_b, int *blo, int *bhi,
552
 
                             int *clo, int *chi)  const {
553
 
  NGA_Matmul_patch(transa, transb, alpha, beta, g_a->mHandle, alo, ahi, 
554
 
                  g_b->mHandle, blo, bhi, mHandle, clo, chi);
555
 
}
556
 
 
557
 
void 
558
 
GA::GlobalArray::matmulPatch(char transa, char transb, void* alpha, void *beta,
559
 
                             const GA::GlobalArray *g_a, int64_t *alo, int64_t *ahi,
560
 
                             const GA::GlobalArray *g_b, int64_t *blo, int64_t *bhi,
561
 
                             int64_t *clo, int64_t *chi)  const {
562
 
  NGA_Matmul_patch64(transa, transb, alpha, beta, g_a->mHandle, alo, ahi, 
563
 
                  g_b->mHandle, blo, bhi, mHandle, clo, chi);
564
 
}
565
 
 
566
 
void
567
 
GA::GlobalArray::mergeDistrPatch(int alo[], int ahi[], GlobalArray *g_b,
568
 
                                 int blo[], int bhi[]) {
569
 
  NGA_Merge_distr_patch(mHandle, alo, ahi, g_b->mHandle, blo, bhi);
570
 
}
571
 
 
572
 
void
573
 
GA::GlobalArray::mergeDistrPatch(int64_t alo[], int64_t ahi[], GlobalArray *g_b,
574
 
                                 int64_t blo[], int64_t bhi[]) {
575
 
  NGA_Merge_distr_patch64(mHandle, alo, ahi, g_b->mHandle, blo, bhi);
576
 
}
577
 
 
578
 
int
579
 
GA::GlobalArray::isMirrored() {
580
 
  return GA_Is_mirrored(mHandle);
581
 
}
582
 
 
583
 
void
584
 
GA::GlobalArray::mergeMirrored() {
585
 
  GA_Merge_mirrored(mHandle);
586
 
}
587
 
 
588
 
void
589
 
GA::GlobalArray::nbAcc(int lo[], int hi[], void *buf, int ld[], void *alpha,
590
 
                       GANbhdl *nbhandle) {
591
 
  NGA_NbAcc(mHandle, lo, hi, buf, ld, alpha, nbhandle);
592
 
}
593
 
 
594
 
void
595
 
GA::GlobalArray::nbAcc(int64_t lo[], int64_t hi[], void *buf, int64_t ld[], void *alpha,
596
 
                       GANbhdl *nbhandle) {
597
 
  NGA_NbAcc64(mHandle, lo, hi, buf, ld, alpha, nbhandle);
598
 
}
599
 
 
600
 
void
601
 
GA::GlobalArray::nbGet(int lo[], int hi[], void *buf, int ld[], GANbhdl *nbhandle) {
602
 
  NGA_NbGet(mHandle, lo, hi, buf, ld, nbhandle);
603
 
}
604
 
 
605
 
void
606
 
GA::GlobalArray::nbGet(int64_t lo[], int64_t hi[], void *buf, int64_t ld[], GANbhdl *nbhandle) {
607
 
  NGA_NbGet64(mHandle, lo, hi, buf, ld, nbhandle);
608
 
}
609
 
 
610
 
void
611
 
GA::GlobalArray::nbGetGhostDir(int mask[], GANbhdl *nbhandle)
612
 
{
613
 
  NGA_NbGet_ghost_dir(mHandle, mask, nbhandle);
614
 
}
615
 
 
616
 
void
617
 
GA::GlobalArray::nbGetGhostDir(int64_t mask[], GANbhdl *nbhandle)
618
 
{
619
 
  NGA_NbGet_ghost_dir64(mHandle, mask, nbhandle);
620
 
}
621
 
 
622
 
void 
623
 
GA::GlobalArray::nblock(int numblock[])  const {
624
 
  GA_Nblock(mHandle, numblock);
625
 
}
626
 
 
627
 
void
628
 
GA::GlobalArray::nbPut(int lo[], int hi[], void *buf, int ld[], GANbhdl *nbhandle) {
629
 
  NGA_NbPut(mHandle, lo, hi, buf, ld, nbhandle);
630
 
}
631
 
 
632
 
void
633
 
GA::GlobalArray::nbPut(int64_t lo[], int64_t hi[], void *buf, int64_t ld[], GANbhdl *nbhandle) {
634
 
  NGA_NbPut64(mHandle, lo, hi, buf, ld, nbhandle);
635
 
}
636
 
 
637
 
int 
638
 
GA::GlobalArray::ndim()  const {
639
 
  return GA_Ndim(mHandle);
640
 
}
641
 
 
642
 
void
643
 
GA::GlobalArray::pack(const GA::GlobalArray *g_dest,
644
 
                      const GA::GlobalArray *g_mask,
645
 
                      int lo, int hi, int *icount) const {
646
 
    GA_Pack(mHandle, g_dest->mHandle, g_mask->mHandle, lo, hi, icount);
647
 
}
648
 
 
649
 
void
650
 
GA::GlobalArray::pack(const GA::GlobalArray *g_dest,
651
 
                      const GA::GlobalArray *g_mask,
652
 
                      int64_t lo, int64_t hi, int64_t *icount) const {
653
 
    GA_Pack64(mHandle, g_dest->mHandle, g_mask->mHandle, lo, hi, icount);
654
 
}
655
 
 
656
 
void
657
 
GA::GlobalArray::patchEnum(int lo, int hi, void *start, void *inc) {
658
 
  GA_Patch_enum(mHandle, lo, hi, start, inc);
659
 
}
660
 
 
661
 
void
662
 
GA::GlobalArray::patchEnum(int64_t lo, int64_t hi, void *start, void *inc) {
663
 
  GA_Patch_enum64(mHandle, lo, hi, start, inc);
664
 
}
665
 
 
666
 
void 
667
 
GA::GlobalArray::periodicAcc(int lo[], int hi[], void* buf, int ld[], 
668
 
                             void* alpha)  const {
669
 
  NGA_Periodic_acc(mHandle, lo, hi, buf, ld, alpha);
670
 
}
671
 
 
672
 
void 
673
 
GA::GlobalArray::periodicAcc(int64_t lo[], int64_t hi[], void* buf, int64_t ld[], 
674
 
                             void* alpha)  const {
675
 
  NGA_Periodic_acc64(mHandle, lo, hi, buf, ld, alpha);
676
 
}
677
 
 
678
 
void 
679
 
GA::GlobalArray::periodicGet(int lo[], int hi[], void* buf, int ld[])  const {
680
 
  NGA_Periodic_get(mHandle, lo, hi, buf, ld);
681
 
}
682
 
 
683
 
void 
684
 
GA::GlobalArray::periodicGet(int64_t lo[], int64_t hi[], void* buf, int64_t ld[])  const {
685
 
  NGA_Periodic_get64(mHandle, lo, hi, buf, ld);
686
 
}
687
 
 
688
 
void 
689
 
GA::GlobalArray::periodicPut(int lo[], int hi[], void* buf, int ld[])  const {
690
 
  NGA_Periodic_put(mHandle, lo, hi, buf, ld);
691
 
}
692
 
 
693
 
void 
694
 
GA::GlobalArray::periodicPut(int64_t lo[], int64_t hi[], void* buf, int64_t ld[])  const {
695
 
  NGA_Periodic_put64(mHandle, lo, hi, buf, ld);
696
 
}
697
 
 
698
 
void 
699
 
GA::GlobalArray::print() const {
700
 
  GA_Print(mHandle);
701
 
}
702
 
 
703
 
void 
704
 
GA::GlobalArray::printDistribution() const {
705
 
  GA_Print_distribution(mHandle);
706
 
}
707
 
 
708
 
void 
709
 
GA::GlobalArray::printFile(FILE *file)  const {
710
 
  GA_Print_file(file, mHandle);
711
 
}
712
 
 
713
 
void 
714
 
GA::GlobalArray::printPatch(int* lo, int* hi, int pretty)  const {
715
 
  NGA_Print_patch(mHandle, lo, hi, pretty);   
716
 
}
717
 
 
718
 
void 
719
 
GA::GlobalArray::printPatch(int64_t* lo, int64_t* hi, int pretty)  const {
720
 
  NGA_Print_patch64(mHandle, lo, hi, pretty);   
721
 
}
722
 
 
723
 
void 
724
 
GA::GlobalArray::procTopology(int proc, int coord[])  const {
725
 
  NGA_Proc_topology(mHandle, proc, coord);
726
 
}
727
 
 
728
 
void 
729
 
GA::GlobalArray::put(int lo[], int hi[], void *buf, int ld[])  const {
730
 
  NGA_Put(mHandle, lo, hi, buf, ld);
731
 
}
732
 
 
733
 
void 
734
 
GA::GlobalArray::put(int64_t lo[], int64_t hi[], void *buf,
735
 
                     int64_t ld[])  const {
736
 
  NGA_Put64(mHandle, lo, hi, buf, ld);
737
 
}
738
 
 
739
 
long 
740
 
GA::GlobalArray::readInc(int subscript[], long inc)  const {
741
 
  return NGA_Read_inc(mHandle, subscript, inc);
742
 
}
743
 
 
744
 
long 
745
 
GA::GlobalArray::readInc(int64_t subscript[], long inc)  const {
746
 
  return NGA_Read_inc64(mHandle, subscript, inc);
747
 
}
748
 
 
749
 
void 
750
 
GA::GlobalArray::release(int lo[], int hi[])  const {
751
 
  NGA_Release(mHandle, lo, hi);
752
 
}
753
 
 
754
 
void 
755
 
GA::GlobalArray::release(int64_t lo[], int64_t hi[])  const {
756
 
  NGA_Release64(mHandle, lo, hi);
757
 
}
758
 
 
759
 
void
760
 
GA::GlobalArray::releaseBlock(int idx) const {    
761
 
  NGA_Release_block(mHandle, idx);
762
 
}
763
 
 
764
 
void
765
 
GA::GlobalArray::releaseBlockGrid(int index[]) const {    
766
 
  NGA_Release_block_grid(mHandle, index);
767
 
}
768
 
 
769
 
 
770
 
void
771
 
GA::GlobalArray::releaseBlockSegment(int proc) const {    
772
 
  NGA_Release_block_segment(mHandle, proc);
773
 
}
774
 
 
775
 
void
776
 
GA::GlobalArray::releaseGhosts() const {    
777
 
  NGA_Release_ghosts(mHandle);
778
 
}
779
 
 
780
 
void
781
 
GA::GlobalArray::releaseGhostElement(int subscript[]) const {    
782
 
  NGA_Release_ghost_element(mHandle, subscript);
783
 
}
784
 
 
785
 
void
786
 
GA::GlobalArray::releaseGhostElement(int64_t subscript[]) const {    
787
 
  NGA_Release_ghost_element64(mHandle, subscript);
788
 
}
789
 
 
790
 
void 
791
 
GA::GlobalArray::releaseUpdate(int lo[], int hi[])  const {
792
 
  NGA_Release_update(mHandle, lo, hi);
793
 
}
794
 
 
795
 
void 
796
 
GA::GlobalArray::releaseUpdate(int64_t lo[], int64_t hi[])  const {
797
 
  NGA_Release_update64(mHandle, lo, hi);
798
 
}
799
 
 
800
 
void 
801
 
GA::GlobalArray::releaseUpdateBlock(int idx)  const {
802
 
  NGA_Release_update_block(mHandle, idx);
803
 
}
804
 
 
805
 
void 
806
 
GA::GlobalArray::releaseUpdateBlockGrid(int index[])  const {
807
 
  NGA_Release_update_block_grid(mHandle, index);
808
 
}
809
 
 
810
 
void 
811
 
GA::GlobalArray::releaseUpdateBlockSegment(int idx)  const {
812
 
  NGA_Release_update_block_segment(mHandle, idx);
813
 
}
814
 
 
815
 
void
816
 
GA::GlobalArray::releaseUpdateGhosts() const {    
817
 
  NGA_Release_update_ghosts(mHandle);
818
 
}
819
 
 
820
 
void
821
 
GA::GlobalArray::releaseUpdateGhostElement(int subscript[]) const {    
822
 
  NGA_Release_update_ghost_element(mHandle, subscript);
823
 
}
824
 
 
825
 
void
826
 
GA::GlobalArray::releaseUpdateGhostElement(int64_t subscript[]) const {    
827
 
  NGA_Release_update_ghost_element64(mHandle, subscript);
828
 
}
829
 
 
830
 
void 
831
 
GA::GlobalArray::scale(void *value)  const { 
832
 
  GA_Scale(mHandle, value); 
833
 
}
834
 
 
835
 
void 
836
 
GA::GlobalArray::scalePatch (int lo[], int hi[], void *val)  const {
837
 
  NGA_Scale_patch(mHandle, lo, hi, val);
838
 
}
839
 
 
840
 
void 
841
 
GA::GlobalArray::scalePatch (int64_t lo[], int64_t hi[], void *val)  const {
842
 
  NGA_Scale_patch64(mHandle, lo, hi, val);
843
 
}
844
 
 
845
 
void
846
 
GA::GlobalArray::scanAdd(const GA::GlobalArray *g_dest,
847
 
                         const GlobalArray *g_mask,
848
 
                         int lo, int hi, int excl) const {
849
 
    GA_Scan_add(mHandle, g_dest->mHandle, g_mask->mHandle, lo, hi, excl);
850
 
}
851
 
 
852
 
void
853
 
GA::GlobalArray::scanAdd(const GA::GlobalArray *g_dest,
854
 
                         const GlobalArray *g_mask,
855
 
                         int64_t lo, int64_t hi, int excl) const {
856
 
    GA_Scan_add64(mHandle, g_dest->mHandle, g_mask->mHandle, lo, hi, excl);
857
 
}
858
 
 
859
 
void
860
 
GA::GlobalArray::scanCopy(const GA::GlobalArray *g_dest,
861
 
                          const GA::GlobalArray *g_mask,
862
 
                          int lo, int hi) const {
863
 
    GA_Scan_copy(mHandle, g_dest->mHandle, g_mask->mHandle, lo, hi);
864
 
}
865
 
 
866
 
void
867
 
GA::GlobalArray::scanCopy(const GA::GlobalArray *g_dest,
868
 
                          const GA::GlobalArray *g_mask,
869
 
                          int64_t lo, int64_t hi) const {
870
 
    GA_Scan_copy64(mHandle, g_dest->mHandle, g_mask->mHandle, lo, hi);
871
 
}
872
 
 
873
 
void 
874
 
GA::GlobalArray::scatter(void *v, int *subsarray[], int n)  const {
875
 
  NGA_Scatter(mHandle, v, subsarray, n);
876
 
}
877
 
 
878
 
void 
879
 
GA::GlobalArray::scatter(void *v, int64_t *subsarray[], int64_t n)  const {
880
 
  NGA_Scatter64(mHandle, v, subsarray, n);
881
 
}
882
 
 
883
 
void 
884
 
GA::GlobalArray::scatterAcc(void *v, int *subsarray[], int n, void *alpha)  const {
885
 
  NGA_Scatter_acc(mHandle, v, subsarray, n, alpha);
886
 
}
887
 
 
888
 
void 
889
 
GA::GlobalArray::scatterAcc(void *v, int64_t *subsarray[], int64_t n, void
890
 
    *alpha)  const {
891
 
  NGA_Scatter_acc64(mHandle, v, subsarray, n, alpha);
892
 
}
893
 
 
894
 
void 
895
 
GA::GlobalArray::selectElem(char *op, void* val, int index[])  const {
896
 
  NGA_Select_elem(mHandle, op, val, index);
897
 
}
898
 
 
899
 
void 
900
 
GA::GlobalArray::selectElem(char *op, void* val, int64_t index[])  const {
901
 
  NGA_Select_elem64(mHandle, op, val, index);
902
 
}
903
 
 
904
 
void
905
 
GA::GlobalArray::setArrayName(char *name) const {
906
 
    GA_Set_array_name(mHandle, name);
907
 
}
908
 
 
909
 
void
910
 
GA::GlobalArray::setBlockCyclic(int dims[]) const {
911
 
    GA_Set_block_cyclic(mHandle, dims);
912
 
}
913
 
 
914
 
void
915
 
GA::GlobalArray::setBlockCyclicProcGrid(int dims[], int proc_grid[]) const{
916
 
    GA_Set_block_cyclic_proc_grid(mHandle, dims, proc_grid);    
917
 
}
918
 
 
919
 
void
920
 
GA::GlobalArray::setChunk(int chunk[]) const {
921
 
    GA_Set_chunk(mHandle, chunk);    
922
 
}
923
 
 
924
 
void
925
 
GA::GlobalArray::setChunk(int64_t chunk[]) const {
926
 
    GA_Set_chunk64(mHandle, chunk);    
927
 
}
928
 
 
929
 
void
930
 
GA::GlobalArray::setData(int ndim, int dims[], int type) const {
931
 
    GA_Set_data(mHandle, ndim, dims, type);
932
 
}
933
 
 
934
 
void
935
 
GA::GlobalArray::setData(int ndim, int64_t dims[], int type) const {
936
 
    GA_Set_data64(mHandle, ndim, dims, type);
937
 
}
938
 
 
939
 
void
940
 
GA::GlobalArray::setGhosts(int width[]) const {
941
 
    GA_Set_ghosts(mHandle, width);
942
 
}
943
 
 
944
 
void
945
 
GA::GlobalArray::setGhosts(int64_t width[]) const {
946
 
    GA_Set_ghosts64(mHandle, width);
947
 
}
948
 
 
949
 
void
950
 
GA::GlobalArray::setIrregDistr(int mapc[], int nblock[]) const {
951
 
    GA_Set_irreg_distr(mHandle, mapc, nblock);
952
 
}
953
 
 
954
 
void
955
 
GA::GlobalArray::setIrregDistr(int64_t mapc[], int64_t nblock[]) const {
956
 
    GA_Set_irreg_distr64(mHandle, mapc, nblock);
957
 
}
958
 
 
959
 
void
960
 
GA::GlobalArray::setRestricted(int list[], int nprocs) const {
961
 
    GA_Set_restricted(mHandle, list, nprocs);
962
 
}
963
 
 
964
 
void
965
 
GA::GlobalArray::setRestrictedRange(int lo_proc, int hi_proc) const {
966
 
    GA_Set_restricted_range(mHandle, lo_proc, hi_proc);
967
 
}
968
 
 
969
 
void
970
 
GA::GlobalArray::setPGroup(GA::PGroup *pHandle) const {
971
 
    GA_Set_pgroup(mHandle, pHandle->handle());
972
 
}
973
 
 
974
 
void 
975
 
GA::GlobalArray::sgemm(char ta, char tb, int m, int n, int k, float alpha,  
976
 
                       const GA::GlobalArray *g_a, const GA::GlobalArray *g_b, 
977
 
                       float beta)  const {
978
 
  GA_Sgemm(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle, 
979
 
           beta, mHandle);
980
 
}
981
 
 
982
 
void 
983
 
GA::GlobalArray::sgemm(char ta, char tb, int64_t m, int64_t n, int64_t k, float alpha,  
984
 
                       const GA::GlobalArray *g_a, const GA::GlobalArray *g_b, 
985
 
                       float beta)  const {
986
 
  GA_Sgemm64(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle, 
987
 
           beta, mHandle);
988
 
}
989
 
 
990
 
int 
991
 
GA::GlobalArray::solve(const GA::GlobalArray * g_a)  const {
992
 
  return GA_Solve(g_a->mHandle, mHandle);
993
 
}
994
 
 
995
 
int 
996
 
GA::GlobalArray::spdInvert()  const {
997
 
  return GA_Spd_invert(mHandle);
998
 
}
999
 
 
1000
 
void
1001
 
GA::GlobalArray::stridedAcc(int lo[], int hi[], int skip[], void*buf,
1002
 
                            int ld[], void *alpha) const {
1003
 
    NGA_Strided_acc(mHandle, lo, hi, skip, buf, ld, alpha);
1004
 
}
1005
 
 
1006
 
void
1007
 
GA::GlobalArray::stridedAcc(int64_t lo[], int64_t hi[], int64_t skip[], void*buf,
1008
 
                            int64_t ld[], void *alpha) const {
1009
 
    NGA_Strided_acc64(mHandle, lo, hi, skip, buf, ld, alpha);
1010
 
}
1011
 
 
1012
 
void
1013
 
GA::GlobalArray::stridedGet(int lo[], int hi[], int skip[], void*buf,
1014
 
                            int ld[]) const {
1015
 
    NGA_Strided_get(mHandle, lo, hi, skip, buf, ld);
1016
 
}
1017
 
 
1018
 
void
1019
 
GA::GlobalArray::stridedGet(int64_t lo[], int64_t hi[], int64_t skip[], void*buf,
1020
 
                            int64_t ld[]) const {
1021
 
    NGA_Strided_get64(mHandle, lo, hi, skip, buf, ld);
1022
 
}
1023
 
 
1024
 
void
1025
 
GA::GlobalArray::stridedPut(int lo[], int hi[], int skip[], void*buf,
1026
 
                            int ld[]) const {
1027
 
    NGA_Strided_put(mHandle, lo, hi, skip, buf, ld);
1028
 
}
1029
 
 
1030
 
void
1031
 
GA::GlobalArray::stridedPut(int64_t lo[], int64_t hi[], int64_t skip[], void*buf,
1032
 
                            int64_t ld[]) const {
1033
 
    NGA_Strided_put64(mHandle, lo, hi, skip, buf, ld);
1034
 
}
1035
 
 
1036
 
void
1037
 
GA::GlobalArray::summarize(int verbose) const {
1038
 
    GA_Summarize(verbose);
1039
 
}
1040
 
 
1041
 
void 
1042
 
GA::GlobalArray::symmetrize()  const { 
1043
 
  GA_Symmetrize(mHandle); 
1044
 
}
1045
 
 
1046
 
int
1047
 
GA::GlobalArray::totalBlocks() const 
1048
 
{
1049
 
    return GA_Total_blocks(mHandle);
1050
 
}
1051
 
 
1052
 
void 
1053
 
GA::GlobalArray::transpose(const GA::GlobalArray * g_a)  const {
1054
 
  GA_Transpose(mHandle, g_a->mHandle);
1055
 
}
1056
 
 
1057
 
void
1058
 
GA::GlobalArray::unpack(GlobalArray *g_dest, GlobalArray *g_mask,
1059
 
                        int lo, int hi, int *icount) const {
1060
 
    GA_Unpack(mHandle, g_dest->mHandle, g_mask->mHandle, lo, hi, icount);
1061
 
}    
1062
 
 
1063
 
void
1064
 
GA::GlobalArray::unpack(GlobalArray *g_dest, GlobalArray *g_mask,
1065
 
                        int64_t lo, int64_t hi, int64_t *icount) const {
1066
 
    GA_Unpack64(mHandle, g_dest->mHandle, g_mask->mHandle, lo, hi, icount);
1067
 
}    
1068
 
 
1069
 
void 
1070
 
GA::GlobalArray::updateGhosts()  const {
1071
 
  GA_Update_ghosts(mHandle);
1072
 
}
1073
 
 
1074
 
int 
1075
 
GA::GlobalArray::updateGhostDir(int dimension, int idir, int cflag)  const {
1076
 
  return NGA_Update_ghost_dir(mHandle, dimension, idir, cflag);
1077
 
}
1078
 
 
1079
 
void
1080
 
GA::GlobalArray::getGhostBlock(int lo[], int hi[], void *buf, int ld[]) const {
1081
 
  NGA_Get_ghost_block(mHandle, lo, hi, buf, ld);
1082
 
}
1083
 
 
1084
 
void
1085
 
GA::GlobalArray::getGhostBlock(int64_t lo[], int64_t hi[], void *buf, int64_t ld[]) const {
1086
 
  NGA_Get_ghost_block64(mHandle, lo, hi, buf, ld);
1087
 
}
1088
 
 
1089
 
DoubleComplex 
1090
 
GA::GlobalArray::zdot(const GA::GlobalArray * g_a)  const {
1091
 
  return GA_Zdot(mHandle, g_a->mHandle);
1092
 
}
1093
 
 
1094
 
DoubleComplex 
1095
 
GA::GlobalArray::zdotPatch(char ta, int alo[], int ahi[],
1096
 
                           const GA::GlobalArray * g_a, char tb, 
1097
 
                           int blo[], int bhi[])  const {
1098
 
  return NGA_Zdot_patch(mHandle, ta, alo, ahi, g_a->mHandle, tb, blo, bhi);
1099
 
}
1100
 
 
1101
 
DoubleComplex 
1102
 
GA::GlobalArray::zdotPatch(char ta, int64_t alo[], int64_t ahi[],
1103
 
                           const GA::GlobalArray * g_a, char tb, 
1104
 
                           int64_t blo[], int64_t bhi[])  const {
1105
 
  return NGA_Zdot_patch64(mHandle, ta, alo, ahi, g_a->mHandle, tb, blo, bhi);
1106
 
}
1107
 
 
1108
 
void 
1109
 
GA::GlobalArray::zero()  const { 
1110
 
  GA_Zero(mHandle); 
1111
 
}
1112
 
 
1113
 
void 
1114
 
GA::GlobalArray::zeroPatch (int lo[], int hi[])  const {
1115
 
  NGA_Zero_patch(mHandle, lo, hi);
1116
 
}
1117
 
 
1118
 
void 
1119
 
GA::GlobalArray::zeroPatch (int64_t lo[], int64_t hi[])  const {
1120
 
  NGA_Zero_patch64(mHandle, lo, hi);
1121
 
}
1122
 
 
1123
 
void 
1124
 
GA::GlobalArray::zgemm(char ta, char tb, int m, int n, int k, 
1125
 
                       DoubleComplex alpha,  
1126
 
                       const GA::GlobalArray *g_a, const GA::GlobalArray *g_b, 
1127
 
                       DoubleComplex beta)  const {
1128
 
  GA_Zgemm(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle, 
1129
 
           beta, mHandle);
1130
 
}
1131
 
 
1132
 
void 
1133
 
GA::GlobalArray::zgemm(char ta, char tb, int64_t m, int64_t n, int64_t k, 
1134
 
                       DoubleComplex alpha,  
1135
 
                       const GA::GlobalArray *g_a, const GA::GlobalArray *g_b, 
1136
 
                       DoubleComplex beta)  const {
1137
 
  GA_Zgemm64(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle, 
1138
 
           beta, mHandle);
1139
 
}
1140
 
 
1141
 
/* recent additions */
1142
 
 
1143
 
void 
1144
 
GA::GlobalArray::absValue()  const {
1145
 
  GA_Abs_value(mHandle);
1146
 
}
1147
 
 
1148
 
void 
1149
 
GA::GlobalArray::addConstant(void* alpha)  const {
1150
 
  GA_Add_constant(mHandle, alpha);
1151
 
}
1152
 
 
1153
 
void 
1154
 
GA::GlobalArray::recip()  const {
1155
 
  GA_Recip(mHandle);
1156
 
}
1157
 
 
1158
 
void 
1159
 
GA::GlobalArray::elemMultiply(const GA::GlobalArray * g_a, 
1160
 
                              const GA::GlobalArray * g_b)  const {
1161
 
  GA_Elem_multiply(g_a->mHandle, g_b->mHandle, mHandle);
1162
 
}
1163
 
 
1164
 
void 
1165
 
GA::GlobalArray::elemDivide(const GA::GlobalArray * g_a, 
1166
 
                            const GA::GlobalArray * g_b)  const {
1167
 
  GA_Elem_divide(g_a->mHandle, g_b->mHandle, mHandle);
1168
 
}
1169
 
 
1170
 
 
1171
 
void 
1172
 
GA::GlobalArray::elemMaximum(const GA::GlobalArray * g_a, 
1173
 
                             const GA::GlobalArray * g_b)  const {
1174
 
  GA_Elem_maximum(g_a->mHandle, g_b->mHandle, mHandle);
1175
 
}
1176
 
 
1177
 
 
1178
 
void 
1179
 
GA::GlobalArray::elemMinimum(const GA::GlobalArray * g_a, 
1180
 
                             const GA::GlobalArray * g_b)  const {
1181
 
  GA_Elem_minimum(g_a->mHandle, g_b->mHandle, mHandle);
1182
 
}
1183
 
 
1184
 
void 
1185
 
GA::GlobalArray::absValuePatch(int *lo, int *hi)  const {
1186
 
  GA_Abs_value_patch(mHandle, lo, hi);
1187
 
}
1188
 
 
1189
 
void 
1190
 
GA::GlobalArray::absValuePatch(int64_t *lo, int64_t *hi)  const {
1191
 
  GA_Abs_value_patch64(mHandle, lo, hi);
1192
 
}
1193
 
 
1194
 
void 
1195
 
GA::GlobalArray::addConstantPatch(int *lo,int *hi, void *alpha)  const {
1196
 
  GA_Add_constant_patch(mHandle, lo, hi, alpha);
1197
 
}
1198
 
 
1199
 
void 
1200
 
GA::GlobalArray::addConstantPatch(int64_t *lo,int64_t *hi, void *alpha)  const {
1201
 
  GA_Add_constant_patch64(mHandle, lo, hi, alpha);
1202
 
}
1203
 
 
1204
 
void 
1205
 
GA::GlobalArray::recipPatch(int *lo, int *hi)  const {
1206
 
  GA_Recip_patch(mHandle, lo, hi);
1207
 
}
1208
 
 
1209
 
void 
1210
 
GA::GlobalArray::recipPatch(int64_t *lo, int64_t *hi)  const {
1211
 
  GA_Recip_patch64(mHandle, lo, hi);
1212
 
}
1213
 
 
1214
 
void 
1215
 
GA::GlobalArray::stepMax(const GA::GlobalArray * g_a, double *step)  const {// CHECK all Step Max functions
1216
 
  GA_Step_max(mHandle, g_a->mHandle, step);
1217
 
}
1218
 
 
1219
 
void 
1220
 
GA::GlobalArray::stepMaxPatch(int *alo, int *ahi, 
1221
 
                              const GA::GlobalArray * g_b, int *blo, int *bhi, 
1222
 
                              double *step)  const {
1223
 
  GA_Step_max_patch(mHandle, alo, ahi, g_b->mHandle, blo, bhi, step);
1224
 
}
1225
 
 
1226
 
void 
1227
 
GA::GlobalArray::stepMaxPatch(int64_t *alo, int64_t *ahi, 
1228
 
                              const GA::GlobalArray * g_b, int64_t *blo, int64_t *bhi, 
1229
 
                              double *step)  const {
1230
 
  GA_Step_max_patch64(mHandle, alo, ahi, g_b->mHandle, blo, bhi, step);
1231
 
}
1232
 
 
1233
 
void 
1234
 
GA::GlobalArray::elemMultiplyPatch(const GA::GlobalArray * g_a,
1235
 
                                   int *alo,int *ahi,
1236
 
                                   const GA::GlobalArray * g_b,
1237
 
                                   int *blo,int *bhi,
1238
 
                                   int *clo,int *chi)  const {
1239
 
  GA_Elem_multiply_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
1240
 
                         mHandle, clo, chi);
1241
 
}
1242
 
 
1243
 
void 
1244
 
GA::GlobalArray::elemMultiplyPatch(const GA::GlobalArray * g_a,
1245
 
                                   int64_t *alo,int64_t *ahi,
1246
 
                                   const GA::GlobalArray * g_b,
1247
 
                                   int64_t *blo,int64_t *bhi,
1248
 
                                   int64_t *clo,int64_t *chi)  const {
1249
 
  GA_Elem_multiply_patch64(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
1250
 
                         mHandle, clo, chi);
1251
 
}
1252
 
 
1253
 
void
1254
 
GA::GlobalArray::elemDividePatch(const GA::GlobalArray * g_a,int *alo,int *ahi,
1255
 
                                 const GA::GlobalArray * g_b,int *blo,int *bhi,
1256
 
                                 int *clo,int *chi)  const {
1257
 
  GA_Elem_divide_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
1258
 
                       mHandle, clo, chi);
1259
 
}
1260
 
 
1261
 
void
1262
 
GA::GlobalArray::elemDividePatch(const GA::GlobalArray * g_a,int64_t *alo,
1263
 
             int64_t *ahi, const GA::GlobalArray * g_b, int64_t *blo,
1264
 
             int64_t *bhi, int64_t *clo, int64_t *chi)  const {
1265
 
  GA_Elem_divide_patch64(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
1266
 
                       mHandle, clo, chi);
1267
 
}
1268
 
 
1269
 
void 
1270
 
GA::GlobalArray::elemMaximumPatch(const GA::GlobalArray * g_a,
1271
 
                                  int *alo,int *ahi,
1272
 
                                  const GA::GlobalArray * g_b,
1273
 
                                  int *blo,int *bhi,
1274
 
                                  int *clo,int *chi)  const {
1275
 
  GA_Elem_maximum_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
1276
 
                        mHandle, clo, chi);
1277
 
}
1278
 
 
1279
 
void 
1280
 
GA::GlobalArray::elemMaximumPatch(const GA::GlobalArray * g_a,
1281
 
                                  int64_t *alo, int64_t *ahi,
1282
 
                                  const GA::GlobalArray * g_b,
1283
 
                                  int64_t *blo, int64_t *bhi,
1284
 
                                  int64_t *clo, int64_t *chi)  const {
1285
 
  GA_Elem_maximum_patch64(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
1286
 
                        mHandle, clo, chi);
1287
 
}
1288
 
 
1289
 
void 
1290
 
GA::GlobalArray::elemMinimumPatch(const GA::GlobalArray * g_a,
1291
 
                                  int *alo,int *ahi,
1292
 
                                  const GA::GlobalArray * g_b,
1293
 
                                  int *blo,int *bhi,
1294
 
                                  int *clo,int *chi)  const {
1295
 
  GA_Elem_minimum_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
1296
 
                        mHandle, clo, chi);
1297
 
}
1298
 
 
1299
 
void 
1300
 
GA::GlobalArray::elemMinimumPatch(const GA::GlobalArray * g_a,
1301
 
                                  int64_t *alo, int64_t *ahi,
1302
 
                                  const GA::GlobalArray * g_b,
1303
 
                                  int64_t *blo, int64_t *bhi,
1304
 
                                  int64_t *clo, int64_t *chi)  const {
1305
 
  GA_Elem_minimum_patch64(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
1306
 
                        mHandle, clo, chi);
1307
 
}
1308
 
 
1309
 
/*Added by Limin for matrix operations*/
1310
 
 
1311
 
void 
1312
 
GA::GlobalArray::shiftDiagonal(void *c)  const {
1313
 
  GA_Shift_diagonal(mHandle, c);
1314
 
}
1315
 
 
1316
 
void 
1317
 
GA::GlobalArray::setDiagonal(const GA::GlobalArray * g_v)  const {
1318
 
  GA_Set_diagonal(mHandle, g_v->mHandle);
1319
 
}
1320
 
 
1321
 
void 
1322
 
GA::GlobalArray::zeroDiagonal()  const {
1323
 
  GA_Zero_diagonal(mHandle);
1324
 
}
1325
 
 
1326
 
void 
1327
 
GA::GlobalArray::addDiagonal(const GA::GlobalArray * g_v)  const {
1328
 
  GA_Add_diagonal(mHandle, g_v->mHandle);
1329
 
}
1330
 
 
1331
 
void 
1332
 
GA::GlobalArray::getDiagonal(const GA::GlobalArray * g_a)  const {
1333
 
  GA_Get_diag(g_a->mHandle, mHandle);
1334
 
}
1335
 
 
1336
 
void 
1337
 
GA::GlobalArray::scaleRows(const GA::GlobalArray * g_v)  const {
1338
 
  GA_Scale_rows(mHandle, g_v->mHandle);
1339
 
}
1340
 
 
1341
 
void 
1342
 
GA::GlobalArray::scaleCols(const GA::GlobalArray * g_v)  const {
1343
 
  GA_Scale_cols(mHandle, g_v->mHandle);
1344
 
}
1345
 
 
1346
 
void 
1347
 
GA::GlobalArray::norm1(double *nm)  const {
1348
 
 GA_Norm1(mHandle, nm);
1349
 
}
1350
 
 
1351
 
void 
1352
 
GA::GlobalArray::normInfinity(double *nm)  const {
1353
 
 GA_Norm_infinity(mHandle, nm);
1354
 
}
1355
 
 
1356
 
void 
1357
 
GA::GlobalArray::median(const GA::GlobalArray * g_a, 
1358
 
                        const GA::GlobalArray * g_b, 
1359
 
                        const GA::GlobalArray * g_c)  const {
1360
 
  GA_Median(g_a->mHandle, g_b->mHandle, g_c->mHandle, mHandle);
1361
 
}
1362
 
 
1363
 
void 
1364
 
GA::GlobalArray::medianPatch(const GA::GlobalArray * g_a, int *alo, int *ahi, 
1365
 
                             const GA::GlobalArray * g_b, int *blo, int *bhi, 
1366
 
                             const GA::GlobalArray * g_c, int *clo, int *chi, 
1367
 
                             int *mlo, int *mhi)  const {
1368
 
  GA_Median_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
1369
 
                  g_c->mHandle, clo, chi, mHandle, mlo, mhi);
1370
 
}
1371
 
 
1372
 
void 
1373
 
GA::GlobalArray::medianPatch(const GA::GlobalArray * g_a, int64_t *alo, int64_t *ahi, 
1374
 
                             const GA::GlobalArray * g_b, int64_t *blo, int64_t *bhi, 
1375
 
                             const GA::GlobalArray * g_c, int64_t *clo, int64_t *chi, 
1376
 
                             int64_t *mlo, int64_t *mhi)  const {
1377
 
  GA_Median_patch64(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi, 
1378
 
                  g_c->mHandle, clo, chi, mHandle, mlo, mhi);
1379
 
}
1380
 
 
1381
 
 
1382
 
 
1383