libxmp/libxmpf in Omni Compiler  1.3.4
xmp_align.c File Reference
#include <stdarg.h>
#include "mpi.h"
#include "xmp_internal.h"
#include "xmp_math_function.h"
Include dependency graph for xmp_align.c:

Macros

#define MPI_PORTABLE_PLATFORM_H
 

Functions

void xmp_dbg_printf (char *fmt,...)
 
void _XMP_calc_array_dim_elmts (_XMP_array_t *array, int array_index)
 
void _XMP_setup_reduce_type (MPI_Datatype *mpi_datatype, size_t *datatype_size, int datatype)
 
void _XMP_init_array_desc (_XMP_array_t **array, _XMP_template_t *template, int dim, int type, size_t type_size,...)
 
void _XMP_init_array_desc_NOT_ALIGNED (_XMP_array_t **adesc, _XMP_template_t *template, int ndims, int type, size_t type_size, unsigned long long *dim_acc, void *ap)
 
void _XMP_finalize_array_desc (_XMP_array_t *array)
 
void _XMP_align_array_NOT_ALIGNED (_XMP_array_t *array, int array_index)
 
void _XMP_align_array_DUPLICATION (_XMP_array_t *array, int array_index, int template_index, long long align_subscript)
 
void _XMP_align_array_BLOCK (_XMP_array_t *array, int array_index, int template_index, long long align_subscript, int *temp0)
 
void _XMP_align_array_CYCLIC (_XMP_array_t *array, int array_index, int template_index, long long align_subscript, int *temp0)
 
void _XMP_align_array_BLOCK_CYCLIC (_XMP_array_t *array, int array_index, int template_index, long long align_subscript, int *temp0)
 
void _XMP_align_array_GBLOCK (_XMP_array_t *array, int array_index, int template_index, long long align_subscript, int *temp0)
 
void _XMP_alloc_array (void **array_addr, _XMP_array_t *array_desc, int is_coarray,...)
 
void _XMP_alloc_array2 (void **array_addr, _XMP_array_t *array_desc, int is_coarray, unsigned long long *acc[])
 
void _XMP_alloc_array_EXTERN (void **array_addr, _XMP_array_t *array_desc,...)
 
void _XMP_dealloc_array (_XMP_array_t *array_desc)
 
void _XMP_init_array_addr (void **array_addr, void *init_addr, _XMP_array_t *array_desc,...)
 
void _XMP_init_array_comm (_XMP_array_t *array,...)
 
void _XMP_init_array_comm2 (_XMP_array_t *array, int args[])
 
void _XMP_init_array_nodes (_XMP_array_t *array)
 
unsigned long long _XMP_get_array_total_elmts (_XMP_array_t *array)
 
void _XMP_align_array_noalloc (_XMP_array_t *a, int adim, int tdim, long long align_subscript, int *temp0, unsigned long long *acc0)
 
int _XMP_lidx_GBLOCK (_XMP_array_t *a, int i_dim, int global_idx)
 

Macro Definition Documentation

◆ MPI_PORTABLE_PLATFORM_H

#define MPI_PORTABLE_PLATFORM_H

Function Documentation

◆ _XMP_align_array_BLOCK()

void _XMP_align_array_BLOCK ( _XMP_array_t array,
int  array_index,
int  template_index,
long long  align_subscript,
int *  temp0 
)
325 {
326  _XMP_template_t *template = array->align_template;
327  _XMP_ASSERT(template->is_fixed);
328  _XMP_ASSERT(template->is_distributed);
329 
330  _XMP_template_info_t *ti = &(template->info[template_index]);
331  _XMP_template_chunk_t *chunk = &(template->chunk[template_index]);
332  _XMP_array_info_t *ai = &(array->info[array_index]);
333 
334  // check range
335  long long align_lower = ai->ser_lower + align_subscript;
336  long long align_upper = ai->ser_upper + align_subscript;
337  if(align_lower < ti->ser_lower || align_upper > ti->ser_upper)
338  _XMP_fatal("aligned array is out of template bound");
339 
340  // set members
341  ai->is_regular_chunk = (ti->ser_lower == (ai->ser_lower + align_subscript)) && chunk->is_regular_chunk;
343 
344  if(template->is_owner){
345  long long template_lower = chunk->par_lower;
346  long long template_upper = chunk->par_upper;
347 
348  // set par_lower
349  if(align_lower < template_lower){
350  ai->par_lower = template_lower - align_subscript;
351  }
352  else if(template_upper < align_lower){
353  array->is_allocated = false;
354  goto EXIT_CALC_PARALLEL_MEMBERS;
355  }
356  else{
357  ai->par_lower = ai->ser_lower;
358  }
359 
360  // set par_upper
361  if(align_upper < template_lower){
362  array->is_allocated = false;
363  goto EXIT_CALC_PARALLEL_MEMBERS;
364  }
365  else if(template_upper < align_upper){
366  ai->par_upper = template_upper - align_subscript;
367  }
368  else{
369  ai->par_upper = ai->ser_upper;
370  }
371 
372  ai->par_stride = 1;
374  ai->local_lower = 0; // array lower is always 0 in C
375  ai->local_upper = ai->par_size - 1;
376  ai->local_stride = 1;
377  ai->alloc_size = ai->par_size;
378  *temp0 = ai->par_lower;
379  ai->temp0 = temp0;
380  ai->temp0_v = *temp0;
381  }
382 
383 EXIT_CALC_PARALLEL_MEMBERS:
384  ai->align_subscript = align_subscript;
385  ai->align_template_index = template_index;
386 }
Here is the call graph for this function:

◆ _XMP_align_array_BLOCK_CYCLIC()

void _XMP_align_array_BLOCK_CYCLIC ( _XMP_array_t array,
int  array_index,
int  template_index,
long long  align_subscript,
int *  temp0 
)
444  {
445  _XMP_template_t *template = array->align_template;
446  _XMP_ASSERT(template->is_fixed);
447  _XMP_ASSERT(template->is_distributed);
448 
449  _XMP_template_info_t *ti = &(template->info[template_index]);
450  _XMP_template_chunk_t *chunk = &(template->chunk[template_index]);
451  _XMP_array_info_t *ai = &(array->info[array_index]);
452 
453  // check range
454  long long align_lower = ai->ser_lower + align_subscript;
455  long long align_upper = ai->ser_upper + align_subscript;
456  if (((align_lower < ti->ser_lower) || (align_upper > ti->ser_upper))) {
457  _XMP_fatal("aligned array is out of template bound");
458  }
459 
460  // set members
463 
464  if (template->is_owner) {
465 
466  int cycle = chunk->par_stride;
467  int rank = chunk->onto_nodes_info->rank;
468  int nsize = chunk->onto_nodes_info->size;
469 
470  //
471  // set par_lower
472  //
473 
474 /* ai->par_lower = chunk->par_lower - ti->ser_lower; */
475 /* ai->par_upper = chunk->par_upper - ti->ser_lower; */
476 /* ai->par_stride = chunk->par_stride; */
477 /* ai->par_size = chunk->par_chunk_width; */
478 
479  /* //int rank_lb = ((ai->ser_lower + align_subscript - ti->ser_lower) / 2) % nsize; */
480  /* int rank_lb = ((ai->ser_lower + align_subscript - ti->ser_lower) / chunk->par_width) % nsize; */
481  /* //int mod = _XMP_modi_ll_i(rank - rank_lb, nsize); */
482  /* int mod = rank + rank_lb; */
483 
484  /* int v_lower = ti->ser_lower - align_subscript; */
485 
486  /* ai->par_lower = MAX(ai->ser_lower, (long long)(mod * chunk->par_width) + v_lower); */
487 
488  /* //ai->par_lower = mod * chunk->par_width + ai->ser_lower; */
489 
490  /* xmp_dbg_printf("par_lower = %d, mod = %d, par_width = %d, ser_lower = %d\n", */
491  /* ai->par_lower, mod, chunk->par_width, ai->ser_lower); */
492 
493  /* // */
494  /* // set par_upper and par_size */
495  /* // */
496 
497  /* int dist = (ai->ser_upper - (mod * chunk->par_width + ai->ser_lower)) / cycle; */
498  /* int diff = ai->ser_upper - (ai->par_lower + (dist * cycle) + (chunk->par_width - 1)); */
499  /* if (diff > 0){ */
500  /* ai->par_upper = ai->par_lower + (dist * cycle) + (chunk->par_width - 1); */
501  /* ai->par_size = (dist + 1) * chunk->par_width; */
502  /* } */
503  /* else { */
504  /* ai->par_upper = ai->ser_upper; */
505  /* ai->par_size = (dist + 1) * chunk->par_width + diff; */
506  /* } */
507 
508  int rank_dist = (ai->ser_lower + align_subscript - ti->ser_lower) / chunk->par_width;
509  int v_lower = ti->ser_lower + chunk->par_width * rank_dist - align_subscript;
510  int rank_lb = rank_dist % nsize;
511  int mod = _XMP_modi_ll_i(rank - rank_lb, nsize);
512  ai->par_lower = MAX(ai->ser_lower, (long long)(mod * chunk->par_width) + v_lower);
513 
514  /* xmp_dbg_printf("par_lower = %d, mod = %d, par_width = %d, ser_lower = %d\n", */
515  /* ai->par_lower, mod, chunk->par_width, ai->ser_lower); */
516 
517  //
518  // set par_upper and par_size
519  //
520 
521  int dist = (ai->ser_upper - (mod * chunk->par_width + v_lower)) / cycle;
522  int diff = ai->ser_upper - (ai->par_lower + (dist * cycle) + (chunk->par_width - 1));
523  if (diff > 0){
524  ai->par_upper = ai->par_lower + (dist * cycle) + (chunk->par_width - 1);
525  ai->par_size = (dist + 1) * chunk->par_width;
526  }
527  else {
528  ai->par_upper = ai->ser_upper;
529  ai->par_size = (dist + 1) * chunk->par_width + diff;
530  }
531 
532  ai->par_stride = chunk->par_stride;
533 
534  //xmpf_dbg_printf("par_lower = %d, par_upper = %d, par_stride = %d, par_size = %d\n",
535  // ai->par_lower, ai->par_upper, ai->par_stride, ai->par_size);
536 
537  // array lower is always 0 in C
538  // FIXME works when only data is divided equally
539  ai->local_lower = 0;
540  ai->local_upper = ai->par_size - 1;
541  ai->local_stride = 1;
542  ai->alloc_size = ai->par_size;
543 
544  // FIXME needs more variables
545  *temp0 = ai->par_stride;
546  ai->temp0 = temp0;
547  ai->temp0_v = *temp0;
548  }
549 
550  ai->align_subscript = align_subscript;
551 
552  ai->align_template_index = template_index;
553 }
Here is the call graph for this function:

◆ _XMP_align_array_CYCLIC()

void _XMP_align_array_CYCLIC ( _XMP_array_t array,
int  array_index,
int  template_index,
long long  align_subscript,
int *  temp0 
)
390 {
391  _XMP_template_t *template = array->align_template;
392  _XMP_ASSERT(template->is_fixed);
393  _XMP_ASSERT(template->is_distributed);
394 
395  _XMP_template_info_t *ti = &(template->info[template_index]);
396  _XMP_template_chunk_t *chunk = &(template->chunk[template_index]);
397  _XMP_array_info_t *ai = &(array->info[array_index]);
398 
399  // check range
400  long long align_lower = ai->ser_lower + align_subscript;
401  long long align_upper = ai->ser_upper + align_subscript;
402  if (((align_lower < ti->ser_lower) || (align_upper > ti->ser_upper))) {
403  _XMP_fatal("aligned array is out of template bound");
404  }
405 
406  // set members
407  ai->is_regular_chunk = (ti->ser_lower == (ai->ser_lower + align_subscript)) && chunk->is_regular_chunk;
409 
410  if (template->is_owner) {
411  int cycle = chunk->par_stride;
412  //int mod = _XMP_modi_ll_i(chunk->par_lower - align_subscript, cycle);
413  int rank = chunk->onto_nodes_info->rank;
414  int nsize = chunk->onto_nodes_info->size;
415  int rank_lb = (ai->ser_lower + align_subscript - ti->ser_lower) % nsize;
416  int mod = _XMP_modi_ll_i(rank - rank_lb, nsize);
417 
418  int dist = (ai->ser_upper - (mod + ai->ser_lower)) / cycle;
419 
420  //xmpf_dbg_printf("cycle = %d, mod = %d, dist = %d, rank_lb = %d, nsize = %d\n", cycle, mod, dist, rank_lb, nsize);
421 
422  ai->par_lower = mod + ai->ser_lower;
423  ai->par_upper = ai->par_lower + (dist * cycle);
424  ai->par_stride = cycle;
425  ai->par_size = dist + 1;
426 
427  // array lower is always 0 in C
428  ai->local_lower = 0;
429  ai->local_upper = ai->par_size - 1;
430  ai->local_stride = 1;
431  ai->alloc_size = ai->par_size;
432 
433  *temp0 = ai->par_stride;
434  ai->temp0 = temp0;
435  ai->temp0_v = *temp0;
436  }
437 
438  ai->align_subscript = align_subscript;
439 
440  ai->align_template_index = template_index;
441 }
Here is the call graph for this function:

◆ _XMP_align_array_DUPLICATION()

void _XMP_align_array_DUPLICATION ( _XMP_array_t array,
int  array_index,
int  template_index,
long long  align_subscript 
)
283  {
284  _XMP_template_t *template = array->align_template;
285  _XMP_ASSERT(template->is_fixed);
286  _XMP_ASSERT(template->is_distributed);
287 
288  _XMP_template_info_t *ti = &(template->info[template_index]);
289  _XMP_array_info_t *ai = &(array->info[array_index]);
290 
291  int lower = ai->ser_lower;
292  int upper = ai->ser_upper;
293  int size = ai->ser_size;
294 
295  // check range
296  long long align_lower = lower + align_subscript;
297  long long align_upper = upper + align_subscript;
298  if (((align_lower < ti->ser_lower) || (align_upper > ti->ser_upper))) {
299  _XMP_fatal("aligned array is out of template bound");
300  }
301 
302  // set members
303  ai->is_regular_chunk = true;
305 
306  if (template->is_owner) {
307  ai->par_lower = lower;
308  ai->par_upper = upper;
309  ai->par_stride = 1;
310  ai->par_size = size;
311 
312  ai->local_lower = lower;
313  ai->local_upper = upper;
314  ai->local_stride = 1;
315  ai->alloc_size = size;
316  }
317 
318  ai->align_subscript = align_subscript;
319 
320  ai->align_template_index = template_index;
321 }
Here is the call graph for this function:

◆ _XMP_align_array_GBLOCK()

void _XMP_align_array_GBLOCK ( _XMP_array_t array,
int  array_index,
int  template_index,
long long  align_subscript,
int *  temp0 
)
556  {
557 
558  _XMP_template_t *template = array->align_template;
559  _XMP_ASSERT(template->is_fixed);
560  _XMP_ASSERT(template->is_distributed);
561 
562  _XMP_template_info_t *ti = &(template->info[template_index]);
563  _XMP_template_chunk_t *chunk = &(template->chunk[template_index]);
564  _XMP_array_info_t *ai = &(array->info[array_index]);
565 
566  // check range
567  long long align_lower = ai->ser_lower + align_subscript;
568  long long align_upper = ai->ser_upper + align_subscript;
569  if (((align_lower < ti->ser_lower) || (align_upper > ti->ser_upper))) {
570  _XMP_fatal("aligned array is out of template bound");
571  }
572 
573  // set members
574  ai->is_regular_chunk = (ti->ser_lower == (ai->ser_lower + align_subscript)) && chunk->is_regular_chunk;
576 
577  if (template->is_owner) {
578  long long template_lower = chunk->par_lower;
579  long long template_upper = chunk->par_upper;
580 
581  // set par_lower
582  if (align_lower < template_lower) {
583  ai->par_lower = template_lower - align_subscript;
584  }
585  else if (template_upper < align_lower) {
586  array->is_allocated = false;
587  goto EXIT_CALC_PARALLEL_MEMBERS;
588  }
589  else {
590  ai->par_lower = ai->ser_lower;
591  }
592 
593  // set par_upper
594  if (align_upper < template_lower) {
595  array->is_allocated = false;
596  goto EXIT_CALC_PARALLEL_MEMBERS;
597  }
598  else if (template_upper < align_upper) {
599  ai->par_upper = template_upper - align_subscript;
600  }
601  else {
602  ai->par_upper = ai->ser_upper;
603  }
604 
605  ai->par_stride = 1;
607 
608  // array lower is always 0 in C
609  ai->local_lower = 0;
610  ai->local_upper = ai->par_size - 1;
611  ai->local_stride = 1;
612  ai->alloc_size = ai->par_size;
613 
614  *temp0 = ai->par_lower;
615  ai->temp0 = temp0;
616  ai->temp0_v = *temp0;
617  }
618 
619 EXIT_CALC_PARALLEL_MEMBERS:
620 
621  ai->align_subscript = align_subscript;
622 
623  ai->align_template_index = template_index;
624 }
Here is the call graph for this function:

◆ _XMP_align_array_noalloc()

void _XMP_align_array_noalloc ( _XMP_array_t a,
int  adim,
int  tdim,
long long  align_subscript,
int *  temp0,
unsigned long long *  acc0 
)
980  {
981 
982  a->is_allocated = false;
983 
984  _XMP_array_info_t *ai = &(a->info[adim]);
985 
986  ai->align_template_index = tdim;
987  ai->align_subscript = align_subscript; /* not normalized, to be done at xmp_malloc */
988 
989  ai->temp0 = temp0;
990  ai->acc = acc0; // temporarily stored to this member
991 
992  a->array_nodes = NULL;
993 }

◆ _XMP_align_array_NOT_ALIGNED()

void _XMP_align_array_NOT_ALIGNED ( _XMP_array_t array,
int  array_index 
)
253  {
254  _XMP_array_info_t *ai = &(array->info[array_index]);
255 
256  int lower = ai->ser_lower;
257  int upper = ai->ser_upper;
258  int size = ai->ser_size;
259 
260  // set members
261  ai->is_regular_chunk = true;
263 
264  ai->par_lower = lower;
265  ai->par_upper = upper;
266  ai->par_stride = 1;
267  ai->par_size = size;
268 
269  // must be translated to as 0-origin in XMP/F.
270  //ai->local_lower = lower;
271  //ai->local_upper = upper;
272  ai->local_lower = 0;
273  ai->local_upper = upper - lower;
274  ai->local_stride = 1;
275  ai->alloc_size = size;
276 
277  ai->align_subscript = 0;
278 
280 }

◆ _XMP_alloc_array()

void _XMP_alloc_array ( void **  array_addr,
_XMP_array_t array_desc,
int  is_coarray,
  ... 
)
627 {
628  /* if (!array_desc->is_allocated) { */
629  /* *array_addr = NULL; */
630  /* return; */
631  /* } */
632 
633  unsigned long long total_elmts = 1;
634  int dim = array_desc->dim;
635 
636  va_list args;
637  va_start(args, is_coarray);
638  for(int i=dim-1;i>=0;i--){
639  unsigned long long *acc = va_arg(args, unsigned long long *);
640  *acc = total_elmts;
641 
642  array_desc->info[i].dim_acc = total_elmts;
643  total_elmts *= array_desc->info[i].alloc_size;
644  }
645  va_end(args);
646 
647  for(int i=0;i<dim;i++)
648  _XMP_calc_array_dim_elmts(array_desc, i);
649 
650  *array_addr = _XMP_alloc(total_elmts * (array_desc->type_size));
651 
652  // set members
653  array_desc->array_addr_p = *array_addr;
654  array_desc->total_elmts = total_elmts;
655 
656  // for gmove in/out
657 
658 #ifdef _XMP_MPI3_ONESIDED
659  if (is_coarray){
661 
662  long asize[dim];
663  for (int i = 0; i < dim; i++){
664  asize[i] = array_desc->info[i].alloc_size;
665  }
666 
667  _XMP_coarray_malloc_info_n(asize, dim, array_desc->type_size);
668 
669  //_XMP_nodes_t *ndesc = a->align_template->onto_nodes;
670  //_XMP_nodes_t *ndesc = _XMP_get_execution_nodes();
672  int ndims_node = ndesc->dim;
673  int nsize[ndims_node-1];
674  for (int i = 0; i < ndims_node-1; i++){
675  nsize[i] = ndesc->info[i].size;
676  }
677  _XMP_coarray_malloc_image_info_n(nsize, ndims_node);
678 
679  _XMP_coarray_attach(c, *array_addr, array_desc->total_elmts * array_desc->type_size);
680 
681  array_desc->coarray = c;
682  }
683 #endif
684 
685 #ifdef _XMP_TCA
686  _XMP_alloc_tca(array_desc);
687 #endif
688 }
Here is the call graph for this function:

◆ _XMP_alloc_array2()

void _XMP_alloc_array2 ( void **  array_addr,
_XMP_array_t array_desc,
int  is_coarray,
unsigned long long *  acc[] 
)
691  {
692  /* if (!array_desc->is_allocated) { */
693  /* *array_addr = NULL; */
694  /* return; */
695  /* } */
696 
697  unsigned long long total_elmts = 1;
698  int dim = array_desc->dim;
699 
700  for (int i = dim - 1; i >= 0; i--) {
701  *acc[i] = total_elmts;
702 
703  array_desc->info[i].dim_acc = total_elmts;
704 
705  total_elmts *= array_desc->info[i].alloc_size;
706  }
707 
708  for (int i = 0; i < dim; i++) {
709  _XMP_calc_array_dim_elmts(array_desc, i);
710  }
711 
712  *array_addr = _XMP_alloc(total_elmts * (array_desc->type_size));
713 
714  // set members
715  array_desc->array_addr_p = *array_addr;
716  array_desc->total_elmts = total_elmts;
717 
718  // for gmove in/out
719 
720 #ifdef _XMP_MPI3_ONESIDED
721  if (is_coarray){
723 
724  long asize[dim];
725  for (int i = 0; i < dim; i++){
726  asize[i] = array_desc->info[i].alloc_size;
727  }
728 
729  _XMP_coarray_malloc_info_n(asize, dim, array_desc->type_size);
730 
731  //_XMP_nodes_t *ndesc = a->align_template->onto_nodes;
732  //_XMP_nodes_t *ndesc = _XMP_get_execution_nodes();
734  int ndims_node = ndesc->dim;
735  int nsize[ndims_node-1];
736  for (int i = 0; i < ndims_node-1; i++){
737  nsize[i] = ndesc->info[i].size;
738  }
739  _XMP_coarray_malloc_image_info_n(nsize, ndims_node);
740 
741  _XMP_coarray_attach(c, *array_addr, array_desc->total_elmts * array_desc->type_size);
742 
743  array_desc->coarray = c;
744  }
745 #endif
746 
747 #ifdef _XMP_TCA
748  _XMP_alloc_tca(array_desc);
749 #endif
750 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_alloc_array_EXTERN()

void _XMP_alloc_array_EXTERN ( void **  array_addr,
_XMP_array_t array_desc,
  ... 
)
752  {
753  if (!array_desc->is_allocated) {
754  return;
755  }
756 
757  unsigned long long total_elmts = 1;
758  int dim = array_desc->dim;
759  va_list args;
760  va_start(args, array_desc);
761  for (int i = dim - 1; i >= 0; i--) {
762  unsigned long long *acc = va_arg(args, unsigned long long *);
763  *acc = total_elmts;
764 
765  array_desc->info[i].dim_acc = total_elmts;
766 
767  total_elmts *= array_desc->info[i].alloc_size;
768  }
769  va_end(args);
770 
771  for (int i = 0; i < dim; i++) {
772  _XMP_calc_array_dim_elmts(array_desc, i);
773  }
774 
775  // set members
776  array_desc->array_addr_p = *array_addr;
777  array_desc->total_elmts = total_elmts;
778 }
Here is the call graph for this function:

◆ _XMP_calc_array_dim_elmts()

void _XMP_calc_array_dim_elmts ( _XMP_array_t array,
int  array_index 
)
17  {
18  _XMP_ASSERT(array->is_allocated);
19 
20  int dim = array->dim;
21 
22  unsigned long long dim_elmts = 1;
23  for (int i = 0; i < dim; i++) {
24  if (i != array_index) {
25  dim_elmts *= array->info[i].par_size;
26  }
27  }
28 
29  array->info[array_index].dim_elmts = dim_elmts;
30 }
Here is the caller graph for this function:

◆ _XMP_dealloc_array()

void _XMP_dealloc_array ( _XMP_array_t array_desc)
780  {
781  _XMP_free(array_desc->array_addr_p);
782 }
Here is the call graph for this function:

◆ _XMP_finalize_array_desc()

void _XMP_finalize_array_desc ( _XMP_array_t array)
190 {
191  int dim = array->dim;
192 
193  for(int i=0;i<dim;i++){
194  _XMP_array_info_t *ai = &(array->info[i]);
195 
196  if(ai->is_shadow_comm_member)
198 
199  _Bool free_buf = (_XMPF_running && i != dim -1) || (_XMPC_running && i != 0);
200 
201  _XMP_reflect_sched_t *reflect_sched;
202  if((reflect_sched = ai->reflect_sched)){
203  _XMP_finalize_reflect_sched(reflect_sched, free_buf);
204  _XMP_free(reflect_sched);
205  }
206 
207 #ifdef _XMP_XACC
208  _XMP_reflect_sched_t *reflect_acc_sched;
209  if((reflect_acc_sched = ai->reflect_acc_sched)){
210  _XMP_finalize_reflect_sched_acc(reflect_acc_sched, free_buf);
211  _XMP_free(reflect_acc_sched);
212  }
213 #endif
214  }
215 
216  _XMP_async_reflect_t *async_reflect = array->async_reflect;
217  if(async_reflect){
218  for(int i=0;i<async_reflect->nreqs;i++){
219  if (async_reflect->datatype[i] != MPI_DATATYPE_NULL)
220  MPI_Type_free(&async_reflect->datatype[i]);
221  if (async_reflect->reqs[i] != MPI_REQUEST_NULL)
222  MPI_Request_free(&async_reflect->reqs[i]);
223  }
224  _XMP_free(async_reflect->datatype);
225  _XMP_free(async_reflect->reqs);
226  _XMP_free(async_reflect);
227  }
228 
229 /* for (int i = 0; i < array->num_reqs; i++){ */
230 /* if (array->mpi_req_shadow[i] != MPI_REQUEST_NULL){ */
231 /* MPI_Request_free(&array->mpi_req_shadow[i]); */
232 /* } */
233 /* } */
234 /* _XMP_free(array->mpi_req_shadow); */
235 
236  if(array->is_align_comm_member)
238 
239  if(array->is_shrunk_template)
240  if(array->array_nodes)
242 
243 #ifdef _XMP_MPI3_ONESIDED
244  if (array->coarray){
245  _XMP_coarray_detach(array->coarray);
246  _XMP_free(array->coarray);
247  }
248 #endif
249 
250  _XMP_free(array);
251 }
Here is the call graph for this function:

◆ _XMP_get_array_total_elmts()

unsigned long long _XMP_get_array_total_elmts ( _XMP_array_t array)
969  {
970  if (array->is_allocated) {
971  return array->total_elmts;
972  }
973  else {
974  return 0;
975  }
976 }

◆ _XMP_init_array_addr()

void _XMP_init_array_addr ( void **  array_addr,
void *  init_addr,
_XMP_array_t array_desc,
  ... 
)
785  {
786  if (!array_desc->is_allocated) {
787  *array_addr = NULL;
788  return;
789  }
790 
791  unsigned long long total_elmts = 1;
792  int dim = array_desc->dim;
793  va_list args;
794  va_start(args, array_desc);
795  for (int i = dim - 1; i >= 0; i--) {
796  unsigned long long *acc = va_arg(args, unsigned long long *);
797  *acc = total_elmts;
798 
799  array_desc->info[i].dim_acc = total_elmts;
800 
801  total_elmts *= array_desc->info[i].alloc_size;
802  }
803  va_end(args);
804 
805  for (int i = 0; i < dim; i++) {
806  _XMP_calc_array_dim_elmts(array_desc, i);
807  }
808 
809  // clear reflect schedule
810  if (array_desc->array_addr_p && array_desc->array_addr_p != init_addr){
811  for (int i = 0; i < dim; i++) {
812  _XMP_reflect_sched_t *sched = array_desc->info[i].reflect_sched;
813  if (sched){
814  _XMP_finalize_reflect_sched(sched, (i != 0));
816  }
817 #ifdef _XMP_XACC
818  _XMP_reflect_sched_t *sched_acc = array_desc->info[i].reflect_acc_sched;
819  if (sched_acc){
820  _XMP_finalize_reflect_sched_acc(sched_acc, (i != 0));
821  _XMP_init_reflect_sched_acc(sched_acc);
822  }
823 #endif
824  }
825  }
826 
827  *array_addr = init_addr;
828 
829  // set members
830  array_desc->array_addr_p = *array_addr;
831  array_desc->total_elmts = total_elmts;
832 }
Here is the call graph for this function:

◆ _XMP_init_array_comm()

void _XMP_init_array_comm ( _XMP_array_t array,
  ... 
)
835 {
836  _XMP_template_t *align_template = array->align_template;
837  _XMP_ASSERT(align_template->is_distributed);
838  _XMP_nodes_t *onto_nodes = align_template->onto_nodes;
839 
840  int color = 1;
841  if(onto_nodes->is_member){
842  int acc_nodes_size = 1;
843  int template_dim = align_template->dim;
844 
845  va_list args;
846  va_start(args, array);
847  for(int i=0;i<template_dim;i++){
848  _XMP_template_chunk_t *chunk = &(align_template->chunk[i]);
849 
850  int size, rank;
851  if(chunk->dist_manner == _XMP_N_DIST_DUPLICATION){
852  size = 1;
853  rank = 0;
854  }
855  else{
856  _XMP_nodes_info_t *onto_nodes_info = chunk->onto_nodes_info;
857  size = onto_nodes_info->size;
858  rank = onto_nodes_info->rank;
859  }
860 
861  if(va_arg(args, int) == 1)
862  color += (acc_nodes_size * rank);
863 
864  acc_nodes_size *= size;
865  }
866  va_end(args);
867  }
868  else {
869  color = 0;
870  }
871 
872  MPI_Comm *comm = _XMP_alloc(sizeof(MPI_Comm));
873  MPI_Comm_split(*((MPI_Comm *)(_XMP_get_execution_nodes())->comm), color, _XMP_world_rank, comm);
874 
875  // set members
876  array->is_align_comm_member = true;
877  array->align_comm = comm;
878  MPI_Comm_size(*comm, &(array->align_comm_size));
879  MPI_Comm_rank(*comm, &(array->align_comm_rank));
880 }

◆ _XMP_init_array_comm2()

void _XMP_init_array_comm2 ( _XMP_array_t array,
int  args[] 
)
882  {
883  _XMP_template_t *align_template = array->align_template;
884  _XMP_ASSERT(align_template->is_distributed);
885 
886  _XMP_nodes_t *onto_nodes = align_template->onto_nodes;
887 
888  int color = 1;
889  if (onto_nodes->is_member) {
890  int acc_nodes_size = 1;
891  int template_dim = align_template->dim;
892 
893  for (int i = 0; i < template_dim; i++) {
894  _XMP_template_chunk_t *chunk = &(align_template->chunk[i]);
895 
896  int size, rank;
897  if (chunk->dist_manner == _XMP_N_DIST_DUPLICATION) {
898  size = 1;
899  rank = 0;
900  } else {
901  _XMP_nodes_info_t *onto_nodes_info = chunk->onto_nodes_info;
902  size = onto_nodes_info->size;
903  rank = onto_nodes_info->rank;
904  }
905 
906  if (args[i] == 1) {
907  color += (acc_nodes_size * rank);
908  }
909 
910  acc_nodes_size *= size;
911  }
912  } else {
913  color = 0;
914  }
915 
916  MPI_Comm *comm = _XMP_alloc(sizeof(MPI_Comm));
917  MPI_Comm_split(*((MPI_Comm *)(_XMP_get_execution_nodes())->comm), color, _XMP_world_rank, comm);
918 
919  // set members
920  array->is_align_comm_member = true;
921 
922  array->align_comm = comm;
923  MPI_Comm_size(*comm, &(array->align_comm_size));
924  MPI_Comm_rank(*comm, &(array->align_comm_rank));
925 }
Here is the caller graph for this function:

◆ _XMP_init_array_desc()

void _XMP_init_array_desc ( _XMP_array_t **  array,
_XMP_template_t template,
int  dim,
int  type,
size_t  type_size,
  ... 
)
36 {
37  _XMP_array_t *a = _XMP_alloc(sizeof(_XMP_array_t) + sizeof(_XMP_array_info_t) * (dim - 1));
38 
40 
41  a->is_allocated = template->is_owner;
42  a->is_align_comm_member = false;
43  a->dim = dim;
44  a->type = type;
45  a->type_size = type_size;
46 
47  size_t dummy;
48  if (type != _XMP_N_TYPE_NONBASIC)
49  _XMP_setup_reduce_type(&a->mpi_type, &dummy, type);
50  else {
51  a->mpi_type = MPI_BYTE;
52  }
53 
54  a->order = MPI_ORDER_C;
55  a->array_addr_p = NULL;
56  a->total_elmts = 0;
57  a->async_reflect = NULL;
58  a->align_comm = NULL;
59  a->align_comm_size = 1;
61 
62 #ifdef _XMP_MPI3_ONESIDED
63  a->coarray = NULL;
64 #endif
65 
66  //a->num_reqs = -1;
67 
68  //if (!template->is_fixed) _XMP_fatal("target template is not fixed");
69  a->align_template = template;
70 
71  va_list args;
72  va_start(args, type_size);
73  for (int i=0;i<dim;i++){
74  int size = va_arg(args, int);
75  _XMP_ASSERT(size > 0);
76 
77  _XMP_array_info_t *ai = &(a->info[i]);
78  ai->is_shadow_comm_member = false;
79 
80  // array lower is always 0 in C
81  ai->ser_lower = 0;
82  ai->ser_upper = size - 1;
83  ai->ser_size = size;
84 
85  ai->par_lower = 0;
86  ai->par_upper = 0;
87  ai->par_stride = 0;
88  ai->par_size = 0;
89  ai->local_lower = 0;
90  ai->local_upper = 0;
91  ai->local_stride = 0;
92  ai->alloc_size = 0;
93 
95  ai->shadow_size_lo = 0;
96  ai->shadow_size_hi = 0;
97 
98  ai->reflect_sched = NULL;
99  ai->reflect_acc_sched = NULL;
100 
101  ai->shadow_comm = NULL;
102  ai->shadow_comm_size = 1;
104 
105  ai->align_template_index = -1;
106  }
107  va_end(args);
108 
109  *array = a;
110 }
Here is the call graph for this function:

◆ _XMP_init_array_desc_NOT_ALIGNED()

void _XMP_init_array_desc_NOT_ALIGNED ( _XMP_array_t **  adesc,
_XMP_template_t template,
int  ndims,
int  type,
size_t  type_size,
unsigned long long *  dim_acc,
void *  ap 
)
114  {
115 
116  _XMP_array_t *a = _XMP_alloc(sizeof(_XMP_array_t) + sizeof(_XMP_array_info_t) * (ndims - 1));
117 
119 
120  a->is_allocated = template->is_owner;
121  a->is_align_comm_member = false;
122  a->dim = ndims;
123  a->type = type;
124  a->type_size = type_size;
125  size_t dummy;
126  _XMP_setup_reduce_type(&a->mpi_type, &dummy, type);
127  a->order = MPI_ORDER_C;
128  a->array_addr_p = ap;
129 
130  a->total_elmts = -1; // local (non-aligned) data
131 
132  a->async_reflect = NULL;
133 
134  a->align_comm = NULL;
135  a->align_comm_size = 1;
137 
138 #ifdef _XMP_MPI3_ONESIDED
139  a->coarray = NULL;
140 #endif
141 
142  a->is_shrunk_template = false;
143 
144  a->align_template = template;
145 
146  for (int i = 0; i < ndims; i++) {
147 
148  _XMP_array_info_t *ai = &(a->info[i]);
149 
150  ai->is_shadow_comm_member = false;
151  ai->is_regular_chunk = true;
153 
154  ai->ser_lower = 0;
155  /* ai->ser_upper = 0; */
156  /* ai->ser_size = 0; */
157 
158  /* ai->par_lower = 0 */
159  /* ai->par_upper = 0 */
160  /* ai->par_stride = 0; */
161  /* ai->par_size = 0; */
162 
163  /* ai->local_lower = 0; */
164  /* ai->local_upper = 0; */
165  /* ai->local_stride = 0; */
166  /* ai->alloc_size = 0; */
167 
168  ai->dim_acc = dim_acc[i];
169  //ai->dim_elmts = 0;
170 
171  ai->align_subscript = 0;
172 
174  //ai->shadow_size_lo = 0;
175  //ai->shadow_size_hi = 0;
176 
177  ai->reflect_sched = NULL;
178  ai->reflect_acc_sched = NULL;
179  ai->shadow_comm = NULL;
180  ai->shadow_comm_size = 1;
182 
184 
185  }
186  *adesc = a;
187 }
Here is the call graph for this function:

◆ _XMP_init_array_nodes()

void _XMP_init_array_nodes ( _XMP_array_t array)
928 {
929  _XMP_template_t *align_template = array->align_template;
930 
931  int template_dim = align_template->dim;
932  int align_template_shrink[template_dim];
933  int align_template_num = 0;
934  long long align_template_lower[template_dim], align_template_upper[template_dim],
935  align_template_stride[template_dim];
936 
937  for(int i=0;i<template_dim;i++)
938  align_template_shrink[i] = 1;
939 
940  int array_dim = array->dim;
941  for(int i=0;i<array_dim;i++){
942  _XMP_array_info_t *info = &(array->info[i]);
943  int align_template_index = info->align_template_index;
944  if(align_template_index != _XMP_N_NO_ALIGN_TEMPLATE){
945  align_template_shrink[align_template_index] = 0;
946  align_template_num++;
947  align_template_lower[align_template_index] = info->ser_lower + info->align_subscript;
948  align_template_upper[align_template_index] = info->ser_upper + info->align_subscript;
949  align_template_stride[align_template_index] = 1;
950  }
951  }
952 
953  if(template_dim == align_template_num){
954  array->is_shrunk_template = false;
955  }
956  else if (template_dim > align_template_num){
957  array->is_shrunk_template = true;
958  }
959 
960  if (array->is_shrunk_template){
961  array->array_nodes =
962  _XMP_create_nodes_by_template_ref(align_template, align_template_shrink, align_template_lower,
963  align_template_upper, align_template_stride);
964  }else{
965  array->array_nodes =_XMP_create_temporary_nodes(align_template->onto_nodes);
966  }
967 }
Here is the call graph for this function:

◆ _XMP_lidx_GBLOCK()

int _XMP_lidx_GBLOCK ( _XMP_array_t a,
int  i_dim,
int  global_idx 
)
997 {
998  int l_idx, l_base;
999  _XMP_array_info_t *ai = &a->info[i_dim];
1000  int off = ai->align_subscript;
1001  int tdim = ai->align_template_index;
1002  int lshadow = ai->shadow_size_lo;
1003 
1004  _XMP_template_t *template = a->align_template;
1005  _XMP_template_chunk_t *template_chunk = &(template->chunk[tdim]);
1006 
1007  int rank = template_chunk->onto_nodes_info->rank;
1008  long long *mapping_array = template_chunk->mapping_array;
1009 
1010  //_XMP_G2L(global_idx + off, &l_idx, a->align_template, tdim);
1011  //_XMP_G2L(ai->par_lower + off, &l_base, a->align_template, tdim);
1012  l_idx = global_idx + off - mapping_array[rank];
1013  l_base = ai->par_lower + off -mapping_array[rank];
1014 
1015  l_idx = l_idx - l_base + lshadow;
1016 
1017  return l_idx;
1018 }

◆ _XMP_setup_reduce_type()

void _XMP_setup_reduce_type ( MPI_Datatype *  mpi_datatype,
size_t *  datatype_size,
int  datatype 
)
13  {
14  switch (datatype) {
15  case _XMP_N_TYPE_BOOL:
16  //{ *mpi_datatype = MPI_C_BOOL; *datatype_size = sizeof(_Bool); break; }
17  { *mpi_datatype = MPI_LOGICAL; *datatype_size = sizeof(_Bool); break; }
18  case _XMP_N_TYPE_CHAR:
19  { *mpi_datatype = MPI_SIGNED_CHAR; *datatype_size = sizeof(char); break; }
21  { *mpi_datatype = MPI_UNSIGNED_CHAR; *datatype_size = sizeof(unsigned char); break; }
22  case _XMP_N_TYPE_SHORT:
23  { *mpi_datatype = MPI_SHORT; *datatype_size = sizeof(short); break; }
25  { *mpi_datatype = MPI_UNSIGNED_SHORT; *datatype_size = sizeof(unsigned short); break; }
26  case _XMP_N_TYPE_INT:
27  { *mpi_datatype = MPI_INT; *datatype_size = sizeof(int); break; }
29  { *mpi_datatype = MPI_UNSIGNED; *datatype_size = sizeof(unsigned int); break; }
30  case _XMP_N_TYPE_LONG:
31  { *mpi_datatype = MPI_LONG; *datatype_size = sizeof(long); break; }
33  { *mpi_datatype = MPI_UNSIGNED_LONG; *datatype_size = sizeof(unsigned long); break; }
35  { *mpi_datatype = MPI_LONG_LONG; *datatype_size = sizeof(long long); break; }
37  { *mpi_datatype = MPI_UNSIGNED_LONG_LONG; *datatype_size = sizeof(unsigned long long); break; }
38  case _XMP_N_TYPE_FLOAT:
39  { *mpi_datatype = MPI_FLOAT; *datatype_size = sizeof(float); break; }
40  case _XMP_N_TYPE_DOUBLE:
41  { *mpi_datatype = MPI_DOUBLE; *datatype_size = sizeof(double); break; }
43  { *mpi_datatype = MPI_LONG_DOUBLE; *datatype_size = sizeof(long double); break; }
44 #ifdef __STD_IEC_559_COMPLEX__
45  case _XMP_N_TYPE_FLOAT_IMAGINARY:
46  { *mpi_datatype = MPI_FLOAT; *datatype_size = sizeof(float _Imaginary); break; }
47  case _XMP_N_TYPE_DOUBLE_IMAGINARY:
48  { *mpi_datatype = MPI_DOUBLE; *datatype_size = sizeof(double _Imaginary); break; }
49  case _XMP_N_TYPE_LONG_DOUBLE_IMAGINARY:
50  { *mpi_datatype = MPI_LONG_DOUBLE; *datatype_size = sizeof(long double _Imaginary); break; }
51 #endif
52 
53 #if ((MPI_VERSION >= 3) || (MPI_VERSION == 2 && MPI_SUBVERSION >= 2))
55  { *mpi_datatype = MPI_C_FLOAT_COMPLEX; *datatype_size = sizeof(float _Complex); break; }
57  { *mpi_datatype = MPI_C_DOUBLE_COMPLEX; *datatype_size = sizeof(double _Complex); break; }
59  { *mpi_datatype = MPI_C_LONG_DOUBLE_COMPLEX; *datatype_size = sizeof(long double _Complex); break; }
60 #endif
61 
62  default:
63  _XMP_fatal("unknown data type for reduction");
64  }
65 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmp_dbg_printf()

void xmp_dbg_printf ( char *  fmt,
  ... 
)
38 {
39  char buf[512];
40  va_list args;
41 
42  va_start(args,fmt);
43  vsprintf(buf,fmt,args);
44  va_end(args);
45 
46  printf("[%d] %s",_XMP_world_rank, buf);
47  fflush(stdout);
48 }
_XMPC_running
int _XMPC_running
Definition: xmp_runtime.c:15
_XMP_array_info_type::align_subscript
long long align_subscript
Definition: xmp_data_struct.h:246
_XMP_array_type::array_nodes
_XMP_nodes_t * array_nodes
Definition: xmp_data_struct.h:306
_XMP_template_chunk_type::par_upper
long long par_upper
Definition: xmp_data_struct.h:81
_XMP_coarray_detach
void _XMP_coarray_detach(void **)
_XMP_nodes_info_type::size
int size
Definition: xmp_data_struct.h:32
_XMP_nodes_type::info
_XMP_nodes_info_t info[1]
Definition: xmp_data_struct.h:60
_XMP_nodes_info_type
Definition: xmp_data_struct.h:31
_XMP_create_temporary_nodes
_XMP_nodes_t * _XMP_create_temporary_nodes(_XMP_nodes_t *n)
Definition: xmp_nodes.c:257
_XMP_N_TYPE_BOOL
#define _XMP_N_TYPE_BOOL
Definition: xmp_constant.h:80
_XMP_N_TYPE_INT
#define _XMP_N_TYPE_INT
Definition: xmp_constant.h:85
_XMP_array_info_type::align_template_index
int align_template_index
Definition: xmp_data_struct.h:260
_XMP_alloc_tca
void _XMP_alloc_tca(_XMP_array_t *adesc)
Definition: xmp_tca_runtime.c:11
_XMP_template_info_type::ser_lower
long long ser_lower
Definition: xmp_data_struct.h:72
_XMP_create_nodes_by_template_ref
_XMP_nodes_t * _XMP_create_nodes_by_template_ref(_XMP_template_t *ref_template, int *shrink, long long *ref_lower, long long *ref_upper, long long *ref_stride)
Definition: xmp_template.c:459
_XMP_array_info_type::shadow_comm_rank
int shadow_comm_rank
Definition: xmp_data_struct.h:257
_XMP_nodes_type::is_member
int is_member
Definition: xmp_data_struct.h:46
_XMP_alloc
void * _XMP_alloc(size_t size)
Definition: xmp_util.c:21
_XMP_finalize_nodes
void _XMP_finalize_nodes(void *nodes)
_XMP_array_info_type
Definition: xmp_data_struct.h:194
_XMP_array_info_type::reflect_acc_sched
_XMP_reflect_sched_t * reflect_acc_sched
Definition: xmp_data_struct.h:253
_XMP_template_type::chunk
_XMP_template_chunk_t * chunk
Definition: xmp_data_struct.h:112
_XMP_array_type::align_comm_size
int align_comm_size
Definition: xmp_data_struct.h:301
_XMP_async_reflect_type::reqs
MPI_Request * reqs
Definition: xmp_data_struct.h:187
_XMP_N_TYPE_DOUBLE
#define _XMP_N_TYPE_DOUBLE
Definition: xmp_constant.h:92
_XMP_async_reflect_type::datatype
MPI_Datatype * datatype
Definition: xmp_data_struct.h:186
_XMP_array_info_type::ser_upper
int ser_upper
Definition: xmp_data_struct.h:200
_XMP_array_type::desc_kind
int desc_kind
Definition: xmp_data_struct.h:268
_XMP_coarray_malloc_image_info_n
void _XMP_coarray_malloc_image_info_n(const int *i, const int ndims)
Definition: xmp_coarray.c:275
_XMP_template_chunk_type::is_regular_chunk
_Bool is_regular_chunk
Definition: xmp_data_struct.h:89
_XMP_finalize_reflect_sched_acc
void _XMP_finalize_reflect_sched_acc(_XMP_reflect_sched_t *sched, _Bool free_buf)
Definition: xmp_reflect_acc.c:83
_XMP_setup_reduce_type
void _XMP_setup_reduce_type(MPI_Datatype *mpi_datatype, size_t *datatype_size, int datatype)
Definition: xmp_reduce.c:13
_XMP_template_chunk_type::par_lower
long long par_lower
Definition: xmp_data_struct.h:80
_XMP_N_TYPE_DOUBLE_COMPLEX
#define _XMP_N_TYPE_DOUBLE_COMPLEX
Definition: xmp_constant.h:102
MAX
#define MAX(a, b)
Definition: xmp_internal.h:16
_XMP_array_info_type::shadow_comm_size
int shadow_comm_size
Definition: xmp_data_struct.h:256
_XMP_world_nodes
void * _XMP_world_nodes
Definition: xmp_world.c:10
_XMP_array_info_type::shadow_type
int shadow_type
Definition: xmp_data_struct.h:248
_XMP_array_info_type::ser_size
int ser_size
Definition: xmp_data_struct.h:201
_XMP_N_TYPE_LONG_DOUBLE
#define _XMP_N_TYPE_LONG_DOUBLE
Definition: xmp_constant.h:93
_XMP_reflect_sched_type
Definition: xmp_data_struct.h:119
_XMP_coarray_attach
void _XMP_coarray_attach(void **, void *, const size_t)
_XMP_init_reflect_sched_acc
void _XMP_init_reflect_sched_acc(_XMP_reflect_sched_t *sched)
Definition: xmp_reflect_acc.c:74
_XMP_template_chunk_type::onto_nodes_info
_XMP_nodes_info_t * onto_nodes_info
Definition: xmp_data_struct.h:94
_XMP_template_info_type
Definition: xmp_data_struct.h:70
_XMP_N_TYPE_NONBASIC
#define _XMP_N_TYPE_NONBASIC
Definition: xmp_constant.h:104
_XMP_template_type::dim
int dim
Definition: xmp_data_struct.h:108
_XMP_finalize_comm
void _XMP_finalize_comm(void *comm)
_XMP_array_info_type::is_regular_chunk
_Bool is_regular_chunk
Definition: xmp_data_struct.h:196
_XMP_async_reflect_type::nreqs
int nreqs
Definition: xmp_data_struct.h:189
_XMP_array_info_type::dim_elmts
unsigned long long dim_elmts
Definition: xmp_data_struct.h:243
_XMP_calc_array_dim_elmts
void _XMP_calc_array_dim_elmts(_XMP_array_t *array, int array_index)
Definition: xmp_align.c:17
_XMP_world_rank
int _XMP_world_rank
Definition: xmp_world.c:9
_XMP_array_info_type::par_upper
int par_upper
Definition: xmp_data_struct.h:205
_XMP_array_type::is_shrunk_template
_Bool is_shrunk_template
Definition: xmp_data_struct.h:305
_XMP_N_TYPE_UNSIGNED_LONGLONG
#define _XMP_N_TYPE_UNSIGNED_LONGLONG
Definition: xmp_constant.h:90
_XMP_array_info_type::local_stride
int local_stride
Definition: xmp_data_struct.h:211
_XMP_finalize_reflect_sched
void _XMP_finalize_reflect_sched(_XMP_reflect_sched_t *sched, _Bool free_buf)
Definition: xmp_shadow.c:236
_XMP_array_info_type::temp0_v
int temp0_v
Definition: xmp_data_struct.h:240
_XMP_array_type::mpi_type
MPI_Datatype mpi_type
Definition: xmp_data_struct.h:275
_XMP_template_type::onto_nodes
_XMP_nodes_t * onto_nodes
Definition: xmp_data_struct.h:111
_XMP_array_type::align_comm
_XMP_comm_t * align_comm
Definition: xmp_data_struct.h:300
_XMP_array_info_type::shadow_size_lo
int shadow_size_lo
Definition: xmp_data_struct.h:249
_XMP_array_type::align_template
_XMP_template_t * align_template
Definition: xmp_data_struct.h:312
_XMP_N_TYPE_LONG
#define _XMP_N_TYPE_LONG
Definition: xmp_constant.h:87
_XMP_N_TYPE_SHORT
#define _XMP_N_TYPE_SHORT
Definition: xmp_constant.h:83
_XMP_N_TYPE_FLOAT_COMPLEX
#define _XMP_N_TYPE_FLOAT_COMPLEX
Definition: xmp_constant.h:101
_XMP_N_TYPE_FLOAT
#define _XMP_N_TYPE_FLOAT
Definition: xmp_constant.h:91
_XMP_N_TYPE_UNSIGNED_INT
#define _XMP_N_TYPE_UNSIGNED_INT
Definition: xmp_constant.h:86
_XMP_DESC_ARRAY
#define _XMP_DESC_ARRAY
Definition: xmp_constant.h:133
_XMP_array_info_type::align_manner
int align_manner
Definition: xmp_data_struct.h:197
_XMP_template_type
Definition: xmp_data_struct.h:98
_XMP_N_TYPE_UNSIGNED_LONG
#define _XMP_N_TYPE_UNSIGNED_LONG
Definition: xmp_constant.h:88
_XMP_array_type::total_elmts
unsigned long long total_elmts
Definition: xmp_data_struct.h:293
_XMP_array_type::align_comm_rank
int align_comm_rank
Definition: xmp_data_struct.h:302
_XMP_array_type::async_reflect
_XMP_async_reflect_t * async_reflect
Definition: xmp_data_struct.h:296
_XMP_array_info_type::ser_lower
int ser_lower
Definition: xmp_data_struct.h:199
_XMP_template_chunk_type
Definition: xmp_data_struct.h:78
_XMP_template_info_type::ser_upper
long long ser_upper
Definition: xmp_data_struct.h:73
_XMP_array_type::order
int order
Definition: xmp_data_struct.h:276
_XMP_array_info_type::local_lower
int local_lower
Definition: xmp_data_struct.h:209
_XMP_N_DIST_DUPLICATION
#define _XMP_N_DIST_DUPLICATION
Definition: xmp_constant.h:28
_XMP_array_info_type::shadow_size_hi
int shadow_size_hi
Definition: xmp_data_struct.h:250
_XMP_N_TYPE_UNSIGNED_SHORT
#define _XMP_N_TYPE_UNSIGNED_SHORT
Definition: xmp_constant.h:84
_XMP_array_type
Definition: xmp_data_struct.h:266
_XMP_N_TYPE_CHAR
#define _XMP_N_TYPE_CHAR
Definition: xmp_constant.h:81
_XMP_N_TYPE_UNSIGNED_CHAR
#define _XMP_N_TYPE_UNSIGNED_CHAR
Definition: xmp_constant.h:82
_XMP_N_NO_ALIGN_TEMPLATE
#define _XMP_N_NO_ALIGN_TEMPLATE
Definition: xmp_constant.h:23
_XMP_init_reflect_sched
void _XMP_init_reflect_sched(_XMP_reflect_sched_t *sched)
Definition: xmp_shadow.c:218
_XMP_template_chunk_type::par_stride
int par_stride
Definition: xmp_data_struct.h:85
_XMP_nodes_info_type::rank
int rank
Definition: xmp_data_struct.h:35
_XMP_N_INVALID_RANK
#define _XMP_N_INVALID_RANK
Definition: xmp_constant.h:21
_XMP_template_chunk_type::dist_manner
int dist_manner
Definition: xmp_data_struct.h:87
_XMP_array_type::type_size
size_t type_size
Definition: xmp_data_struct.h:274
_XMP_array_info_type::alloc_size
int alloc_size
Definition: xmp_data_struct.h:212
_XMP_N_ALIGN_CYCLIC
#define _XMP_N_ALIGN_CYCLIC
Definition: xmp_constant.h:38
_XMP_N_ALIGN_BLOCK
#define _XMP_N_ALIGN_BLOCK
Definition: xmp_constant.h:37
xmp_coarray
Definition: xmp_data_struct.h:328
_XMP_N_ALIGN_DUPLICATION
#define _XMP_N_ALIGN_DUPLICATION
Definition: xmp_constant.h:36
_XMP_array_type::info
_XMP_array_info_t info[1]
Definition: xmp_data_struct.h:313
_XMP_free
void _XMP_free(void *p)
Definition: xmp_util.c:37
_XMP_ASSERT
#define _XMP_ASSERT(_flag)
Definition: xmp_internal.h:34
_XMP_N_TYPE_LONG_DOUBLE_COMPLEX
#define _XMP_N_TYPE_LONG_DOUBLE_COMPLEX
Definition: xmp_constant.h:103
_XMP_N_ALIGN_NOT_ALIGNED
#define _XMP_N_ALIGN_NOT_ALIGNED
Definition: xmp_constant.h:35
_XMP_array_type::array_addr_p
void * array_addr_p
Definition: xmp_data_struct.h:279
_XMP_N_ALIGN_BLOCK_CYCLIC
#define _XMP_N_ALIGN_BLOCK_CYCLIC
Definition: xmp_constant.h:39
_XMP_array_info_type::par_stride
int par_stride
Definition: xmp_data_struct.h:206
_XMP_array_type::dim
int dim
Definition: xmp_data_struct.h:272
_XMP_fatal
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42
_XMP_array_info_type::acc
unsigned long long * acc
Definition: xmp_data_struct.h:262
_XMP_array_info_type::dim_acc
unsigned long long dim_acc
Definition: xmp_data_struct.h:242
_XMP_array_info_type::par_size
int par_size
Definition: xmp_data_struct.h:207
_XMP_array_info_type::reflect_sched
_XMP_reflect_sched_t * reflect_sched
Definition: xmp_data_struct.h:252
_XMP_template_chunk_type::par_width
unsigned long long par_width
Definition: xmp_data_struct.h:82
_XMP_N_TYPE_LONGLONG
#define _XMP_N_TYPE_LONGLONG
Definition: xmp_constant.h:89
_XMP_template_type::is_distributed
_Bool is_distributed
Definition: xmp_data_struct.h:105
_XMP_nodes_type::dim
int dim
Definition: xmp_data_struct.h:47
_XMP_nodes_type
Definition: xmp_data_struct.h:40
_XMP_modi_ll_i
int _XMP_modi_ll_i(long long value, int cycle)
Definition: xmp_math_function.c:9
_XMP_M_COUNT_TRIPLETi
#define _XMP_M_COUNT_TRIPLETi(l_, u_, s_)
Definition: xmp_gpu_func.hpp:25
_XMP_array_info_type::temp0
int * temp0
Definition: xmp_data_struct.h:239
_XMP_array_type::is_align_comm_member
_Bool is_align_comm_member
Definition: xmp_data_struct.h:271
_XMP_coarray_malloc_info_n
void _XMP_coarray_malloc_info_n(const long *n, const int ndims, const size_t elmt_size)
Set n-dim coarray information.
Definition: xmp_coarray.c:140
_XMP_N_SHADOW_NONE
#define _XMP_N_SHADOW_NONE
Definition: xmp_constant.h:64
_XMPF_running
int _XMPF_running
Definition: xmp_runtime.c:16
_XMP_array_type::type
int type
Definition: xmp_data_struct.h:273
_XMP_N_INT_TRUE
#define _XMP_N_INT_TRUE
Definition: xmp_constant.h:4
_XMP_N_ALIGN_GBLOCK
#define _XMP_N_ALIGN_GBLOCK
Definition: xmp_constant.h:40
_XMP_template_chunk_type::mapping_array
long long * mapping_array
Definition: xmp_data_struct.h:88
_XMP_array_type::is_allocated
_Bool is_allocated
Definition: xmp_data_struct.h:270
_XMP_array_info_type::shadow_comm
_XMP_comm_t * shadow_comm
Definition: xmp_data_struct.h:255
_XMP_get_execution_nodes
void * _XMP_get_execution_nodes(void)
Definition: xmp_nodes_stack.c:46
_XMP_array_info_type::par_lower
int par_lower
Definition: xmp_data_struct.h:204
_XMP_async_reflect_type
Definition: xmp_data_struct.h:181
_XMP_array_info_type::is_shadow_comm_member
_Bool is_shadow_comm_member
Definition: xmp_data_struct.h:195
_XMP_array_info_type::local_upper
int local_upper
Definition: xmp_data_struct.h:210