7
#define GA_DATA_TYPE C_DBL
8
#define INVALID_HANDLE -1000
10
static int sTmpVar = 0;
14
* Constructors and Destructor of GlobalArray
18
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], char *arrayname,
20
mHandle = NGA_Create(type, ndim, dims, arrayname, chunk);
21
if(!mHandle) GA_Error((char *)" GA creation failed",0);
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,
28
if(!mHandle) GA_Error((char *)" GA creation failed",0);
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);
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,
42
if(!mHandle) GA_Error((char *)" GA creation failed",0);
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);
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,
55
if(!mHandle) GA_Error((char *)" GA creation failed",0);
58
GA::GlobalArray::GlobalArray(int type, int ndim, int64_t dims[],
59
char *arrayname, int64_t block[],
61
mHandle = NGA_Create_irreg64(type, ndim, dims, arrayname, block, maps);
62
if(!mHandle) GA_Error((char *)" GA creation failed",0);
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,
70
if(!mHandle) GA_Error((char *)" GA creation failed",0);
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);
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);
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,
90
if(!mHandle) GA_Error((char *)" GA creation failed",0);
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,
98
if(!mHandle) GA_Error((char *)" GA creation failed",0);
101
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], int width[],
102
char *arrayname, int block[], int maps[],
104
mHandle = NGA_Create_ghosts_irreg(type, ndim, dims, width, arrayname, block,
106
if(!mHandle) GA_Error((char *)" GA creation failed",0);
109
GA::GlobalArray::GlobalArray(int type, int ndim, int64_t dims[], int64_t width[],
110
char *arrayname, int64_t block[], int64_t maps[],
112
mHandle = NGA_Create_ghosts_irreg64(type, ndim, dims, width, arrayname, block,
114
if(!mHandle) GA_Error((char *)" GA creation failed",0);
117
GA::GlobalArray::GlobalArray(int type, int ndim, int dims[], int width[],
118
char *arrayname, int block[], int maps[],
119
GA::PGroup * p_handle,
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);
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,
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);
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);
140
GA::GlobalArray::GlobalArray(const GA::GlobalArray &g_a) {
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);
149
GA::GlobalArray::GlobalArray() {
150
mHandle = GA_Create_handle();
151
if(!mHandle) GA_Error((char *)" GA creation failed",0);
154
GA::GlobalArray::~GlobalArray() {
156
mHandle = INVALID_HANDLE;
160
/*********************************************************************
161
* Member functions of GA::GlobalArray *
162
*********************************************************************/
165
GA::GlobalArray::acc(int lo[], int hi[], void *buf, int ld[], void *alpha) const {
166
NGA_Acc(mHandle, lo, hi, buf, ld, alpha);
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);
175
GA::GlobalArray::access(int lo[], int hi[], void *ptr, int ld[]) const {
176
NGA_Access(mHandle, lo, hi, ptr, ld);
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);
186
GA::GlobalArray::accessBlock(int idx, void *ptr, int ld[]) const {
187
NGA_Access_block(mHandle, idx, ptr, ld);
191
GA::GlobalArray::accessBlock(int64_t idx, void *ptr, int64_t ld[]) const {
192
NGA_Access_block64(mHandle, idx, ptr, ld);
196
GA::GlobalArray::accessBlockGrid(int index[], void *ptr, int ld[]) const {
197
NGA_Access_block_grid(mHandle, index, ptr, ld);
201
GA::GlobalArray::accessBlockGrid(int64_t index[], void *ptr, int64_t ld[]) const {
202
NGA_Access_block_grid64(mHandle, index, ptr, ld);
206
GA::GlobalArray::accessBlockSegment(int proc, void *ptr, int *len) const {
207
NGA_Access_block_segment(mHandle, proc, ptr, len);
211
GA::GlobalArray::accessBlockSegment(int proc, void *ptr, int64_t *len) const {
212
NGA_Access_block_segment64(mHandle, proc, ptr, len);
216
GA::GlobalArray::accessGhosts(int dims[], void *ptr, int ld[]) const {
217
NGA_Access_ghosts(mHandle, dims, ptr, ld);
221
GA::GlobalArray::accessGhosts(int64_t dims[], void *ptr, int64_t ld[]) const {
222
NGA_Access_ghosts64(mHandle, dims, ptr, ld);
226
GA::GlobalArray::accessGhostElement(void *ptr, int subscript[], int ld[]) const {
227
NGA_Access_ghost_element(mHandle, ptr, subscript, ld);
231
GA::GlobalArray::accessGhostElement(void *ptr, int64_t subscript[], int64_t ld[]) const {
232
NGA_Access_ghost_element64(mHandle, ptr, subscript, ld);
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);
242
GA::GlobalArray::addPatch (void *alpha,
243
const GA::GlobalArray * g_a, int alo[], int ahi[],
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);
252
GA::GlobalArray::addPatch (void *alpha,
253
const GA::GlobalArray * g_a, int64_t alo[], int64_t ahi[],
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);
262
GA::GlobalArray::allocate() const {
263
return GA_Allocate(mHandle);
267
GA::GlobalArray::checkHandle(char* string) const {
268
GA_Check_handle(mHandle, string);
272
GA::GlobalArray::compareDistr(const GA::GlobalArray *g_a) const {
273
return GA_Compare_distr(mHandle, g_a->mHandle);
277
GA::GlobalArray::copy(const GA::GlobalArray *g_a) const {
278
GA_Copy(g_a->mHandle, mHandle);
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);
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);
294
GA::GlobalArray::ddot(const GA::GlobalArray * g_a) const {
295
return GA_Ddot(mHandle, g_a->mHandle);
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);
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);
313
GA::GlobalArray::destroy() {
315
mHandle = INVALID_HANDLE;
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,
322
GA_Dgemm(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle,
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,
330
GA_Dgemm64(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle,
335
GA::GlobalArray::diag(const GA::GlobalArray *g_s, GA::GlobalArray *g_v,
337
GA_Diag(mHandle, g_s->mHandle, g_v->mHandle, eval);
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);
347
GA::GlobalArray::diagStd(GlobalArray *g_v, void *eval) const {
348
GA_Diag_std(mHandle, g_v->mHandle, eval);
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);
358
GA::GlobalArray::diagStdSeq(const GA::GlobalArray * g_v, void *eval) const {
359
GA_Diag_std_seq(mHandle, g_v->mHandle, eval);
363
GA::GlobalArray::distribution(int me, int* lo, int* hi) const {
364
NGA_Distribution(mHandle, me, lo, hi);
368
GA::GlobalArray::distribution(int me, int64_t* lo, int64_t* hi) const {
369
NGA_Distribution64(mHandle, me, lo, hi);
373
GA::GlobalArray::fdot(const GA::GlobalArray * g_a) const {
374
return GA_Fdot(mHandle, g_a->mHandle);
378
GA::GlobalArray::fdotPatch(char t_a, int alo[], int ahi[],
379
const GA::GlobalArray * g_b, char t_b, int blo[],
381
return NGA_Fdot_patch(mHandle, t_a, alo, ahi,
382
g_b->mHandle, t_b, blo, bhi);
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);
394
GA::GlobalArray::fill(void *value) const {
395
GA_Fill(mHandle, value);
399
GA::GlobalArray::fillPatch (int lo[], int hi[], void *val) const {
400
NGA_Fill_patch(mHandle, lo, hi, val);
404
GA::GlobalArray::fillPatch (int64_t lo[], int64_t hi[], void *val) const {
405
NGA_Fill_patch64(mHandle, lo, hi, val);
409
GA::GlobalArray::gather(void *v, int * subsarray[], int n) const {
410
NGA_Gather(mHandle, v, subsarray, n);
414
GA::GlobalArray::gather(void *v, int64_t * subsarray[], int64_t n) const {
415
NGA_Gather64(mHandle, v, subsarray, n);
419
GA::GlobalArray::get(int lo[], int hi[], void *buf, int ld[]) const {
420
NGA_Get(mHandle, lo, hi, buf, ld);
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);
430
GA::GlobalArray::getBlockInfo(int num_blocks[], int block_dims[]) {
431
GA_Get_block_info(mHandle, num_blocks, block_dims);
435
GA::GlobalArray::hasGhosts() const {
436
return GA_Has_ghosts(mHandle);
440
GA::GlobalArray::idot(const GA::GlobalArray * g_a) const {
441
return GA_Idot(mHandle, g_a->mHandle);
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);
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);
459
GA::GlobalArray::inquire(int *type, int *ndim, int dims[]) const {
460
NGA_Inquire(mHandle, type, ndim, dims);
464
GA::GlobalArray::inquire(int *type, int *ndim, int64_t dims[]) const {
465
NGA_Inquire64(mHandle, type, ndim, dims);
469
GA::GlobalArray::inquireName() const {
470
return GA_Inquire_name(mHandle);
474
GA::GlobalArray::ldot(const GA::GlobalArray * g_a) const {
475
return GA_Ldot(mHandle, g_a->mHandle);
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);
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);
493
GA::GlobalArray::lltSolve(const GA::GlobalArray * g_a) const {
494
return GA_Llt_solve(g_a->mHandle, mHandle);
498
GA::GlobalArray::locate(int subscript[]) const {
499
return NGA_Locate(mHandle, subscript);
503
GA::GlobalArray::locate(int64_t subscript[]) const {
504
return NGA_Locate64(mHandle, subscript);
508
GA::GlobalArray::locateRegion(int lo[], int hi[], int map[], int procs[]) const {
509
return NGA_Locate_region(mHandle, lo, hi, map, procs);
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);
518
GA::GlobalArray::luSolve(char trans, const GA::GlobalArray * g_a) const {
519
GA_Lu_solve(trans, g_a->mHandle, mHandle);
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);
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);
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);
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);
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);
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);
579
GA::GlobalArray::isMirrored() {
580
return GA_Is_mirrored(mHandle);
584
GA::GlobalArray::mergeMirrored() {
585
GA_Merge_mirrored(mHandle);
589
GA::GlobalArray::nbAcc(int lo[], int hi[], void *buf, int ld[], void *alpha,
591
NGA_NbAcc(mHandle, lo, hi, buf, ld, alpha, nbhandle);
595
GA::GlobalArray::nbAcc(int64_t lo[], int64_t hi[], void *buf, int64_t ld[], void *alpha,
597
NGA_NbAcc64(mHandle, lo, hi, buf, ld, alpha, nbhandle);
601
GA::GlobalArray::nbGet(int lo[], int hi[], void *buf, int ld[], GANbhdl *nbhandle) {
602
NGA_NbGet(mHandle, lo, hi, buf, ld, nbhandle);
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);
611
GA::GlobalArray::nbGetGhostDir(int mask[], GANbhdl *nbhandle)
613
NGA_NbGet_ghost_dir(mHandle, mask, nbhandle);
617
GA::GlobalArray::nbGetGhostDir(int64_t mask[], GANbhdl *nbhandle)
619
NGA_NbGet_ghost_dir64(mHandle, mask, nbhandle);
623
GA::GlobalArray::nblock(int numblock[]) const {
624
GA_Nblock(mHandle, numblock);
628
GA::GlobalArray::nbPut(int lo[], int hi[], void *buf, int ld[], GANbhdl *nbhandle) {
629
NGA_NbPut(mHandle, lo, hi, buf, ld, nbhandle);
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);
638
GA::GlobalArray::ndim() const {
639
return GA_Ndim(mHandle);
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);
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);
657
GA::GlobalArray::patchEnum(int lo, int hi, void *start, void *inc) {
658
GA_Patch_enum(mHandle, lo, hi, start, inc);
662
GA::GlobalArray::patchEnum(int64_t lo, int64_t hi, void *start, void *inc) {
663
GA_Patch_enum64(mHandle, lo, hi, start, inc);
667
GA::GlobalArray::periodicAcc(int lo[], int hi[], void* buf, int ld[],
669
NGA_Periodic_acc(mHandle, lo, hi, buf, ld, alpha);
673
GA::GlobalArray::periodicAcc(int64_t lo[], int64_t hi[], void* buf, int64_t ld[],
675
NGA_Periodic_acc64(mHandle, lo, hi, buf, ld, alpha);
679
GA::GlobalArray::periodicGet(int lo[], int hi[], void* buf, int ld[]) const {
680
NGA_Periodic_get(mHandle, lo, hi, buf, ld);
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);
689
GA::GlobalArray::periodicPut(int lo[], int hi[], void* buf, int ld[]) const {
690
NGA_Periodic_put(mHandle, lo, hi, buf, ld);
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);
699
GA::GlobalArray::print() const {
704
GA::GlobalArray::printDistribution() const {
705
GA_Print_distribution(mHandle);
709
GA::GlobalArray::printFile(FILE *file) const {
710
GA_Print_file(file, mHandle);
714
GA::GlobalArray::printPatch(int* lo, int* hi, int pretty) const {
715
NGA_Print_patch(mHandle, lo, hi, pretty);
719
GA::GlobalArray::printPatch(int64_t* lo, int64_t* hi, int pretty) const {
720
NGA_Print_patch64(mHandle, lo, hi, pretty);
724
GA::GlobalArray::procTopology(int proc, int coord[]) const {
725
NGA_Proc_topology(mHandle, proc, coord);
729
GA::GlobalArray::put(int lo[], int hi[], void *buf, int ld[]) const {
730
NGA_Put(mHandle, lo, hi, buf, ld);
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);
740
GA::GlobalArray::readInc(int subscript[], long inc) const {
741
return NGA_Read_inc(mHandle, subscript, inc);
745
GA::GlobalArray::readInc(int64_t subscript[], long inc) const {
746
return NGA_Read_inc64(mHandle, subscript, inc);
750
GA::GlobalArray::release(int lo[], int hi[]) const {
751
NGA_Release(mHandle, lo, hi);
755
GA::GlobalArray::release(int64_t lo[], int64_t hi[]) const {
756
NGA_Release64(mHandle, lo, hi);
760
GA::GlobalArray::releaseBlock(int idx) const {
761
NGA_Release_block(mHandle, idx);
765
GA::GlobalArray::releaseBlockGrid(int index[]) const {
766
NGA_Release_block_grid(mHandle, index);
771
GA::GlobalArray::releaseBlockSegment(int proc) const {
772
NGA_Release_block_segment(mHandle, proc);
776
GA::GlobalArray::releaseGhosts() const {
777
NGA_Release_ghosts(mHandle);
781
GA::GlobalArray::releaseGhostElement(int subscript[]) const {
782
NGA_Release_ghost_element(mHandle, subscript);
786
GA::GlobalArray::releaseGhostElement(int64_t subscript[]) const {
787
NGA_Release_ghost_element64(mHandle, subscript);
791
GA::GlobalArray::releaseUpdate(int lo[], int hi[]) const {
792
NGA_Release_update(mHandle, lo, hi);
796
GA::GlobalArray::releaseUpdate(int64_t lo[], int64_t hi[]) const {
797
NGA_Release_update64(mHandle, lo, hi);
801
GA::GlobalArray::releaseUpdateBlock(int idx) const {
802
NGA_Release_update_block(mHandle, idx);
806
GA::GlobalArray::releaseUpdateBlockGrid(int index[]) const {
807
NGA_Release_update_block_grid(mHandle, index);
811
GA::GlobalArray::releaseUpdateBlockSegment(int idx) const {
812
NGA_Release_update_block_segment(mHandle, idx);
816
GA::GlobalArray::releaseUpdateGhosts() const {
817
NGA_Release_update_ghosts(mHandle);
821
GA::GlobalArray::releaseUpdateGhostElement(int subscript[]) const {
822
NGA_Release_update_ghost_element(mHandle, subscript);
826
GA::GlobalArray::releaseUpdateGhostElement(int64_t subscript[]) const {
827
NGA_Release_update_ghost_element64(mHandle, subscript);
831
GA::GlobalArray::scale(void *value) const {
832
GA_Scale(mHandle, value);
836
GA::GlobalArray::scalePatch (int lo[], int hi[], void *val) const {
837
NGA_Scale_patch(mHandle, lo, hi, val);
841
GA::GlobalArray::scalePatch (int64_t lo[], int64_t hi[], void *val) const {
842
NGA_Scale_patch64(mHandle, lo, hi, val);
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);
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);
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);
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);
874
GA::GlobalArray::scatter(void *v, int *subsarray[], int n) const {
875
NGA_Scatter(mHandle, v, subsarray, n);
879
GA::GlobalArray::scatter(void *v, int64_t *subsarray[], int64_t n) const {
880
NGA_Scatter64(mHandle, v, subsarray, n);
884
GA::GlobalArray::scatterAcc(void *v, int *subsarray[], int n, void *alpha) const {
885
NGA_Scatter_acc(mHandle, v, subsarray, n, alpha);
889
GA::GlobalArray::scatterAcc(void *v, int64_t *subsarray[], int64_t n, void
891
NGA_Scatter_acc64(mHandle, v, subsarray, n, alpha);
895
GA::GlobalArray::selectElem(char *op, void* val, int index[]) const {
896
NGA_Select_elem(mHandle, op, val, index);
900
GA::GlobalArray::selectElem(char *op, void* val, int64_t index[]) const {
901
NGA_Select_elem64(mHandle, op, val, index);
905
GA::GlobalArray::setArrayName(char *name) const {
906
GA_Set_array_name(mHandle, name);
910
GA::GlobalArray::setBlockCyclic(int dims[]) const {
911
GA_Set_block_cyclic(mHandle, dims);
915
GA::GlobalArray::setBlockCyclicProcGrid(int dims[], int proc_grid[]) const{
916
GA_Set_block_cyclic_proc_grid(mHandle, dims, proc_grid);
920
GA::GlobalArray::setChunk(int chunk[]) const {
921
GA_Set_chunk(mHandle, chunk);
925
GA::GlobalArray::setChunk(int64_t chunk[]) const {
926
GA_Set_chunk64(mHandle, chunk);
930
GA::GlobalArray::setData(int ndim, int dims[], int type) const {
931
GA_Set_data(mHandle, ndim, dims, type);
935
GA::GlobalArray::setData(int ndim, int64_t dims[], int type) const {
936
GA_Set_data64(mHandle, ndim, dims, type);
940
GA::GlobalArray::setGhosts(int width[]) const {
941
GA_Set_ghosts(mHandle, width);
945
GA::GlobalArray::setGhosts(int64_t width[]) const {
946
GA_Set_ghosts64(mHandle, width);
950
GA::GlobalArray::setIrregDistr(int mapc[], int nblock[]) const {
951
GA_Set_irreg_distr(mHandle, mapc, nblock);
955
GA::GlobalArray::setIrregDistr(int64_t mapc[], int64_t nblock[]) const {
956
GA_Set_irreg_distr64(mHandle, mapc, nblock);
960
GA::GlobalArray::setRestricted(int list[], int nprocs) const {
961
GA_Set_restricted(mHandle, list, nprocs);
965
GA::GlobalArray::setRestrictedRange(int lo_proc, int hi_proc) const {
966
GA_Set_restricted_range(mHandle, lo_proc, hi_proc);
970
GA::GlobalArray::setPGroup(GA::PGroup *pHandle) const {
971
GA_Set_pgroup(mHandle, pHandle->handle());
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,
978
GA_Sgemm(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle,
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,
986
GA_Sgemm64(ta, tb, m, n, k, alpha, g_a->mHandle, g_b->mHandle,
991
GA::GlobalArray::solve(const GA::GlobalArray * g_a) const {
992
return GA_Solve(g_a->mHandle, mHandle);
996
GA::GlobalArray::spdInvert() const {
997
return GA_Spd_invert(mHandle);
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);
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);
1013
GA::GlobalArray::stridedGet(int lo[], int hi[], int skip[], void*buf,
1015
NGA_Strided_get(mHandle, lo, hi, skip, buf, ld);
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);
1025
GA::GlobalArray::stridedPut(int lo[], int hi[], int skip[], void*buf,
1027
NGA_Strided_put(mHandle, lo, hi, skip, buf, ld);
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);
1037
GA::GlobalArray::summarize(int verbose) const {
1038
GA_Summarize(verbose);
1042
GA::GlobalArray::symmetrize() const {
1043
GA_Symmetrize(mHandle);
1047
GA::GlobalArray::totalBlocks() const
1049
return GA_Total_blocks(mHandle);
1053
GA::GlobalArray::transpose(const GA::GlobalArray * g_a) const {
1054
GA_Transpose(mHandle, g_a->mHandle);
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);
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);
1070
GA::GlobalArray::updateGhosts() const {
1071
GA_Update_ghosts(mHandle);
1075
GA::GlobalArray::updateGhostDir(int dimension, int idir, int cflag) const {
1076
return NGA_Update_ghost_dir(mHandle, dimension, idir, cflag);
1080
GA::GlobalArray::getGhostBlock(int lo[], int hi[], void *buf, int ld[]) const {
1081
NGA_Get_ghost_block(mHandle, lo, hi, buf, ld);
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);
1090
GA::GlobalArray::zdot(const GA::GlobalArray * g_a) const {
1091
return GA_Zdot(mHandle, g_a->mHandle);
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);
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);
1109
GA::GlobalArray::zero() const {
1114
GA::GlobalArray::zeroPatch (int lo[], int hi[]) const {
1115
NGA_Zero_patch(mHandle, lo, hi);
1119
GA::GlobalArray::zeroPatch (int64_t lo[], int64_t hi[]) const {
1120
NGA_Zero_patch64(mHandle, lo, hi);
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,
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,
1141
/* recent additions */
1144
GA::GlobalArray::absValue() const {
1145
GA_Abs_value(mHandle);
1149
GA::GlobalArray::addConstant(void* alpha) const {
1150
GA_Add_constant(mHandle, alpha);
1154
GA::GlobalArray::recip() const {
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);
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);
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);
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);
1185
GA::GlobalArray::absValuePatch(int *lo, int *hi) const {
1186
GA_Abs_value_patch(mHandle, lo, hi);
1190
GA::GlobalArray::absValuePatch(int64_t *lo, int64_t *hi) const {
1191
GA_Abs_value_patch64(mHandle, lo, hi);
1195
GA::GlobalArray::addConstantPatch(int *lo,int *hi, void *alpha) const {
1196
GA_Add_constant_patch(mHandle, lo, hi, alpha);
1200
GA::GlobalArray::addConstantPatch(int64_t *lo,int64_t *hi, void *alpha) const {
1201
GA_Add_constant_patch64(mHandle, lo, hi, alpha);
1205
GA::GlobalArray::recipPatch(int *lo, int *hi) const {
1206
GA_Recip_patch(mHandle, lo, hi);
1210
GA::GlobalArray::recipPatch(int64_t *lo, int64_t *hi) const {
1211
GA_Recip_patch64(mHandle, lo, hi);
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);
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);
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);
1234
GA::GlobalArray::elemMultiplyPatch(const GA::GlobalArray * g_a,
1236
const GA::GlobalArray * g_b,
1238
int *clo,int *chi) const {
1239
GA_Elem_multiply_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi,
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,
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,
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,
1270
GA::GlobalArray::elemMaximumPatch(const GA::GlobalArray * g_a,
1272
const GA::GlobalArray * g_b,
1274
int *clo,int *chi) const {
1275
GA_Elem_maximum_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi,
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,
1290
GA::GlobalArray::elemMinimumPatch(const GA::GlobalArray * g_a,
1292
const GA::GlobalArray * g_b,
1294
int *clo,int *chi) const {
1295
GA_Elem_minimum_patch(g_a->mHandle, alo, ahi, g_b->mHandle, blo, bhi,
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,
1309
/*Added by Limin for matrix operations*/
1312
GA::GlobalArray::shiftDiagonal(void *c) const {
1313
GA_Shift_diagonal(mHandle, c);
1317
GA::GlobalArray::setDiagonal(const GA::GlobalArray * g_v) const {
1318
GA_Set_diagonal(mHandle, g_v->mHandle);
1322
GA::GlobalArray::zeroDiagonal() const {
1323
GA_Zero_diagonal(mHandle);
1327
GA::GlobalArray::addDiagonal(const GA::GlobalArray * g_v) const {
1328
GA_Add_diagonal(mHandle, g_v->mHandle);
1332
GA::GlobalArray::getDiagonal(const GA::GlobalArray * g_a) const {
1333
GA_Get_diag(g_a->mHandle, mHandle);
1337
GA::GlobalArray::scaleRows(const GA::GlobalArray * g_v) const {
1338
GA_Scale_rows(mHandle, g_v->mHandle);
1342
GA::GlobalArray::scaleCols(const GA::GlobalArray * g_v) const {
1343
GA_Scale_cols(mHandle, g_v->mHandle);
1347
GA::GlobalArray::norm1(double *nm) const {
1348
GA_Norm1(mHandle, nm);
1352
GA::GlobalArray::normInfinity(double *nm) const {
1353
GA_Norm_infinity(mHandle, nm);
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);
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);
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);