libxmp/libxmpf in Omni Compiler  1.3.4
xmp_internal.h File Reference
#include <mpi.h>
#include <stdio.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdint.h>
#include <string.h>
#include "xmp_data_struct.h"
Include dependency graph for xmp_internal.h:

Go to the source code of this file.

Data Structures

struct  _XMP_coarray_list_type
 

Macros

#define _XMP_INTERNAL
 
#define MIN(a, b)   ( (a)<(b) ? (a) : (b) )
 
#define MAX(a, b)   ( (a)>(b) ? (a) : (b) )
 
#define _XMP_ASSERT(_flag)
 
#define _XMP_RETURN_IF_SINGLE
 
#define _XMP_RETURN_IF_AFTER_FINALIZATION
 
#define _XMP_IS_SINGLE   (_XMP_world_size == 1)
 
#define _XMP_TSTART(t0)
 
#define _XMP_TEND(t, t0)
 
#define _XMP_TEND2(t, tt, t0)
 
#define XACC_DEBUG(...)   do{}while(0)
 

Typedefs

typedef struct _XMP_coarray_list_type _XMP_coarray_list_t
 

Functions

int xmp_get_ruuning ()
 
void _XMP_calc_array_dim_elmts (_XMP_array_t *array, int array_index)
 
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_init_array_nodes (_XMP_array_t *array)
 
void _XMP_init_array_comm (_XMP_array_t *array,...)
 
void _XMP_init_array_comm2 (_XMP_array_t *array, int args[])
 
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_dealloc_array (_XMP_array_t *array_desc)
 
void _XMP_normalize_array_section (_XMP_gmv_desc_t *gmv_desc, int idim, int *lower, int *upper, int *stride)
 
void _XMPC_pack_array (void *buffer, void *src, int array_type, size_t array_type_size, int array_dim, int *l, int *u, int *s, unsigned long long *d)
 
void _XMPC_unpack_array (void *dst, void *buffer, int array_type, size_t array_type_size, int array_dim, int *l, int *u, int *s, unsigned long long *d)
 
_XMP_async_comm_t_XMP_get_current_async ()
 
void _XMP_initialize_async_comm_tab ()
 
void _XMP_nodes_dealloc_after_wait_async (_XMP_nodes_t *n)
 
void xmpc_end_async (int)
 
void _XMP_barrier_NODES_ENTIRE (_XMP_nodes_t *nodes)
 
void _XMP_barrier_EXEC (void)
 
void _XMP_bcast_NODES_ENTIRE_OMITTED (_XMP_nodes_t *bcast_nodes, void *addr, int count, size_t datatype_size)
 
void _XMP_bcast_NODES_ENTIRE_NODES (_XMP_nodes_t *bcast_nodes, void *addr, int count, size_t datatype_size, _XMP_nodes_t *from_nodes,...)
 
void _XMP_bcast_NODES_ENTIRE_NODES_V (_XMP_nodes_t *bcast_nodes, void *addr, int count, size_t datatype_size, _XMP_nodes_t *from_nodes, va_list args)
 
void _XMP_initialize_onesided_functions ()
 
void _XMP_finalize_onesided_functions ()
 
void _XMP_build_sync_images_table ()
 Build table for sync images. More...
 
void _XMP_sync_images_EXEC (int *status)
 
void _XMP_build_coarray_queue ()
 Build queue for coarray. More...
 
void _XMP_coarray_lastly_deallocate ()
 Deallocate memory space and an object of the last coarray. More...
 
void _XMP_mpi_coarray_deallocate (_XMP_coarray_t *, bool is_acc)
 
size_t _XMP_calc_copy_chunk (const int, const _XMP_array_section_t *)
 
int _XMP_get_dim_of_allelmts (const int, const _XMP_array_section_t *)
 
void _XMP_local_put (_XMP_coarray_t *, const void *, const int, const int, const int, const int, const _XMP_array_section_t *, const _XMP_array_section_t *, const size_t, const size_t)
 
void _XMP_local_get (void *, const _XMP_coarray_t *, const int, const int, const int, const int, const _XMP_array_section_t *, const _XMP_array_section_t *, const size_t, const size_t)
 
void _XMP_L2G (int local_idx, long long int *global_idx, _XMP_template_t *template, int template_index)
 
void _XMP_G2L (long long int global_idx, int *local_idx, _XMP_template_t *template, int template_index)
 
void xmpf_transpose (void *dst_p, void *src_p, int opt)
 
void xmpf_matmul (void *x_p, void *a_p, void *b_p)
 
void xmpf_pack_mask (void *v_p, void *a_p, void *m_p)
 
void xmpf_pack_nomask (void *v_p, void *a_p)
 
void xmpf_pack (void *v_p, void *a_p, void *m_p)
 
void xmpf_unpack_mask (void *a_p, void *v_p, void *m_p)
 
void xmpf_unpack_nomask (void *a_p, void *v_p)
 
void xmpf_unpack (void *a_p, void *v_p, void *m_p)
 
void _XMP_gtol_array_ref_triplet (_XMP_array_t *array, int dim_index, int *lower, int *upper, int *stride)
 
int _XMP_calc_gmove_array_owner_linear_rank_SCALAR (_XMP_array_t *array, int *ref_index)
 
void _XMP_gmove_bcast_SCALAR (void *dst_addr, void *src_addr, size_t type_size, int root_rank)
 
unsigned long long _XMP_gmove_bcast_ARRAY (void *dst_addr, int dst_dim, int *dst_l, int *dst_u, int *dst_s, unsigned long long *dst_d, void *src_addr, int src_dim, int *src_l, int *src_u, int *src_s, unsigned long long *src_d, int type, size_t type_size, int root_rank)
 
int _XMP_check_gmove_array_ref_inclusion_SCALAR (_XMP_array_t *array, int array_index, int ref_index)
 
void _XMP_gmove_localcopy_ARRAY (int type, int type_size, void *dst_addr, int dst_dim, int *dst_l, int *dst_u, int *dst_s, unsigned long long *dst_d, void *src_addr, int src_dim, int *src_l, int *src_u, int *src_s, unsigned long long *src_d)
 
int _XMP_calc_global_index_HOMECOPY (_XMP_array_t *dst_array, int dst_dim_index, int *dst_l, int *dst_u, int *dst_s, int *src_l, int *src_u, int *src_s)
 
int _XMP_calc_global_index_BCAST (int dst_dim, int *dst_l, int *dst_u, int *dst_s, _XMP_array_t *src_array, int *src_array_nodes_ref, int *src_l, int *src_u, int *src_s)
 
void _XMP_gmove_array_array_common (_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int *dst_l, int *dst_u, int *dst_s, unsigned long long *dst_d, int *src_l, int *src_u, int *src_s, unsigned long long *src_d, int mode)
 
void _XMP_gmove_inout_scalar (void *scalar, _XMP_gmv_desc_t *gmv_desc, int rdma_type)
 
unsigned long long _XMP_gtol_calc_offset (_XMP_array_t *a, int g_idx[])
 
void _XMP_gmove_scalar_garray (void *scalar, _XMP_gmv_desc_t *gmv_desc_rightp, int mode)
 
void _XMP_gmove_garray_scalar (_XMP_gmv_desc_t *gmv_desc_leftp, void *scalar, int mode)
 
void _XMP_gmove_garray_garray (_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int mode)
 
void _XMP_gmove_garray_larray (_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int mode)
 
void _XMP_gmove_larray_garray (_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int mode)
 
int _XMP_sched_loop_template_width_1 (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, int template_lower, int template_upper, int template_stride)
 
int _XMP_sched_loop_template_width_N (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, int template_lower, int template_upper, int template_stride, int width, int template_ser_lower, int template_ser_upper)
 
void _XMP_sched_loop_template_DUPLICATION (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index)
 
void _XMP_sched_loop_template_BLOCK (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index)
 
void _XMP_sched_loop_template_CYCLIC (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index)
 
void _XMP_sched_loop_template_BLOCK_CYCLIC (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index)
 
void _XMP_sched_loop_template_GBLOCK (int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, _XMP_template_t *template, int template_index)
 
_XMP_nodes_t_XMP_create_temporary_nodes (_XMP_nodes_t *n)
 
_XMP_nodes_t_XMP_init_nodes_struct_GLOBAL (int dim, int *dim_size, int is_static)
 
_XMP_nodes_t_XMP_init_nodes_struct_EXEC (int dim, int *dim_size, int is_static)
 
_XMP_nodes_t_XMP_init_nodes_struct_NODES_NUMBER (int dim, int ref_lower, int ref_upper, int ref_stride, int *dim_size, int is_static)
 
_XMP_nodes_t_XMP_init_nodes_struct_NODES_NAMED (int dim, _XMP_nodes_t *ref_nodes, int *shrink, int *ref_lower, int *ref_upper, int *ref_stride, int *dim_size, int is_static)
 
void _XMP_finalize_nodes (_XMP_nodes_t *nodes)
 
_XMP_nodes_t_XMP_create_nodes_by_comm (int is_member, _XMP_comm_t *comm)
 
void _XMP_calc_rank_array (_XMP_nodes_t *n, int *rank_array, int linear_rank)
 
int _XMP_calc_linear_rank (_XMP_nodes_t *n, int *rank_array)
 
int _XMP_calc_linear_rank_on_target_nodes (_XMP_nodes_t *n, int *rank_array, _XMP_nodes_t *target_nodes)
 
_Bool _XMP_calc_coord_on_target_nodes2 (_XMP_nodes_t *n, int *ncoord, _XMP_nodes_t *target_n, int *target_ncoord)
 
_Bool _XMP_calc_coord_on_target_nodes (_XMP_nodes_t *n, int *ncoord, _XMP_nodes_t *target_n, int *target_ncoord)
 
_XMP_nodes_ref_t_XMP_init_nodes_ref (_XMP_nodes_t *n, int *rank_array)
 
void _XMP_finalize_nodes_ref (_XMP_nodes_ref_t *nodes_ref)
 
_XMP_nodes_ref_t_XMP_create_nodes_ref_for_target_nodes (_XMP_nodes_t *n, int *rank_array, _XMP_nodes_t *target_nodes)
 
void _XMP_translate_nodes_rank_array_to_ranks (_XMP_nodes_t *nodes, int *ranks, int *rank_array, int shrink_nodes_size)
 
int _XMP_get_next_rank (_XMP_nodes_t *nodes, int *rank_array)
 
int _XMP_calc_nodes_index_from_inherit_nodes_index (_XMP_nodes_t *nodes, int inherit_nodes_index)
 
void _XMP_push_nodes (_XMP_nodes_t *nodes)
 
void _XMP_pop_nodes (void)
 
void _XMP_pop_n_free_nodes (void)
 
void _XMP_pop_n_free_nodes_wo_finalize_comm (void)
 
_XMP_nodes_t_XMP_get_execution_nodes (void)
 
int _XMP_get_execution_nodes_rank (void)
 
void _XMP_push_comm (_XMP_comm_t *comm)
 
void _XMP_finalize_comm (_XMP_comm_t *comm)
 
void _XMP_pack_vector (char *restrict dst, char *restrict src, int count, int blocklength, long stride)
 
void _XMP_pack_vector2 (char *restrict dst, char *restrict src, int count, int blocklength, int nnodes, int type_size, int src_block_dim)
 
void _XMP_unpack_vector (char *restrict dst, char *restrict src, int count, int blocklength, long stride)
 
void _XMPF_unpack_transpose_vector (char *restrict dst, char *restrict src, int dst_stride, int src_stride, int type_size, int dst_block_dim)
 
void _XMP_check_reflect_type (void)
 
void _XMP_reduce_NODES_ENTIRE (_XMP_nodes_t *nodes, void *addr, int count, int datatype, int op)
 
void _XMPF_reduce_FLMM_NODES_ENTIRE (_XMP_nodes_t *nodes, void *addr, int count, int datatype, int op, int num_locs, void **loc_vars, int *loc_types)
 
void _XMP_reduce_CLAUSE (void *data_addr, int count, int datatype, int op)
 
void xmp_reduce_initialize ()
 
void _XMP_set_reflect__ (_XMP_array_t *a, int dim, int lwidth, int uwidth, int is_periodic)
 
void _XMP_reflect__ (_XMP_array_t *a)
 
void _XMP_wait_async__ (int async_id)
 
void _XMP_reflect_async__ (_XMP_array_t *a, int async_id)
 
void _XMP_reduce_shadow_wait (_XMP_array_t *a)
 
void _XMP_reduce_shadow_sum (_XMP_array_t *a)
 
void _XMP_init (int argc, char **argv, MPI_Comm comm)
 
void _XMP_finalize (bool isFinalize)
 
size_t _XMP_get_datatype_size (int datatype)
 
void print_rsd (_XMP_rsd_t *rsd)
 
void print_bsd (_XMP_bsd_t *bsd)
 
void print_csd (_XMP_csd_t *csd)
 
void print_comm_set (_XMP_comm_set_t *comm_set0)
 
_XMP_rsd_tintersection_rsds (_XMP_rsd_t *_rsd1, _XMP_rsd_t *_rsd2)
 
_XMP_csd_tintersection_csds (_XMP_csd_t *csd1, _XMP_csd_t *csd2)
 
_XMP_csd_talloc_csd (int n)
 
void free_csd (_XMP_csd_t *csd)
 
_XMP_csd_tcopy_csd (_XMP_csd_t *csd)
 
int get_csd_size (_XMP_csd_t *csd)
 
void free_comm_set (_XMP_comm_set_t *comm_set)
 
_XMP_csd_trsd2csd (_XMP_rsd_t *rsd)
 
_XMP_csd_tbsd2csd (_XMP_bsd_t *bsd)
 
_XMP_comm_set_tcsd2comm_set (_XMP_csd_t *csd)
 
void reduce_csd (_XMP_csd_t *csd[_XMP_N_MAX_DIM], int ndims)
 
void _XMP_create_shadow_comm (_XMP_array_t *array, int array_index)
 
void _XMP_reflect_shadow_FULL (void *array_addr, _XMP_array_t *array_desc, int array_index)
 
void _XMP_init_reflect_sched (_XMP_reflect_sched_t *sched)
 
void _XMP_finalize_reflect_sched (_XMP_reflect_sched_t *sched, _Bool free_buf)
 
void _XMP_init_shadow (_XMP_array_t *array,...)
 
void _XMP_sort (_XMP_array_t *a_desc, _XMP_array_t *b_desc, int is_up)
 
int xmpc_ltog (int local_idx, _XMP_template_t *template, int template_index, int offset)
 
_XMP_template_t_XMP_create_template_desc (int dim, _Bool is_fixed)
 
int _XMP_check_template_ref_inclusion (int ref_lower, int ref_upper, int ref_stride, _XMP_template_t *t, int index)
 
void _XMP_init_template_FIXED (_XMP_template_t **template, int dim,...)
 
_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)
 
void _XMP_calc_template_size (_XMP_template_t *t)
 
void _XMP_init_template_chunk (_XMP_template_t *template, _XMP_nodes_t *nodes)
 
void _XMP_finalize_template (_XMP_template_t *template)
 
int _XMP_calc_template_owner_SCALAR (_XMP_template_t *ref_template, int dim_index, long long ref_index)
 
int _XMP_calc_template_par_triplet (_XMP_template_t *template, int template_index, int nodes_rank, int *template_lower, int *template_upper, int *template_stride)
 
void _XMP_dist_template_DUPLICATION (_XMP_template_t *template, int template_index)
 
void _XMP_dist_template_BLOCK (_XMP_template_t *template, int template_index, int nodes_index)
 
void _XMP_dist_template_CYCLIC (_XMP_template_t *template, int template_index, int nodes_index)
 
void _XMP_dist_template_BLOCK_CYCLIC (_XMP_template_t *template, int template_index, int nodes_index, unsigned long long width)
 
void _XMP_dist_template_GBLOCK (_XMP_template_t *template, int template_index, int nodes_index, int *mapping_array, int *temp0)
 
unsigned long long _XMP_get_on_ref_id (void)
 
void * _XMP_alloc (size_t size)
 
void _XMP_free (void *p)
 
void _XMP_fatal (char *msg)
 
void _XMP_fatal_nomsg ()
 
void _XMP_unexpected_error (void)
 
void _XMP_warning (char *msg)
 
void _XMP_init_world (int *argc, char ***argv)
 
void _XMP_finalize_world (bool)
 
int _XMP_split_world_by_color (int color)
 
_Bool xmp_is_async ()
 
void _XMP_threads_init (void)
 
void _XMP_threads_finalize (void)
 

Variables

int _XMPC_running
 
int _XMPF_running
 
void(* _xmp_pack_array )(void *buffer, void *src, int array_type, size_t array_type_size, int array_dim, int *l, int *u, int *s, unsigned long long *d)
 
void(* _xmp_unpack_array )(void *dst, void *buffer, int array_type, size_t array_type_size, int array_dim, int *l, int *u, int *s, unsigned long long *d)
 
_XMP_coarray_list_t_XMP_coarray_list_head
 
_XMP_coarray_list_t_XMP_coarray_list_tail
 
int _XMP_world_size
 
int _XMP_world_rank
 
void * _XMP_world_nodes
 

Macro Definition Documentation

◆ _XMP_ASSERT

#define _XMP_ASSERT (   _flag)

◆ _XMP_INTERNAL

#define _XMP_INTERNAL

◆ _XMP_IS_SINGLE

#define _XMP_IS_SINGLE   (_XMP_world_size == 1)

◆ _XMP_RETURN_IF_AFTER_FINALIZATION

#define _XMP_RETURN_IF_AFTER_FINALIZATION
Value:
{ \
if (! xmp_get_ruuning()) return; \
}

◆ _XMP_RETURN_IF_SINGLE

#define _XMP_RETURN_IF_SINGLE
Value:
{ \
if (_XMP_world_size == 1) { \
return; \
} \
}

◆ _XMP_TEND

#define _XMP_TEND (   t,
  t0 
)

◆ _XMP_TEND2

#define _XMP_TEND2 (   t,
  tt,
  t0 
)

◆ _XMP_TSTART

#define _XMP_TSTART (   t0)

◆ MAX

#define MAX (   a,
 
)    ( (a)>(b) ? (a) : (b) )

◆ MIN

#define MIN (   a,
 
)    ( (a)<(b) ? (a) : (b) )

◆ XACC_DEBUG

#define XACC_DEBUG (   ...)    do{}while(0)

Typedef Documentation

◆ _XMP_coarray_list_t

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_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()

void* _XMP_alloc ( size_t  size)
22 {
23  void *addr;
24 #ifdef _XMP_FJRDMA
25  int error = posix_memalign(&addr, 128, size);
26  if(addr == NULL || error != 0)
27  _XMP_fatal("cannot allocate memory");
28 #else
29  addr = malloc(size);
30  if(addr == NULL)
31  _XMP_fatal("cannot allocate memory");
32 #endif
33 
34  return addr;
35 }
Here is the call graph for this function:

◆ _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_barrier_EXEC()

void _XMP_barrier_EXEC ( void  )
16  {
19 
20  MPI_Barrier(*((MPI_Comm *)(_XMP_get_execution_nodes())->comm));
21 }
Here is the call graph for this function:

◆ _XMP_barrier_NODES_ENTIRE()

void _XMP_barrier_NODES_ENTIRE ( _XMP_nodes_t nodes)
8  {
10 
11  if (nodes->is_member) {
12  MPI_Barrier(*((MPI_Comm *)nodes->comm));
13  }
14 }

◆ _XMP_bcast_NODES_ENTIRE_NODES()

void _XMP_bcast_NODES_ENTIRE_NODES ( _XMP_nodes_t bcast_nodes,
void *  addr,
int  count,
size_t  datatype_size,
_XMP_nodes_t from_nodes,
  ... 
)
60  {
61  va_list args;
62  va_start(args, from_nodes);
63 
64  _XMP_bcast_NODES_ENTIRE_NODES_V(bcast_nodes, addr, count, datatype_size, from_nodes, args);
65 
66  va_end(args);
67 }
Here is the call graph for this function:

◆ _XMP_bcast_NODES_ENTIRE_NODES_V()

void _XMP_bcast_NODES_ENTIRE_NODES_V ( _XMP_nodes_t bcast_nodes,
void *  addr,
int  count,
size_t  datatype_size,
_XMP_nodes_t from_nodes,
va_list  args 
)
70  {
72 
73  if (!bcast_nodes->is_member) {
74  return;
75  }
76 
77  if (!from_nodes->is_member) {
78  _XMP_fatal("broadcast failed, cannot find the source node");
79  }
80 
81  // calc source nodes number
82  int root = 0;
83  int acc_nodes_size = 1;
84  int from_dim = from_nodes->dim;
85  int from_lower, from_upper, from_stride;
86  _XMP_nodes_inherit_info_t *inherit_info = bcast_nodes->inherit_info;
87 
88  if(inherit_info == NULL){
89  for (int i = 0; i < from_dim; i++) {
90  int size = from_nodes->info[i].size;
91  if(inherit_info != NULL){
92  if(inherit_info[i].shrink == true)
93  continue;
94  size = inherit_info[i].upper - inherit_info[i].lower + 1;
95  if(size == 0) continue;
96  }
97  int rank = from_nodes->info[i].rank;
98 
99  if (va_arg(args, int) == 1) {
100  root += (acc_nodes_size * rank);
101  }
102  else {
103  from_lower = va_arg(args, int) - 1;
104  from_upper = va_arg(args, int) - 1;
105  from_stride = va_arg(args, int);
106 
107  // check <from-ref>
108  if (_XMP_M_COUNT_TRIPLETi(from_lower, from_upper, from_stride) != 1) {
109  _XMP_fatal("multiple source nodes indicated in bcast directive");
110  }
111 
112  root += (acc_nodes_size * (from_lower));
113  }
114 
115  acc_nodes_size *= size;
116  }
117  }
118  else{
119  int inherit_node_dim = bcast_nodes->inherit_nodes->dim;
120 
121  for (int i = 0; i < inherit_node_dim; i++) {
122 
123  if(inherit_info[i].shrink) // skip i
124  continue;
125 
126  int size = inherit_info[i].upper - inherit_info[i].lower + 1;
127 
128  if(size == 0) { // skip arguments
129  va_arg(args, int); // is_astrisk
130  va_arg(args, int); // from_lower
131  va_arg(args, int); // from_upper
132  va_arg(args, int); // from_stride
133  continue;
134  }
135 
136  int is_astrisk = va_arg(args, int);
137  if (is_astrisk == 1){
138  int rank = from_nodes->info[i].rank;
139  root += (acc_nodes_size * rank);
140  }
141  else {
142  from_lower = va_arg(args, int) - 1;
143  from_upper = va_arg(args, int) - 1;
144  va_arg(args, int); // skip from_stride
145 
146  // check <from-ref>
147  if(from_lower != from_upper)
148  _XMP_fatal("multiple source nodes indicated in bcast directive");
149 
150  root += (acc_nodes_size * (from_lower - inherit_info[i].lower));
151  }
152 
153  acc_nodes_size *= size;
154  }
155  }
156 
157 #ifdef _XMP_MPI3
158  if(xmp_is_async()){
160  MPI_Ibcast(addr, count*datatype_size, MPI_BYTE, root,
161  *((MPI_Comm *)bcast_nodes->comm), &async->reqs[async->nreqs]);
162  async->nreqs++;
163  }
164  else
165 #endif
166  MPI_Bcast(addr, count*datatype_size, MPI_BYTE, root,
167  *((MPI_Comm *)bcast_nodes->comm));
168 
169  /* // setup type */
170  /* MPI_Datatype mpi_datatype; */
171  /* MPI_Type_contiguous(datatype_size, MPI_BYTE, &mpi_datatype); */
172  /* MPI_Type_commit(&mpi_datatype); */
173 
174  /* // bcast */
175  /* MPI_Bcast(addr, count, mpi_datatype, root, *((MPI_Comm *)bcast_nodes->comm)); */
176 
177  /* MPI_Type_free(&mpi_datatype); */
178 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_bcast_NODES_ENTIRE_OMITTED()

void _XMP_bcast_NODES_ENTIRE_OMITTED ( _XMP_nodes_t bcast_nodes,
void *  addr,
int  count,
size_t  datatype_size 
)
12  {
14 
15  if(!bcast_nodes->is_member) return;
16 
17 #ifdef _XMP_MPI3
18  if(xmp_is_async()){
20  MPI_Ibcast(addr, count*datatype_size, MPI_BYTE, _XMP_N_DEFAULT_ROOT_RANK,
21  *((MPI_Comm *)bcast_nodes->comm), &async->reqs[async->nreqs]);
22  async->nreqs++;
23  }
24  else
25 #endif
26  MPI_Bcast(addr, count*datatype_size, MPI_BYTE, _XMP_N_DEFAULT_ROOT_RANK,
27  *((MPI_Comm *)bcast_nodes->comm));
28 }
Here is the call graph for this function:

◆ _XMP_build_coarray_queue()

void _XMP_build_coarray_queue ( )

Build queue for coarray.

1575 {
1576  _coarray_queue.max_size = _XMP_COARRAY_QUEUE_INITIAL_SIZE;
1577  _coarray_queue.num = 0;
1578  _coarray_queue.coarrays = malloc(sizeof(_XMP_coarray_t*) * _coarray_queue.max_size);
1579 }
Here is the caller graph for this function:

◆ _XMP_build_sync_images_table()

void _XMP_build_sync_images_table ( )

Build table for sync images.

1559 {
1560 #ifdef _XMP_GASNET
1562 #elif _XMP_FJRDMA
1564 #elif _XMP_UTOFU
1566 #elif _XMP_MPI3_ONESIDED
1568 #endif
1569 }
Here is the call graph for this function:
Here is the caller 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_calc_coord_on_target_nodes()

_Bool _XMP_calc_coord_on_target_nodes ( _XMP_nodes_t n,
int *  ncoord,
_XMP_nodes_t target_n,
int *  target_ncoord 
)
1152 {
1153  if(_XMP_calc_coord_on_target_nodes2(n, ncoord, target_n, target_ncoord))
1154  return true;
1155 
1156  _XMP_nodes_t *p = n->inherit_nodes;
1157  if (p){
1158  int pcoord[_XMP_N_MAX_DIM];
1159  int rank = _XMP_calc_linear_rank(n, ncoord);
1160  //_XMP_calc_rank_array(p, pcoord, rank);
1161 
1162  _XMP_nodes_inherit_info_t *inherit_info = n->inherit_info;
1163  int multiplier[_XMP_N_MAX_DIM];
1164 
1165  int dim = p->dim;
1166  multiplier[0] = 1;
1167  for(int i=1;i<dim;i++)
1168  multiplier[i] = multiplier[i-1] * inherit_info[i].size;
1169 
1170  int j = rank;
1171  for (int i=dim;i>= 0;i--){
1172  if(inherit_info[i].shrink){
1173  pcoord[i] = p->info[i].rank;
1174  }
1175  else{
1176  int rank_dim = j / multiplier[i];
1177  pcoord[i] = inherit_info[i].stride * rank_dim + inherit_info[i].lower;
1178  j = j % multiplier[i];
1179  }
1180  }
1181 
1182  if(_XMP_calc_coord_on_target_nodes(p, pcoord, target_n, target_ncoord))
1183  return true;
1184  }
1185 
1186  return false;
1187 }
Here is the call graph for this function:

◆ _XMP_calc_coord_on_target_nodes2()

_Bool _XMP_calc_coord_on_target_nodes2 ( _XMP_nodes_t n,
int *  ncoord,
_XMP_nodes_t target_n,
int *  target_ncoord 
)
1092 {
1093  if (n == target_n){
1094  //printf("%d, %d\n", n->dim, target_n->dim);
1095  memcpy(target_ncoord, ncoord, sizeof(int) * n->dim);
1096  return true;
1097  }
1098  else if (n->attr == _XMP_ENTIRE_NODES && target_n->attr == _XMP_ENTIRE_NODES){
1099  int rank = _XMP_calc_linear_rank(n, ncoord);
1100  _XMP_calc_rank_array(target_n, target_ncoord, rank);
1101  //xmp_dbg_printf("ncoord = %d, target_ncoord = %d\n", ncoord[0], target_ncoord[0]);
1102  return true;
1103  }
1104 
1105  _XMP_nodes_t *target_p = target_n->inherit_nodes;
1106  if (target_p){
1107  int target_pcoord[_XMP_N_MAX_DIM];
1108  if (_XMP_calc_coord_on_target_nodes2(n, ncoord, target_p, target_pcoord)){
1109  //int target_prank = _XMP_calc_linear_rank(target_p, target_pcoord);
1110  /* printf("dim = %d, m0 = %d, m1 = %d\n", */
1111  /* target_n->dim, target_n->info[0].multiplier, target_n->info[1].multiplier); */
1112  //_XMP_calc_rank_array(target_n, target_ncoord, target_prank);
1113 
1114  _XMP_nodes_inherit_info_t *inherit_info = target_n->inherit_info;
1115  int target_rank = 0;
1116  int multiplier = 1;
1117 
1118  for (int i = 0; i < target_p->dim; i++){
1119 
1120  if (inherit_info[i].shrink){
1121  ;
1122  }
1123  else if (target_pcoord[i] < inherit_info[i].lower || target_pcoord[i] > inherit_info[i].upper){
1124  for (int i = 0; i < target_n->dim; i++){
1125  target_ncoord[i] = -1;
1126  }
1127  return true;
1128  }
1129  else {
1130  int target_rank_dim = (target_pcoord[i] - inherit_info[i].lower) / inherit_info[i].stride;
1131  target_rank += multiplier * target_rank_dim;
1132  //multiplier *= inherit_info[i].size;
1133  multiplier *= _XMP_M_COUNT_TRIPLETi(inherit_info[i].lower, inherit_info[i].upper, inherit_info[i].stride);
1134  }
1135  }
1136 
1137  _XMP_calc_rank_array(target_n, target_ncoord, target_rank);
1138 
1139  return true;
1140  }
1141  }
1142 
1143  return false;
1144 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_calc_copy_chunk()

size_t _XMP_calc_copy_chunk ( const int  ,
const _XMP_array_section_t  
)
23 {
24  if(copy_chunk_dim == 0) // All elements are copied
25  return array[0].length * array[0].distance;
26 
27  if(array[copy_chunk_dim-1].stride == 1)
28  return array[copy_chunk_dim-1].length * array[copy_chunk_dim-1].distance;
29  else
30  return array[copy_chunk_dim-1].distance;
31 }
Here is the caller graph for this function:

◆ _XMP_calc_global_index_BCAST()

int _XMP_calc_global_index_BCAST ( int  dst_dim,
int *  dst_l,
int *  dst_u,
int *  dst_s,
_XMP_array_t src_array,
int *  src_array_nodes_ref,
int *  src_l,
int *  src_u,
int *  src_s 
)
420  {
421  _XMP_template_t *template = src_array->align_template;
422 
423  int dst_dim_index = 0;
424  int array_dim = src_array->dim;
425  for (int i = 0; i < array_dim; i++) {
426  if (_XMP_M_COUNT_TRIPLETi(src_l[i], src_u[i], src_s[i]) == 1) {
427  continue;
428  }
429 
430  int template_index = src_array->info[i].align_template_index;
431  if (template_index == _XMP_N_NO_ALIGN_TEMPLATE) {
432  do {
433  if (_XMP_M_COUNT_TRIPLETi(dst_l[dst_dim_index], dst_u[dst_dim_index], dst_s[dst_dim_index]) != 1) {
434  dst_dim_index++;
435  break;
436  } else if (dst_dim_index < dst_dim) {
437  dst_dim_index++;
438  } else {
439  _XMP_fatal("wrong assign statement for gmove");
440  }
441  } while (1);
442  } else {
443  int onto_nodes_index = template->chunk[template_index].onto_nodes_index;
444  _XMP_ASSERT(onto_nodes_index != _XMP_N_NO_ONTO_NODES);
445 
446  int array_nodes_index = _XMP_calc_nodes_index_from_inherit_nodes_index(src_array->array_nodes, onto_nodes_index);
447  int rank = src_array_nodes_ref[array_nodes_index];
448 
449  // calc template info
450  int template_lower, template_upper, template_stride;
451  if (!_XMP_calc_template_par_triplet(template, template_index, rank, &template_lower, &template_upper, &template_stride)) {
452  return _XMP_N_INT_FALSE;
453  }
454 
455  do {
456  if (_XMP_M_COUNT_TRIPLETi(dst_l[dst_dim_index], dst_u[dst_dim_index], dst_s[dst_dim_index]) != 1) {
457  if (_XMP_sched_gmove_triplet(template_lower, template_upper, template_stride,
458  src_array, i,
459  &(src_l[i]), &(src_u[i]), &(src_s[i]),
460  &(dst_l[dst_dim_index]), &(dst_u[dst_dim_index]), &(dst_s[dst_dim_index]))) {
461  dst_dim_index++;
462  break;
463  } else {
464  return _XMP_N_INT_FALSE;
465  }
466  } else if (dst_dim_index < dst_dim) {
467  dst_dim_index++;
468  } else {
469  _XMP_fatal("wrong assign statement for gmove");
470  }
471  } while (1);
472  }
473  }
474 
475  return _XMP_N_INT_TRUE;
476 }
Here is the call graph for this function:

◆ _XMP_calc_global_index_HOMECOPY()

int _XMP_calc_global_index_HOMECOPY ( _XMP_array_t dst_array,
int  dst_dim_index,
int *  dst_l,
int *  dst_u,
int *  dst_s,
int *  src_l,
int *  src_u,
int *  src_s 
)
406  {
407  int align_template_index = dst_array->info[dst_dim_index].align_template_index;
408  if (align_template_index != _XMP_N_NO_ALIGN_TEMPLATE) {
409  _XMP_template_chunk_t *tc = &((dst_array->align_template)->chunk[align_template_index]);
410  return _XMP_sched_gmove_triplet(tc->par_lower, tc->par_upper, tc->par_stride,
411  dst_array, dst_dim_index,
412  dst_l, dst_u, dst_s,
413  src_l, src_u, src_s);
414  } else {
415  return _XMP_N_INT_TRUE;
416  }
417 }
Here is the caller graph for this function:

◆ _XMP_calc_gmove_array_owner_linear_rank_SCALAR()

int _XMP_calc_gmove_array_owner_linear_rank_SCALAR ( _XMP_array_t array,
int *  ref_index 
)
216  {
217  _XMP_nodes_t *array_nodes = array->array_nodes;
218  int array_nodes_dim = array_nodes->dim;
219  int rank_array[array_nodes_dim];
220 
221  _XMP_calc_gmove_rank_array_SCALAR(array, ref_index, rank_array);
222 
223  return _XMP_calc_linear_rank_on_target_nodes(array_nodes, rank_array, _XMP_get_execution_nodes());
224 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_calc_linear_rank()

int _XMP_calc_linear_rank ( _XMP_nodes_t n,
int *  rank_array 
)
1036 {
1037  int acc_rank = 0;
1038  int acc_nodes_size = 1;
1039  int nodes_dim = n->dim;
1040 
1041  for(int i=0;i<nodes_dim;i++){
1042  acc_rank += (rank_array[i]) * acc_nodes_size;
1043  acc_nodes_size *= n->info[i].size;
1044  }
1045 
1046  return acc_rank;
1047 }
Here is the caller graph for this function:

◆ _XMP_calc_linear_rank_on_target_nodes()

int _XMP_calc_linear_rank_on_target_nodes ( _XMP_nodes_t n,
int *  rank_array,
_XMP_nodes_t target_nodes 
)
1050 {
1051  if(_XMP_compare_nodes(n, target_nodes)){
1052  return _XMP_calc_linear_rank(n, rank_array);
1053  }
1054  else{
1055  _XMP_nodes_t *inherit_nodes = n->inherit_nodes;
1056  if(inherit_nodes == NULL){
1057  // FIXME implement
1058  _XMP_fatal("unsupported case: gmove");
1059  return _XMP_N_INVALID_RANK; // XXX dummy;
1060  }
1061  else{
1062  int inherit_nodes_dim = inherit_nodes->dim;
1063  int *new_rank_array = _XMP_alloc(sizeof(int) * inherit_nodes_dim);
1064  _XMP_nodes_inherit_info_t *inherit_info = n->inherit_info;
1065 
1066  int j = 0;
1067  for(int i=0;i<inherit_nodes_dim;i++){
1068  if(inherit_info[i].shrink){
1069  // FIXME how implement ???
1070  new_rank_array[i] = 0;
1071  }
1072  else{
1073  new_rank_array[i] = ((inherit_info[i].stride) * rank_array[j]) + (inherit_info[i].lower);
1074  j++;
1075  }
1076  }
1077 
1078  int ret = _XMP_calc_linear_rank_on_target_nodes(inherit_nodes, new_rank_array, target_nodes);
1079  _XMP_free(new_rank_array);
1080  return ret;
1081  }
1082  }
1083 }
Here is the caller graph for this function:

◆ _XMP_calc_nodes_index_from_inherit_nodes_index()

int _XMP_calc_nodes_index_from_inherit_nodes_index ( _XMP_nodes_t nodes,
int  inherit_nodes_index 
)
1310 {
1311  _XMP_nodes_t *inherit_nodes = nodes->inherit_nodes;
1312  if(inherit_nodes == NULL)
1313  _XMP_fatal("inherit nodes is NULL");
1314 
1315  int nodes_index = 0;
1316  int inherit_nodes_index_count = 0;
1317  int inherit_nodes_dim = inherit_nodes->dim;
1318  for(int i=0;i<inherit_nodes_dim;i++,inherit_nodes_index_count++){
1319  if(inherit_nodes_index_count == inherit_nodes_index){
1320  return nodes_index;
1321  }
1322  else{
1323  if(!nodes->inherit_info[i].shrink)
1324  nodes_index++;
1325  }
1326  }
1327 
1328  _XMP_fatal("the function does not reach here");
1329  return 0;
1330 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_calc_rank_array()

void _XMP_calc_rank_array ( _XMP_nodes_t n,
int *  rank_array,
int  linear_rank 
)
1027 {
1028  int j = linear_rank;
1029  for(int i=n->dim-1;i>=0;i--){
1030  rank_array[i] = j / n->info[i].multiplier;
1031  j = j % n->info[i].multiplier;
1032  }
1033 }
Here is the caller graph for this function:

◆ _XMP_calc_template_owner_SCALAR()

int _XMP_calc_template_owner_SCALAR ( _XMP_template_t ref_template,
int  dim_index,
long long  ref_index 
)
632  {
633  _XMP_ASSERT(template->is_fixed);
634  _XMP_ASSERT(template->is_distributed);
635 
636  _XMP_template_info_t *info = &(template->info[dim_index]);
637  _XMP_template_chunk_t *chunk = &(template->chunk[dim_index]);
639 
640  switch (chunk->dist_manner) {
641  case _XMP_N_DIST_BLOCK:
642  return (ref_index - (info->ser_lower)) / (chunk->par_chunk_width);
643  case _XMP_N_DIST_CYCLIC:
644  return (ref_index - (info->ser_lower)) % (chunk->par_stride);
646  {
647  int width = chunk->par_width;
648  return ((ref_index - (info->ser_lower)) / width) % ((chunk->par_stride) / width);
649  }
650  case _XMP_N_DIST_GBLOCK:
651  {
652  long long *m = chunk->mapping_array;
653  int np = chunk->onto_nodes_info->size;
654  for (int i = 0; i < np; i++){
655  if (m[i] <= ref_index && ref_index < m[i+1]){
656  return i;
657  }
658  }
659  }
660  return _XMP_N_INVALID_RANK;
661  default:
662  _XMP_fatal("unknown distribute manner");
663  return _XMP_N_INVALID_RANK; // XXX dummy
664  }
665 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_calc_template_par_triplet()

int _XMP_calc_template_par_triplet ( _XMP_template_t template,
int  template_index,
int  nodes_rank,
int *  template_lower,
int *  template_upper,
int *  template_stride 
)
668  {
669  _XMP_ASSERT(template->is_distributed);
670 
671  int par_lower = 0, par_upper = 0, par_stride = 0;
672 
673  _XMP_template_info_t *ti = &(template->info[template_index]);
674  int ser_lower = ti->ser_lower;
675  int ser_upper = ti->ser_upper;
676  int ser_size = ti->ser_size;
677 
678  _XMP_template_chunk_t *tc = &(template->chunk[template_index]);
679  int par_width = tc->par_width;
680  int par_chunk_width = tc->par_chunk_width;
681 
682  switch (tc->dist_manner) {
684  {
685  par_lower = ser_lower;
686  par_upper = ser_upper;
687 
688  par_stride = 1;
689  } break;
690  case _XMP_N_DIST_BLOCK:
691  {
692  par_lower = nodes_rank * par_chunk_width + ser_lower;
693  int owner_nodes_size = _XMP_M_CEILi(ser_size, par_chunk_width);
694  if (nodes_rank == (owner_nodes_size - 1)) {
695  par_upper = ser_upper;
696  } else if (nodes_rank >= owner_nodes_size) {
697  return _XMP_N_INT_FALSE;
698  } else {
699  par_upper = par_lower + par_chunk_width - 1;
700  }
701 
702  par_stride = 1;
703  } break;
704  case _XMP_N_DIST_CYCLIC:
706  {
709 
710  int nodes_size = ni->size;
711  int template_size = _XMP_M_CEILi(ser_size, par_width);
712 
713  if (template_size < nodes_size) {
714  if (nodes_rank < template_size) {
715  int par_index = ser_lower + (nodes_rank * par_width);
716 
717  par_lower = par_index;
718  par_upper = par_index;
719  } else {
720  return _XMP_N_INT_FALSE;
721  }
722  } else {
723  int div = template_size / nodes_size;
724  int mod = template_size % nodes_size;
725  int par_size = 0;
726  if(mod == 0) {
727  par_size = div;
728  } else {
729  if(nodes_rank >= mod) {
730  par_size = div;
731  } else {
732  par_size = div + 1;
733  }
734  }
735 
736  par_lower = ser_lower + (nodes_rank * par_width);
737  par_upper = par_lower + (nodes_size * (par_size - 1) * par_width);
738  }
739 
740  par_stride = nodes_size * par_width;
741  } break;
742  default:
743  _XMP_fatal("unknown distribution manner");
744  }
745 
746  // return triplet
747  *template_lower = par_lower;
748  *template_upper = par_upper;
749  *template_stride = par_stride;
750 
751  return _XMP_N_INT_TRUE;
752 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_calc_template_size()

void _XMP_calc_template_size ( _XMP_template_t t)
31 {
32  int dim;
33  if(t->is_fixed){
34  dim = t->dim;
35  }
36  else{
37  dim = t->dim-1;
38  }
39 
40  for(int i=0;i<dim;i++){
41  int ser_lower = t->info[i].ser_lower;
42  int ser_upper = t->info[i].ser_upper;
43 
44  if(ser_lower > ser_upper)
45  _XMP_fatal("the lower bound of template should be less than or equal to the upper bound");
46 
47  t->info[i].ser_size = _XMP_M_COUNTi(ser_lower, ser_upper);
48  }
49 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_check_gmove_array_ref_inclusion_SCALAR()

int _XMP_check_gmove_array_ref_inclusion_SCALAR ( _XMP_array_t array,
int  array_index,
int  ref_index 
)
309  {
310  _XMP_ASSERT(!(array->align_template)->is_owner);
311 
312  _XMP_array_info_t *ai = &(array->info[array_index]);
314  return _XMP_N_INT_TRUE;
315  } else {
316  int template_ref_index = ref_index + ai->align_subscript;
317  return _XMP_check_template_ref_inclusion(template_ref_index, template_ref_index, 1,
319  }
320 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_check_reflect_type()

void _XMP_check_reflect_type ( void  )
301 {
302  char *reflect_type = getenv("XMP_REFLECT_TYPE");
303  _xmp_omp_num_procs = omp_get_num_procs();
304 
305  if (reflect_type){
306 
307  if (strcmp(reflect_type, "REFLECT_NOPACK") == 0){
309  //xmpf_dbg_printf("REFLECT_NOPACK\n");
310  return;
311  }
312  else if (strcmp(reflect_type, "REFLECT_PACK") == 0){
314  //xmpf_dbg_printf("REFLECT_PACK\n");
315  return;
316  }
317 
318  }
319 
320  // not specified or a wrong value
321  if (_xmp_omp_num_procs > 1){
323  //xmpf_dbg_printf("not specified and REFLECT_PACK\n");
324  }
325  else {
327  //xmpf_dbg_printf("not specified and REFLECT_NOPACK\n");
328  }
329 
330 }

◆ _XMP_check_template_ref_inclusion()

int _XMP_check_template_ref_inclusion ( int  ref_lower,
int  ref_upper,
int  ref_stride,
_XMP_template_t t,
int  index 
)
244  {
245  _XMP_template_info_t *info = &(t->info[index]);
246  _XMP_template_chunk_t *chunk = &(t->chunk[index]);
247 
248  _XMP_validate_template_ref(&ref_lower, &ref_upper, &ref_stride, info->ser_lower, info->ser_upper);
249 
250  switch (chunk->dist_manner) {
252  return _XMP_N_INT_TRUE;
253  case _XMP_N_DIST_BLOCK:
254  case _XMP_N_DIST_CYCLIC:
255  return _XMP_check_template_ref_inclusion_width_1(ref_lower, ref_upper, ref_stride,
256  chunk->par_lower, chunk->par_upper, chunk->par_stride);
258  return _XMP_check_template_ref_inclusion_width_N(ref_lower, ref_upper, ref_stride, t, index);
259  default:
260  _XMP_fatal("unknown distribution manner");
261  return _XMP_N_INT_FALSE; // XXX dummy
262  }
263 }
Here is the caller graph for this function:

◆ _XMP_coarray_lastly_deallocate()

void _XMP_coarray_lastly_deallocate ( )

Deallocate memory space and an object of the last coarray.

1644 {
1645 #ifdef _XMP_GASNET
1647 #elif _XMP_FJRDMA
1649 #elif _XMP_UTOFU
1650  // _XMP_utofu_coarray_lastly_deallocate();
1651 #elif _XMP_MPI3_ONESIDED
1653 #endif
1654 
1655  _XMP_coarray_t *_last_coarray_ptr = _pop_coarray_queue();
1656  _XMP_coarray_deallocate(_last_coarray_ptr);
1657 }
Here is the call graph for this function:

◆ _XMP_create_nodes_by_comm()

_XMP_nodes_t* _XMP_create_nodes_by_comm ( int  is_member,
_XMP_comm_t comm 
)
1008 {
1009  int size;
1010  MPI_Comm_size(*((MPI_Comm *)comm), &size);
1011 
1012  _XMP_nodes_t *n = _XMP_create_new_nodes(is_member, 1, size, comm);
1013 
1014  n->info[0].size = size;
1015  if(is_member)
1016  MPI_Comm_rank(*((MPI_Comm *)comm), &(n->info[0].rank));
1017 
1018  // calc inherit info
1019  n->inherit_nodes = NULL;
1020  n->inherit_info = NULL;
1021  n->info[0].multiplier = 1;
1022 
1023  return n;
1024 }

◆ _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 
)
461 {
462  _XMP_ASSERT(ref_template->is_fixed);
463  _XMP_ASSERT(ref_template->is_distributed);
464 
465  _XMP_nodes_t *onto_nodes = ref_template->onto_nodes;
466  int onto_nodes_dim = onto_nodes->dim;
467  int onto_nodes_shrink[onto_nodes_dim];
468  int onto_nodes_ref_lower[onto_nodes_dim];
469  int onto_nodes_ref_upper[onto_nodes_dim];
470  int onto_nodes_ref_stride[onto_nodes_dim];
471 
472  for(int i=0;i<onto_nodes_dim;i++)
473  onto_nodes_shrink[i] = 1;
474 
475  int new_nodes_dim = 0;
476  int new_nodes_dim_size[_XMP_N_MAX_DIM];
477  int acc_dim_size = 1;
478  int ref_template_dim = ref_template->dim;
479 
480  for(int i=0;i<ref_template_dim;i++){
481  if(shrink[i]){
482  continue;
483  }
484 
485  _XMP_template_chunk_t *chunk = &(ref_template->chunk[i]);
486  int onto_nodes_index = chunk->onto_nodes_index;
487  if (onto_nodes_index != _XMP_N_NO_ONTO_NODES) {
488  onto_nodes_shrink[onto_nodes_index] = 0;
489 
490  int size = (chunk->onto_nodes_info)->size;
491  // FIXME calc onto_nodes_ref_lower, onto_nodes_ref_upper, onto_nodes_ref_stride
492  if (_XMP_M_COUNT_TRIPLETi(ref_lower[i], ref_upper[i], ref_stride[i]) == 1) {
493  int j = _XMP_calc_template_owner_SCALAR(ref_template, i, ref_lower[i]) + 1;
494  onto_nodes_ref_lower[onto_nodes_index] = j;
495  onto_nodes_ref_upper[onto_nodes_index] = j;
496  onto_nodes_ref_stride[onto_nodes_index] = 1;
497 
498  new_nodes_dim_size[new_nodes_dim] = 1;
499  } else {
500  onto_nodes_ref_lower[onto_nodes_index] = 1;
501  onto_nodes_ref_upper[onto_nodes_index] = size;
502  onto_nodes_ref_stride[onto_nodes_index] = 1;
503  acc_dim_size *= _XMP_M_COUNT_TRIPLETi(1, size, 1);
504 
505  new_nodes_dim_size[new_nodes_dim] = size;
506  }
507 
508  new_nodes_dim++;
509  }
510  }
511 
512  if (new_nodes_dim > 0)
513  return _XMP_init_nodes_struct_NODES_NAMED(new_nodes_dim, onto_nodes, onto_nodes_shrink,
514  onto_nodes_ref_lower, onto_nodes_ref_upper,
515  onto_nodes_ref_stride, new_nodes_dim_size, _XMP_N_INT_TRUE);
516  else return NULL;
517 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_create_nodes_ref_for_target_nodes()

_XMP_nodes_ref_t* _XMP_create_nodes_ref_for_target_nodes ( _XMP_nodes_t n,
int *  rank_array,
_XMP_nodes_t target_nodes 
)
1235 {
1236  if(_XMP_compare_nodes(n, target_nodes)){
1237  return _XMP_init_nodes_ref(n, rank_array);
1238  }
1239  else{
1240  _XMP_nodes_t *inherit_nodes = n->inherit_nodes;
1241  if(inherit_nodes == NULL){
1242  // FIXME implement
1243  _XMP_fatal("unsupported case: gmove");
1244  return NULL; // XXX dummy;
1245  // return _XMP_init_nodes_ref(n, rank_array);
1246  }
1247  else{
1248  int inherit_nodes_dim = inherit_nodes->dim;
1249  int *new_rank_array = _XMP_alloc(sizeof(int) * inherit_nodes_dim);
1250  _XMP_nodes_inherit_info_t *inherit_info = n->inherit_info;
1251 
1252  int j = 0;
1253  for(int i = 0; i < inherit_nodes_dim; i++){
1254  if(inherit_info[i].shrink){
1255  new_rank_array[i] = _XMP_N_UNSPECIFIED_RANK;
1256  }
1257  else{
1258  new_rank_array[i] = ((inherit_info[i].stride) * rank_array[j]) + (inherit_info[i].lower);
1259  j++;
1260  }
1261  }
1262 
1263  _XMP_nodes_ref_t *ret = _XMP_create_nodes_ref_for_target_nodes(inherit_nodes, new_rank_array, target_nodes);
1264  _XMP_free(new_rank_array);
1265  return ret;
1266  }
1267  }
1268 }
Here is the caller graph for this function:

◆ _XMP_create_shadow_comm()

void _XMP_create_shadow_comm ( _XMP_array_t array,
int  array_index 
)
16  {
17  _XMP_nodes_t *onto_nodes = (array->align_template)->onto_nodes;
18  _XMP_array_info_t *ai = &(array->info[array_index]);
19 
20  _XMP_template_t *align_template = array->align_template;
21 
22  int color = 1;
23  if (onto_nodes->is_member) {
26 
27  _XMP_template_chunk_t *chunk = &(align_template->chunk[ai->align_template_index]);
29 
30  int onto_nodes_index = chunk->onto_nodes_index;
31 
32  int acc_nodes_size = 1;
33  int nodes_dim = onto_nodes->dim;
34  for (int i = 0; i < nodes_dim; i++) {
35  _XMP_nodes_info_t *onto_nodes_info = &(onto_nodes->info[i]);
36  int size = onto_nodes_info->size;
37  int rank = onto_nodes_info->rank;
38 
39  if (i != onto_nodes_index) {
40  color += (acc_nodes_size * rank);
41  }
42 
43  acc_nodes_size *= size;
44  }
45 
46  if (!array->is_allocated) {
47  color = 0;
48  }
49  } else {
50  color = 0;
51  }
52 
53  MPI_Comm *comm = _XMP_alloc(sizeof(MPI_Comm));
54  MPI_Comm_split(*((MPI_Comm *)(_XMP_get_execution_nodes())->comm), color, _XMP_world_rank, comm);
55 
56  // set members
57  if (array->is_allocated) {
58  ai->is_shadow_comm_member = true;
59 
60  ai->shadow_comm = comm;
61  MPI_Comm_size(*comm, &(ai->shadow_comm_size));
62  MPI_Comm_rank(*comm, &(ai->shadow_comm_rank));
63  } else {
64  _XMP_finalize_comm(comm);
65  }
66 }
Here is the caller graph for this function:

◆ _XMP_create_template_desc()

_XMP_template_t* _XMP_create_template_desc ( int  dim,
_Bool  is_fixed 
)
11 {
12  // alloc descriptor
14  sizeof(_XMP_template_info_t) * (dim - 1));
15 
16  // calc members
18 
20  t->is_fixed = is_fixed;
21  t->is_distributed = false;
22  t->is_owner = false;
23  t->dim = dim;
24  t->onto_nodes = NULL;
25  t->chunk = NULL;
26 
27  return t;
28 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_create_temporary_nodes()

_XMP_nodes_t* _XMP_create_temporary_nodes ( _XMP_nodes_t n)
258 {
259  int is_member = n->is_member;
260  int onto_nodes_dim = n->dim;
261  int onto_nodes_size = n->comm_size;
262  int dim_size[onto_nodes_dim];
263  _XMP_nodes_t *new_node = _XMP_create_new_nodes(is_member, onto_nodes_dim, onto_nodes_size, n->comm);
264  _XMP_nodes_inherit_info_t *inherit_info = _XMP_alloc(sizeof(_XMP_nodes_inherit_info_t) * onto_nodes_dim);
265 
266  for(int i=0;i<onto_nodes_dim;i++){
267  inherit_info[i].shrink = _XMP_N_INT_FALSE;
268  inherit_info[i].lower = 1;
269  inherit_info[i].upper = n->info[i].size;
270  inherit_info[i].stride = 1;
271  dim_size[i] = n->info[i].size;
272  }
273 
274  new_node->inherit_nodes = new_node;
275  new_node->inherit_info = inherit_info;
276 
277  _XMP_init_nodes_info(new_node, dim_size, _XMP_N_INT_TRUE);
278 
279  new_node->info[0].multiplier = 1;
280  for(int i=1;i<onto_nodes_dim;i++)
281  new_node->info[i].multiplier = new_node->info[i-1].multiplier * dim_size[i-1];
282 
283  return new_node;
284 }
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_dist_template_BLOCK()

void _XMP_dist_template_BLOCK ( _XMP_template_t template,
int  template_index,
int  nodes_index 
)
348 {
349  _XMP_ASSERT(template->is_fixed);
350  _XMP_ASSERT(template->is_distributed);
351 
352  _XMP_nodes_t *nodes = template->onto_nodes;
353  _XMP_template_chunk_t *chunk = &(template->chunk[template_index]);
354  _XMP_template_info_t *ti = &(template->info[template_index]);
355  _XMP_nodes_info_t *ni = &(nodes->info[nodes_index]);
356 
357  unsigned long long nodes_size = ni->size;
358 
359  // calc parallel members
360  unsigned long long chunk_width = _XMP_M_CEILi(ti->ser_size, nodes_size);
361 
362  if(nodes->is_member){
363  unsigned long long nodes_rank = ni->rank;
364  unsigned long long owner_nodes_size = _XMP_M_CEILi(ti->ser_size, chunk_width);
365 
366  chunk->par_lower = nodes_rank * chunk_width + ti->ser_lower;
367  if(nodes_rank == (owner_nodes_size - 1)){
368  chunk->par_upper = ti->ser_upper;
369  }
370  else if (nodes_rank >= owner_nodes_size){
371  template->is_owner = false;
372  }
373  else{
374  chunk->par_upper = chunk->par_lower + chunk_width - 1;
375  }
376  }
377 
378  chunk->par_width = 1;
379  chunk->par_stride = 1;
380  chunk->par_chunk_width = chunk_width;
382 
383  if((ti->ser_size % nodes_size) == 0){
384  chunk->is_regular_chunk = true;
385  }
386  else{
387  chunk->is_regular_chunk = false;
388  }
389 
390  chunk->onto_nodes_index = nodes_index;
391  chunk->onto_nodes_info = ni;
392 }

◆ _XMP_dist_template_BLOCK_CYCLIC()

void _XMP_dist_template_BLOCK_CYCLIC ( _XMP_template_t template,
int  template_index,
int  nodes_index,
unsigned long long  width 
)
400 {
401  _XMP_dist_template_CYCLIC_WIDTH(template, template_index, nodes_index, width);
402 }

◆ _XMP_dist_template_CYCLIC()

void _XMP_dist_template_CYCLIC ( _XMP_template_t template,
int  template_index,
int  nodes_index 
)
395 {
396  _XMP_dist_template_CYCLIC_WIDTH(template, template_index, nodes_index, 1);
397 }

◆ _XMP_dist_template_DUPLICATION()

void _XMP_dist_template_DUPLICATION ( _XMP_template_t template,
int  template_index 
)
327  {
328  _XMP_ASSERT(template->is_fixed);
329  _XMP_ASSERT(template->is_distributed);
330 
331  _XMP_template_chunk_t *chunk = &(template->chunk[template_index]);
332  _XMP_template_info_t *ti = &(template->info[template_index]);
333 
334  chunk->par_lower = ti->ser_lower;
335  chunk->par_upper = ti->ser_upper;
336  chunk->par_width = 1;
337 
338  chunk->par_stride = 1;
339  chunk->par_chunk_width = ti->ser_size;
341  chunk->is_regular_chunk = true;
342 
344  chunk->onto_nodes_info = NULL;
345 }

◆ _XMP_dist_template_GBLOCK()

void _XMP_dist_template_GBLOCK ( _XMP_template_t template,
int  template_index,
int  nodes_index,
int *  mapping_array,
int *  temp0 
)
407  {
408 
409  _XMP_ASSERT(template->is_fixed);
410  _XMP_ASSERT(template->is_distributed);
411 
412  _XMP_nodes_t *nodes = template->onto_nodes;
413 
414  _XMP_template_chunk_t *chunk = &(template->chunk[template_index]);
415  _XMP_template_info_t *ti = &(template->info[template_index]);
416  _XMP_nodes_info_t *ni = &(nodes->info[nodes_index]);
417 
418  if (mapping_array){
419 
420  long long *rsum_array = _XMP_alloc(sizeof(long long) * (ni->size + 1));
421  rsum_array[0] = ti->ser_lower;
422  for (int i = 1; i <= ni->size; i++){
423  rsum_array[i] = rsum_array[i-1] + (long long)mapping_array[i-1];
424  }
425  chunk->mapping_array = rsum_array;
426 
427  if (ti->ser_upper >= rsum_array[ni->size])
428  _XMP_fatal("The size of the template exceeds the sum of the mapping array.");
429 
430  if (ti->ser_upper + 1 < rsum_array[ni->size])
431  _XMP_warning("The sum of the mapping array exceeds the size of the template.");
432 
433  template->is_owner = false;
434  if (nodes->is_member && rsum_array[ni->rank + 1] != rsum_array[ni->rank]) {
435  chunk->par_lower = rsum_array[ni->rank];
436  if (chunk->par_lower <= ti->ser_upper){
437  chunk->par_upper = min(ti->ser_upper, rsum_array[ni->rank + 1] - 1);
438  template->is_owner = true;
439  }
440  }
441 
442  chunk->par_width = 1;
443  chunk->par_stride = 1;
444  chunk->par_chunk_width = chunk->par_upper - chunk->par_lower + 1;
445  }
446  else {
447  template->is_fixed = false;
448  }
449 
451  chunk->is_regular_chunk = false;
452 
453  chunk->onto_nodes_index = nodes_index;
454  chunk->onto_nodes_info = ni;
455 
456  *temp0 = chunk->par_lower;
457 }
Here is the call graph for this function:

◆ _XMP_fatal()

void _XMP_fatal ( char *  msg)
43 {
44  fprintf(stderr, "[RANK:%d] XcalableMP runtime error: %s\n", _XMP_world_rank, msg);
45  MPI_Abort(MPI_COMM_WORLD, 1);
46 }

◆ _XMP_fatal_nomsg()

void _XMP_fatal_nomsg ( )
49 {
50  MPI_Abort(MPI_COMM_WORLD, 1);
51 }
Here is the caller graph for this function:

◆ _XMP_finalize()

void _XMP_finalize ( bool  isFinalize)
74 {
75  if (_XMP_runtime_working) {
77 
78 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_TCA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
80 #endif
81  _XMP_finalize_world(isFinalize);
82  _XMP_runtime_working = _XMP_N_INT_FALSE;
83  }
84 }
Here is the caller 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_finalize_comm()

void _XMP_finalize_comm ( _XMP_comm_t comm)
62 {
63  MPI_Comm_free(comm);
64  _XMP_free(comm);
65 }

◆ _XMP_finalize_nodes()

void _XMP_finalize_nodes ( _XMP_nodes_t nodes)
817 {
818  if(!nodes->use_subcomm)
819  _XMP_finalize_comm(nodes->comm);
820 
821  if(nodes->subcomm != NULL){
822  int dim = nodes->dim;
823  int num_comms = 1<<dim;
824  for(int i=0;i<num_comms;i++){
825  MPI_Comm *comm = (MPI_Comm *)nodes->subcomm;
826  MPI_Comm_free(&comm[i]);
827  }
828  free(nodes->subcomm);
829  }
830 
831  _XMP_free(nodes->inherit_info);
832  _XMP_free(nodes);
833 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_finalize_nodes_ref()

void _XMP_finalize_nodes_ref ( _XMP_nodes_ref_t nodes_ref)
1229 {
1230  _XMP_free(nodes_ref->ref);
1231  _XMP_free(nodes_ref);
1232 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_finalize_onesided_functions()

void _XMP_finalize_onesided_functions ( )
143 {
144 #ifdef _XMP_GASNET
146 #elif _XMP_FJRDMA
147  if(_XMP_world_size > _XMP_ONESIDED_MAX_PROCS) return;
148  else _XMP_fjrdma_finalize();
149 #elif _XMP_UTOFU
151 #elif _XMP_MPI3_ONESIDED
153 #endif
154 
155 #ifdef _XMP_TCA
157 #endif
158 }
Here is the call graph for this function:

◆ _XMP_finalize_reflect_sched()

void _XMP_finalize_reflect_sched ( _XMP_reflect_sched_t sched,
_Bool  free_buf 
)
236  {
237 
238  if (sched->datatype_lo != MPI_DATATYPE_NULL)
239  MPI_Type_free(&sched->datatype_lo);
240  if (sched->datatype_hi != MPI_DATATYPE_NULL)
241  MPI_Type_free(&sched->datatype_hi);
242 
243  for (int j = 0; j < 4; j++){
244  if (sched->req[j] != MPI_REQUEST_NULL){
245  MPI_Request_free(&sched->req[j]);
246  }
247  if (sched->req_reduce[j] != MPI_REQUEST_NULL){
248  MPI_Request_free(&sched->req_reduce[j]);
249  }
250  }
251 
252  if (free_buf){
253  _XMP_free(sched->lo_send_buf);
254  _XMP_free(sched->lo_recv_buf);
255  _XMP_free(sched->hi_send_buf);
256  _XMP_free(sched->hi_recv_buf);
257  }
258 
259 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_finalize_template()

void _XMP_finalize_template ( _XMP_template_t template)
313  {
314  if (template->is_distributed) {
315  for (int i = 0; i < template->dim; i++){
316  _XMP_template_chunk_t *chunk = &(template->chunk[i]);
317  if (chunk->dist_manner == _XMP_N_DIST_GBLOCK){
318  _XMP_free(chunk->mapping_array);
319  }
320  }
321  _XMP_free(template->chunk);
322  }
323 
324  _XMP_free(template);
325 }
Here is the call graph for this function:

◆ _XMP_finalize_world()

void _XMP_finalize_world ( bool  )
29  {
30  MPI_Barrier(MPI_COMM_WORLD);
31 
32  int flag = 0;
33  MPI_Finalized(&flag);
34  if (!flag) {
37  if(isFinalize)
38  MPI_Finalize();
39  }
40 }
Here is the call graph for this function:

◆ _XMP_free()

void _XMP_free ( void *  p)
38 {
39  free(p);
40 }

◆ _XMP_G2L()

void _XMP_G2L ( long long int  global_idx,
int *  local_idx,
_XMP_template_t template,
int  template_index 
)
46 {
47  _XMP_template_chunk_t *chunk = &(template->chunk[template_index]);
48  _XMP_nodes_info_t *n_info = chunk->onto_nodes_info;
49  long long base = template->info[template_index].ser_lower;
50 
51  // NOTE: local_idx is 0-origin.
52 
53  switch(chunk->dist_manner){
55  //*local_idx = global_idx - base;
56  *local_idx = global_idx;
57  break;
58  case _XMP_N_DIST_BLOCK:
59  *local_idx = (global_idx - base) - n_info->rank * chunk->par_chunk_width;
60  break;
61  case _XMP_N_DIST_CYCLIC:
62  *local_idx = (global_idx - base) / n_info->size;
63  break;
65  {
66  int off = global_idx - base;
67  int w = chunk->par_width;
68  *local_idx = (off / (n_info->size*w)) * w + off%w;
69  }
70  break;
71  case _XMP_N_DIST_GBLOCK:
72  *local_idx = global_idx - chunk->mapping_array[n_info->rank];
73  break;
74  default:
75  _XMP_fatal("_XMP_: unknown chunk dist_manner");
76  }
77 }
Here is the call graph for this function:

◆ _XMP_get_current_async()

_XMP_async_comm_t* _XMP_get_current_async ( )
206 {
207  return _tmp_async;
208 }
Here is the caller graph for this function:

◆ _XMP_get_datatype_size()

size_t _XMP_get_datatype_size ( int  datatype)
104 {
105  size_t size;
106 
107  // size of each type is obtained from config.h.
108  // Note: need to fix when building a cross compiler.
109  switch (datatype){
110 
111  case _XMP_N_TYPE_BOOL:
112  size = _XMPF_running ? SIZEOF_UNSIGNED_INT : SIZEOF__BOOL;
113  break;
114 
115  case _XMP_N_TYPE_CHAR:
117  size = SIZEOF_UNSIGNED_CHAR; break;
118 
119  case _XMP_N_TYPE_SHORT:
121  size = SIZEOF_UNSIGNED_SHORT; break;
122 
123  case _XMP_N_TYPE_INT:
125  size = SIZEOF_UNSIGNED_INT; break;
126 
127  case _XMP_N_TYPE_LONG:
129  size = SIZEOF_UNSIGNED_LONG; break;
130 
133  size = SIZEOF_UNSIGNED_LONG_LONG; break;
134 
135  case _XMP_N_TYPE_FLOAT:
136 #ifdef __STD_IEC_559_COMPLEX__
137  case _XMP_N_TYPE_FLOAT_IMAGINARY:
138 #endif
139  size = SIZEOF_FLOAT; break;
140 
141  case _XMP_N_TYPE_DOUBLE:
142 #ifdef __STD_IEC_559_COMPLEX__
143  case _XMP_N_TYPE_DOUBLE_IMAGINARY:
144 #endif
145  size = SIZEOF_DOUBLE; break;
146 
148 #ifdef __STD_IEC_559_COMPLEX__
149  case _XMP_N_TYPE_LONG_DOUBLE_IMAGINARY:
150 #endif
151  size = SIZEOF_LONG_DOUBLE; break;
152 
154  size = SIZEOF_FLOAT * 2; break;
155 
157  size = SIZEOF_DOUBLE * 2; break;
158 
160  size = SIZEOF_LONG_DOUBLE * 2; break;
161 
162  case _XMP_N_TYPE_NONBASIC: // should be fixed for structures.
163  default:
164  size = 0; break;
165  }
166 
167  return size;
168 }

◆ _XMP_get_dim_of_allelmts()

int _XMP_get_dim_of_allelmts ( const int  ,
const _XMP_array_section_t  
)
121 {
122  int val = dims;
123 
124  for(int i=dims-1;i>=0;i--){
125  if(array_info[i].start == 0 && array_info[i].length == array_info[i].elmts)
126  val--;
127  else
128  return val;
129  }
130 
131  return val;
132 }
Here is the caller graph for this function:

◆ _XMP_get_execution_nodes()

_XMP_nodes_t* _XMP_get_execution_nodes ( void  )
47 {
48  return _XMP_nodes_stack_top->nodes;
49 }
Here is the caller graph for this function:

◆ _XMP_get_execution_nodes_rank()

int _XMP_get_execution_nodes_rank ( void  )
52 {
54 }
Here is the call graph for this function:

◆ _XMP_get_next_rank()

int _XMP_get_next_rank ( _XMP_nodes_t nodes,
int *  rank_array 
)
1292 {
1293  int i, dim = nodes->dim;
1294  for(i=0;i<dim;i++){
1295  int size = nodes->info[i].size;
1296  (rank_array[i])++;
1297  if(rank_array[i] == size)
1298  rank_array[i] = 0;
1299  else
1300  break;
1301  }
1302 
1303  if(i == dim)
1304  return _XMP_N_INT_FALSE;
1305  else
1306  return _XMP_N_INT_TRUE;
1307 }

◆ _XMP_get_on_ref_id()

unsigned long long _XMP_get_on_ref_id ( void  )
14 {
15  if(_XMP_on_ref_id_count == ULLONG_MAX)
16  _XMP_fatal("cannot create a new nodes/template: too many");
17 
18  return _XMP_on_ref_id_count++;
19 }
Here is the caller graph for this function:

◆ _XMP_gmove_array_array_common()

void _XMP_gmove_array_array_common ( _XMP_gmv_desc_t gmv_desc_leftp,
_XMP_gmv_desc_t gmv_desc_rightp,
int *  dst_l,
int *  dst_u,
int *  dst_s,
unsigned long long *  dst_d,
int *  src_l,
int *  src_u,
int *  src_s,
unsigned long long *  src_d,
int  mode 
)
2039  {
2040  // NOTE: asynchronous gmove aloways done by _XMP_gmove_1to1
2041  if (!xmp_is_async() && gmv_desc_leftp->is_global && gmv_desc_rightp->is_global && mode == _XMP_N_GMOVE_NORMAL){
2042  if (_XMP_gmove_garray_garray_opt(gmv_desc_leftp, gmv_desc_rightp,
2043  dst_l, dst_u, dst_s, dst_d,
2044  src_l, src_u, src_s, src_d)) return;
2045  // fall through
2046  }
2047 
2048  _XMP_gmove_1to1(gmv_desc_leftp, gmv_desc_rightp, mode);
2049 
2050  return;
2051 
2052 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_gmove_bcast_ARRAY()

unsigned long long _XMP_gmove_bcast_ARRAY ( void *  dst_addr,
int  dst_dim,
int *  dst_l,
int *  dst_u,
int *  dst_s,
unsigned long long *  dst_d,
void *  src_addr,
int  src_dim,
int *  src_l,
int *  src_u,
int *  src_s,
unsigned long long *  src_d,
int  type,
size_t  type_size,
int  root_rank 
)
277  {
278  unsigned long long dst_buffer_elmts = 1;
279  for (int i = 0; i < dst_dim; i++) {
280  dst_buffer_elmts *= _XMP_M_COUNT_TRIPLETi(dst_l[i], dst_u[i], dst_s[i]);
281  }
282 
283  void *buffer = _XMP_alloc(dst_buffer_elmts * type_size);
284 
285  _XMP_nodes_t *exec_nodes = _XMP_get_execution_nodes();
286  _XMP_ASSERT(exec_nodes->is_member);
287 
288  if (root_rank == (exec_nodes->comm_rank)) {
289  unsigned long long src_buffer_elmts = 1;
290  for (int i = 0; i < src_dim; i++) {
291  src_buffer_elmts *= _XMP_M_COUNT_TRIPLETi(src_l[i], src_u[i], src_s[i]);
292  }
293 
294  if (dst_buffer_elmts != src_buffer_elmts) {
295  _XMP_fatal("wrong assign statement for gmove");
296  } else {
297  (*_xmp_pack_array)(buffer, src_addr, type, type_size, src_dim, src_l, src_u, src_s, src_d);
298  }
299  }
300 
301  _XMP_gmove_bcast(buffer, type_size, dst_buffer_elmts, root_rank);
302 
303  (*_xmp_unpack_array)(dst_addr, buffer, type, type_size, dst_dim, dst_l, dst_u, dst_s, dst_d);
304  _XMP_free(buffer);
305 
306  return dst_buffer_elmts;
307 }
Here is the call graph for this function:

◆ _XMP_gmove_bcast_SCALAR()

void _XMP_gmove_bcast_SCALAR ( void *  dst_addr,
void *  src_addr,
size_t  type_size,
int  root_rank 
)

◆ _XMP_gmove_garray_garray()

void _XMP_gmove_garray_garray ( _XMP_gmv_desc_t gmv_desc_leftp,
_XMP_gmv_desc_t gmv_desc_rightp,
int  mode 
)
4772 {
4773  _XMP_array_t *dst_array = gmv_desc_leftp->a_desc;
4774  _XMP_array_t *src_array = gmv_desc_rightp->a_desc;
4775 
4776  _XMP_ASSERT(src_array->type == type);
4777  _XMP_ASSERT(src_array->type_size == dst_array->type_size);
4778 
4779  //unsigned long long gmove_total_elmts = 0;
4780 
4781  // get dst info
4782  unsigned long long dst_total_elmts = 1;
4783  int dst_dim = dst_array->dim;
4784  int dst_l[dst_dim], dst_u[dst_dim], dst_s[dst_dim];
4785  unsigned long long dst_d[dst_dim];
4786  int dst_scalar_flag = 1;
4787  for (int i = 0; i < dst_dim; i++) {
4788  dst_l[i] = gmv_desc_leftp->lb[i];
4789  dst_u[i] = gmv_desc_leftp->ub[i];
4790  dst_s[i] = gmv_desc_leftp->st[i];
4791  dst_d[i] = dst_array->info[i].dim_acc;
4792  _XMP_normalize_array_section(gmv_desc_leftp, i, &(dst_l[i]), &(dst_u[i]), &(dst_s[i]));
4793  if (dst_s[i] != 0) dst_total_elmts *= _XMP_M_COUNT_TRIPLETi(dst_l[i], dst_u[i], dst_s[i]);
4794  dst_scalar_flag &= (dst_s[i] == 0);
4795  }
4796 
4797  // get src info
4798  unsigned long long src_total_elmts = 1;
4799  int src_dim = src_array->dim;
4800  int src_l[src_dim], src_u[src_dim], src_s[src_dim];
4801  unsigned long long src_d[src_dim];
4802  int src_scalar_flag = 1;
4803  for (int i = 0; i < src_dim; i++) {
4804  src_l[i] = gmv_desc_rightp->lb[i];
4805  src_u[i] = gmv_desc_rightp->ub[i];
4806  src_s[i] = gmv_desc_rightp->st[i];
4807  src_d[i] = src_array->info[i].dim_acc;
4808  _XMP_normalize_array_section(gmv_desc_rightp, i, &(src_l[i]), &(src_u[i]), &(src_s[i]));
4809  if (src_s[i] != 0) src_total_elmts *= _XMP_M_COUNT_TRIPLETi(src_l[i], src_u[i], src_s[i]);
4810  src_scalar_flag &= (src_s[i] == 0);
4811  }
4812 
4813  if (dst_total_elmts != src_total_elmts && !src_scalar_flag){
4814  _XMP_fatal("wrong assign statement for gmove");
4815  }
4816  else {
4817  //gmove_total_elmts = dst_total_elmts;
4818  }
4819 
4820  if (mode == _XMP_N_GMOVE_NORMAL){
4821 
4822  if (dst_scalar_flag && src_scalar_flag){
4823  void *dst_addr = (char *)dst_array->array_addr_p + _XMP_gtol_calc_offset(dst_array, dst_l);
4824  void *src_addr = (char *)src_array->array_addr_p + _XMP_gtol_calc_offset(src_array, src_l);
4825  _XMP_gmove_SENDRECV_GSCALAR(dst_addr, src_addr,
4826  dst_array, src_array,
4827  dst_l, src_l);
4828  return;
4829  }
4830  else if (!dst_scalar_flag && src_scalar_flag){
4831  char *tmp = _XMP_alloc(src_array->type_size);
4832  //char *src_addr = (char *)src_array->array_addr_p + _XMP_gtol_calc_offset(src_array, src_l);
4833  //_XMP_gmove_BCAST_GSCALAR(tmp, src_addr, src_array, src_l);
4834  _XMP_gmove_BCAST_GSCALAR(tmp, src_array, src_l);
4835  _XMP_gmove_gsection_scalar(dst_array, dst_l, dst_u, dst_s, tmp);
4836  _XMP_free(tmp);
4837  return;
4838  }
4839  }
4840 
4841  _XMP_gmove_array_array_common(gmv_desc_leftp, gmv_desc_rightp,
4842  dst_l, dst_u, dst_s, dst_d,
4843  src_l, src_u, src_s, src_d,
4844  mode);
4845 }
Here is the call graph for this function:

◆ _XMP_gmove_garray_larray()

void _XMP_gmove_garray_larray ( _XMP_gmv_desc_t gmv_desc_leftp,
_XMP_gmv_desc_t gmv_desc_rightp,
int  mode 
)
4854 {
4855  _XMP_array_t *dst_array = gmv_desc_leftp->a_desc;
4856 
4857  int type = dst_array->type;
4858  size_t type_size = dst_array->type_size;
4859 
4860  if (!dst_array->is_allocated && mode != _XMP_N_GMOVE_OUT) return;
4861 
4862  // get dst info
4863  unsigned long long dst_total_elmts = 1;
4864  void *dst_addr = dst_array->array_addr_p;
4865  int dst_dim = dst_array->dim;
4866  int dst_l[dst_dim], dst_u[dst_dim], dst_s[dst_dim];
4867  unsigned long long dst_d[dst_dim];
4868  int dst_scalar_flag = 1;
4869  for (int i = 0; i < dst_dim; i++) {
4870  dst_l[i] = gmv_desc_leftp->lb[i];
4871  dst_u[i] = gmv_desc_leftp->ub[i];
4872  dst_s[i] = gmv_desc_leftp->st[i];
4873  dst_d[i] = dst_array->info[i].dim_acc;
4874  _XMP_normalize_array_section(gmv_desc_leftp, i, &(dst_l[i]), &(dst_u[i]), &(dst_s[i]));
4875  if (dst_s[i] != 0) dst_total_elmts *= _XMP_M_COUNT_TRIPLETi(dst_l[i], dst_u[i], dst_s[i]);
4876  dst_scalar_flag &= (dst_s[i] == 0);
4877  }
4878 
4879  // get src info
4880  unsigned long long src_total_elmts = 1;
4881  void *src_addr = gmv_desc_rightp->local_data;
4882  int src_dim = gmv_desc_rightp->ndims;
4883  int src_l[src_dim], src_u[src_dim], src_s[src_dim];
4884  unsigned long long src_d[src_dim];
4885  int src_scalar_flag = 1;
4886  for (int i = 0; i < src_dim; i++) {
4887  src_l[i] = gmv_desc_rightp->lb[i];
4888  src_u[i] = gmv_desc_rightp->ub[i];
4889  src_s[i] = gmv_desc_rightp->st[i];
4890  if (i == 0) src_d[i] = 1;
4891  else src_d[i] = src_d[i-1] * (gmv_desc_rightp->a_ub[i] - gmv_desc_rightp->a_lb[i] + 1);
4892  _XMP_normalize_array_section(gmv_desc_rightp, i, &(src_l[i]), &(src_u[i]), &(src_s[i]));
4893  if (src_s[i] != 0) src_total_elmts *= _XMP_M_COUNT_TRIPLETi(src_l[i], src_u[i], src_s[i]);
4894  src_scalar_flag &= (src_s[i] == 0);
4895  }
4896 
4897  if (dst_total_elmts != src_total_elmts && !src_scalar_flag){
4898  _XMP_fatal("wrong assign statement for gmove");
4899  }
4900 
4901  char *scalar = (char *)src_addr;
4902  if (src_scalar_flag){
4903  for (int i = 0; i < src_dim; i++){
4904  scalar += ((src_l[i] - gmv_desc_rightp->a_lb[i]) * src_d[i] * type_size);
4905  }
4906  }
4907 
4908  if (mode == _XMP_N_GMOVE_OUT){
4909  if (src_scalar_flag){
4910 #ifdef _XMP_MPI3_ONESIDED
4911  _XMP_gmove_inout_scalar(scalar, gmv_desc_leftp, _XMP_N_COARRAY_PUT);
4912 #else
4913  _XMP_fatal("Not supported gmove in/out on non-MPI3 environments");
4914 #endif
4915  }
4916  else {
4917  _XMP_gmove_array_array_common(gmv_desc_leftp, gmv_desc_rightp,
4918  dst_l, dst_u, dst_s, dst_d,
4919  src_l, src_u, src_s, src_d,
4920  mode);
4921  }
4922  return;
4923  }
4924 
4925  if (dst_scalar_flag && src_scalar_flag){
4926  _XMP_gmove_garray_scalar(gmv_desc_leftp, scalar, mode);
4927  return;
4928  }
4929 
4930  if (_XMP_IS_SINGLE) {
4931  for (int i = 0; i < dst_dim; i++) {
4932  _XMP_gtol_array_ref_triplet(dst_array, i, &(dst_l[i]), &(dst_u[i]), &(dst_s[i]));
4933  }
4934 
4935  _XMP_gmove_localcopy_ARRAY(type, type_size,
4936  dst_addr, dst_dim, dst_l, dst_u, dst_s, dst_d,
4937  src_addr, src_dim, src_l, src_u, src_s, src_d);
4938  return;
4939  }
4940 
4941  for (int i = 0; i < src_dim; i++){
4942  src_l[i] -= gmv_desc_rightp->a_lb[i];
4943  src_u[i] -= gmv_desc_rightp->a_lb[i];
4944  }
4945 
4946  // calc index ref
4947  int src_dim_index = 0;
4948  unsigned long long dst_buffer_elmts = 1;
4949  unsigned long long src_buffer_elmts = 1;
4950  for (int i = 0; i < dst_dim; i++) {
4951  int dst_elmts = _XMP_M_COUNT_TRIPLETi(dst_l[i], dst_u[i], dst_s[i]);
4952  if (dst_elmts == 1) {
4953  if(!_XMP_check_gmove_array_ref_inclusion_SCALAR(dst_array, i, dst_l[i])) {
4954  return;
4955  }
4956  } else {
4957  dst_buffer_elmts *= dst_elmts;
4958 
4959  int src_elmts;
4960  do {
4961  src_elmts = _XMP_M_COUNT_TRIPLETi(src_l[src_dim_index], src_u[src_dim_index], src_s[src_dim_index]);
4962  if (src_elmts != 1) {
4963  break;
4964  } else if (src_dim_index < src_dim) {
4965  src_dim_index++;
4966  } else {
4967  _XMP_fatal("wrong assign statement for gmove");
4968  }
4969  } while (1);
4970 
4971  if (_XMP_calc_global_index_HOMECOPY(dst_array, i,
4972  &(dst_l[i]), &(dst_u[i]), &(dst_s[i]),
4973  &(src_l[src_dim_index]), &(src_u[src_dim_index]), &(src_s[src_dim_index]))) {
4974  src_buffer_elmts *= src_elmts;
4975  src_dim_index++;
4976  } else {
4977  return;
4978  }
4979  }
4980 
4981  _XMP_gtol_array_ref_triplet(dst_array, i, &(dst_l[i]), &(dst_u[i]), &(dst_s[i]));
4982  }
4983 
4984  for (int i = src_dim_index; i < src_dim; i++) {
4985  src_buffer_elmts *= _XMP_M_COUNT_TRIPLETi(src_l[i], src_u[i], src_s[i]);
4986  }
4987 
4988  // alloc buffer
4989  if (dst_buffer_elmts != src_buffer_elmts) {
4990  _XMP_fatal("wrong assign statement for gmove");
4991  }
4992 
4993  void *buffer = _XMP_alloc(dst_buffer_elmts * type_size);
4994  (*_xmp_pack_array)(buffer, src_addr, type, type_size, src_dim, src_l, src_u, src_s, src_d);
4995  (*_xmp_unpack_array)(dst_addr, buffer, type, type_size, dst_dim, dst_l, dst_u, dst_s, dst_d);
4996  _XMP_free(buffer);
4997 }
Here is the call graph for this function:

◆ _XMP_gmove_garray_scalar()

void _XMP_gmove_garray_scalar ( _XMP_gmv_desc_t gmv_desc_leftp,
void *  scalar,
int  mode 
)
4733 {
4734  if (mode == _XMP_N_GMOVE_NORMAL){
4735  _XMP_array_t *array = gmv_desc_leftp->a_desc;
4736  int type_size = array->type_size;
4737  void *dst_addr = NULL;
4738  _XMP_nodes_t *exec_nodes = _XMP_get_execution_nodes();
4739 
4740  int ndims = gmv_desc_leftp->ndims;
4741  int lidx[ndims];
4742 
4743  for (int i=0;i<ndims;i++)
4744  lidx[i] = gmv_desc_leftp->lb[i];
4745 
4746  int owner_rank = _XMP_calc_gmove_array_owner_linear_rank_SCALAR(array, lidx);
4747 
4748  if (owner_rank == exec_nodes->comm_rank){ // I am the owner.
4749  dst_addr = _XMP_get_array_addr(array, lidx);
4750  memcpy(dst_addr, scalar, type_size);
4751  }
4752  }
4753  else if (mode == _XMP_N_GMOVE_OUT){
4754 #ifdef _XMP_MPI3_ONESIDED
4755  _XMP_gmove_inout_scalar(scalar, gmv_desc_leftp, _XMP_N_COARRAY_PUT);
4756 #else
4757  _XMP_fatal("Not supported gmove in/out on non-MPI3 environments");
4758 #endif
4759  }
4760  else {
4761  _XMP_fatal("_XMPF_gmove_garray_scalar: wrong gmove mode");
4762  }
4763 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_gmove_inout_scalar()

void _XMP_gmove_inout_scalar ( void *  scalar,
_XMP_gmv_desc_t gmv_desc,
int  rdma_type 
)
Here is the caller graph for this function:

◆ _XMP_gmove_larray_garray()

void _XMP_gmove_larray_garray ( _XMP_gmv_desc_t gmv_desc_leftp,
_XMP_gmv_desc_t gmv_desc_rightp,
int  mode 
)
5006 {
5007  _XMP_array_t *src_array = gmv_desc_rightp->a_desc;
5008  size_t type_size = src_array->type_size;
5009 
5010  // get dst info
5011  unsigned long long dst_total_elmts = 1;
5012  int dst_dim = gmv_desc_leftp->ndims;
5013  int dst_l[dst_dim], dst_u[dst_dim], dst_s[dst_dim];
5014  unsigned long long dst_d[dst_dim];
5015  int dst_scalar_flag = 1;
5016  for(int i=0;i<dst_dim;i++){
5017  dst_l[i] = gmv_desc_leftp->lb[i];
5018  dst_u[i] = gmv_desc_leftp->ub[i];
5019  dst_s[i] = gmv_desc_leftp->st[i];
5020  dst_d[i] = (i == 0)? 1 : dst_d[i-1]*(gmv_desc_leftp->a_ub[i] - gmv_desc_leftp->a_lb[i]+1);
5021  _XMP_normalize_array_section(gmv_desc_leftp, i, &(dst_l[i]), &(dst_u[i]), &(dst_s[i]));
5022  if (dst_s[i] != 0)
5023  dst_total_elmts *= _XMP_M_COUNT_TRIPLETi(dst_l[i], dst_u[i], dst_s[i]);
5024  dst_scalar_flag &= (dst_s[i] == 0);
5025  }
5026 
5027  // get src info
5028  unsigned long long src_total_elmts = 1;
5029  int src_dim = src_array->dim;
5030  int src_l[src_dim], src_u[src_dim], src_s[src_dim];
5031  unsigned long long src_d[src_dim];
5032  int src_scalar_flag = 1;
5033  for(int i=0;i<src_dim;i++) {
5034  src_l[i] = gmv_desc_rightp->lb[i];
5035  src_u[i] = gmv_desc_rightp->ub[i];
5036  src_s[i] = gmv_desc_rightp->st[i];
5037  src_d[i] = src_array->info[i].dim_acc;
5038  _XMP_normalize_array_section(gmv_desc_rightp, i, &(src_l[i]), &(src_u[i]), &(src_s[i]));
5039  if (src_s[i] != 0) src_total_elmts *= _XMP_M_COUNT_TRIPLETi(src_l[i], src_u[i], src_s[i]);
5040  src_scalar_flag &= (src_s[i] == 0);
5041  }
5042 
5043  if(dst_total_elmts != src_total_elmts && !src_scalar_flag){
5044  _XMP_fatal("wrong assign statement for gmove");
5045  }
5046 
5047  if (mode == _XMP_N_GMOVE_NORMAL){
5048  if (dst_scalar_flag && src_scalar_flag){
5049  char *dst_addr = (char *)gmv_desc_leftp->local_data;
5050  for (int i = 0; i < dst_dim; i++)
5051  dst_addr += ((dst_l[i] - gmv_desc_leftp->a_lb[i]) * dst_d[i]) * type_size;
5052  _XMP_gmove_BCAST_GSCALAR(dst_addr, src_array, src_l);
5053  return;
5054  }
5055  else if (!dst_scalar_flag && src_scalar_flag){
5056  char *tmp = _XMP_alloc(src_array->type_size);
5057  _XMP_gmove_BCAST_GSCALAR(tmp, src_array, src_l);
5058  char *dst_addr = (char *)gmv_desc_leftp->local_data;
5059 
5060  // to 0-based
5061  for (int i = 0; i < dst_dim; i++) {
5062  dst_l[i] -= gmv_desc_leftp->a_lb[i];
5063  dst_u[i] -= gmv_desc_leftp->a_lb[i];
5064  }
5065 
5066  _XMP_gmove_lsection_scalar(dst_addr, dst_dim, dst_l, dst_u, dst_s, dst_d, tmp, type_size);
5067  _XMP_free(tmp);
5068  return;
5069  }
5070  else {
5071  //gmove_total_elmts = dst_total_elmts;
5072  }
5073  }
5074 
5075  _XMP_gmove_array_array_common(gmv_desc_leftp, gmv_desc_rightp,
5076  dst_l, dst_u, dst_s, dst_d,
5077  src_l, src_u, src_s, src_d,
5078  mode);
5079 }
Here is the call graph for this function:

◆ _XMP_gmove_localcopy_ARRAY()

void _XMP_gmove_localcopy_ARRAY ( int  type,
int  type_size,
void *  dst_addr,
int  dst_dim,
int *  dst_l,
int *  dst_u,
int *  dst_s,
unsigned long long *  dst_d,
void *  src_addr,
int  src_dim,
int *  src_l,
int *  src_u,
int *  src_s,
unsigned long long *  src_d 
)
326  {
327  unsigned long long dst_buffer_elmts = 1;
328  for (int i = 0; i < dst_dim; i++) {
329  dst_buffer_elmts *= _XMP_M_COUNT_TRIPLETi(dst_l[i], dst_u[i], dst_s[i]);
330  }
331 
332  unsigned long long src_buffer_elmts = 1;
333  for (int i = 0; i < src_dim; i++) {
334  src_buffer_elmts *= _XMP_M_COUNT_TRIPLETi(src_l[i], src_u[i], src_s[i]);
335  }
336 
337  if (dst_buffer_elmts != src_buffer_elmts) {
338  _XMP_fatal("wrong assign statement for gmove");
339  }
340 
341  void *buffer = _XMP_alloc(dst_buffer_elmts * type_size);
342  (*_xmp_pack_array)(buffer, src_addr, type, type_size, src_dim, src_l, src_u, src_s, src_d);
343  (*_xmp_unpack_array)(dst_addr, buffer, type, type_size, dst_dim, dst_l, dst_u, dst_s, dst_d);
344  _XMP_free(buffer);
345 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_gmove_scalar_garray()

void _XMP_gmove_scalar_garray ( void *  scalar,
_XMP_gmv_desc_t gmv_desc_rightp,
int  mode 
)
4705 {
4706  if (mode == _XMP_N_GMOVE_NORMAL){
4707  _XMP_array_t *array = gmv_desc_rightp->a_desc;
4708  int ndims = gmv_desc_rightp->ndims;
4709  int ridx[ndims];
4710 
4711  for (int i=0;i<ndims;i++)
4712  ridx[i] = gmv_desc_rightp->lb[i];
4713 
4714  _XMP_gmove_BCAST_GSCALAR(scalar, array, ridx);
4715  }
4716  else if (mode == _XMP_N_GMOVE_IN){
4717 #ifdef _XMP_MPI3_ONESIDED
4718  _XMP_gmove_inout_scalar(scalar, gmv_desc_rightp, _XMP_N_COARRAY_GET);
4719 #else
4720  _XMP_fatal("Not supported gmove in/out on non-MPI3 environments");
4721 #endif
4722  }
4723  else {
4724  _XMP_fatal("_XMPF_gmove_scalar_garray: wrong gmove mode");
4725  }
4726 }
Here is the call graph for this function:

◆ _XMP_gtol_array_ref_triplet()

void _XMP_gtol_array_ref_triplet ( _XMP_array_t array,
int  dim_index,
int *  lower,
int *  upper,
int *  stride 
)
115  {
116  _XMP_array_info_t *array_info = &(array->info[dim_index]);
117  if (array_info->shadow_type == _XMP_N_SHADOW_FULL) {
118  return;
119  }
120 
121  _XMP_template_t *align_template = array->align_template;
122 
123  int align_template_index = array_info->align_template_index;
124  if (align_template_index != _XMP_N_NO_ALIGN_TEMPLATE) {
125  int align_subscript = array_info->align_subscript;
126 
127  int t_lower = *lower - align_subscript,
128  t_upper = *upper - align_subscript,
129  t_stride = *stride;
130 
131  _XMP_template_info_t *ti = &(align_template->info[align_template_index]);
132  int template_ser_lower = ti->ser_lower;
133 
134  _XMP_template_chunk_t *tc = &(align_template->chunk[align_template_index]);
135  int template_par_width = tc->par_width;
136  int template_par_nodes_size = (tc->onto_nodes_info)->size;
137  int template_par_chunk_width = tc->par_chunk_width;
138 
139  switch (tc->dist_manner) {
141  // do nothing
142  break;
143  case _XMP_N_DIST_BLOCK:
144  {
145  t_lower = _XMP_SM_GTOL_BLOCK(t_lower, template_ser_lower, template_par_chunk_width);
146  t_upper = _XMP_SM_GTOL_BLOCK(t_upper, template_ser_lower, template_par_chunk_width);
147  // t_stride does not change
148  } break;
149  case _XMP_N_DIST_CYCLIC:
150  {
151  t_lower = _XMP_SM_GTOL_CYCLIC(t_lower, template_ser_lower, template_par_nodes_size);
152  t_upper = _XMP_SM_GTOL_CYCLIC(t_upper, template_ser_lower, template_par_nodes_size);
153  t_stride = t_stride / template_par_nodes_size;
154  } break;
156  {
157  t_lower = _XMP_SM_GTOL_BLOCK_CYCLIC(template_par_width, t_lower, template_ser_lower, template_par_nodes_size);
158  t_upper = _XMP_SM_GTOL_BLOCK_CYCLIC(template_par_width, t_upper, template_ser_lower, template_par_nodes_size);
159  // t_stride does not change (in block)
160  } break;
161  default:
162  _XMP_fatal("wrong distribute manner for normal shadow");
163  }
164 
165  *lower = t_lower + align_subscript;
166  *upper = t_upper + align_subscript;
167  *stride = t_stride;
168  }
169 
171  switch (array_info->shadow_type) {
172  case _XMP_N_SHADOW_NONE:
173  // do nothing
174  break;
176  switch (array_info->align_manner) {
179  case _XMP_N_ALIGN_BLOCK:
180  {
181  int shadow_size_lo = array_info->shadow_size_lo;
182  *lower += shadow_size_lo;
183  *upper += shadow_size_lo;
184  } break;
185  case _XMP_N_ALIGN_CYCLIC:
186  // FIXME not supported now
188  // FIXME not supported now
189  default:
190  _XMP_fatal("gmove does not support shadow region for cyclic or block-cyclic distribution");
191  } break;
192  default:
193  _XMP_fatal("unknown shadow type");
194  }
195 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_gtol_calc_offset()

unsigned long long _XMP_gtol_calc_offset ( _XMP_array_t a,
int  g_idx[] 
)
2992 {
2993  int ndims = a->dim;
2994  int l_idx[ndims];
2995  for(int i=0;i<ndims;i++)
2996  xmp_array_gtol(a, i+1, g_idx[i], &l_idx[i]);
2997 
2998  //xmp_dbg_printf("g0 = %d, g1 = %d, l0 = %d, l1 = %d\n", g_idx[0], g_idx[1], l_idx[0], l_idx[1]);
2999 
3000  unsigned long long offset = 0;
3001 
3002  for (int i = 0; i < a->dim; i++){
3003  offset += (l_idx[i] * a->info[i].dim_acc * a->type_size);
3004  //xmp_dbg_printf("(%d) acc = %llu, type_size = %d\n", i, a->info[i].dim_acc, a->type_size);
3005  }
3006 
3007  return offset;
3008 
3009 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_init()

void _XMP_init ( int  argc,
char **  argv,
MPI_Comm  comm 
)
31 {
32  if (!_XMP_runtime_working) {
33  int flag = 0;
34  MPI_Initialized(&flag);
35 
36  if(!flag)
37  MPI_Init(&argc, &argv);
38  MPI_Comm_rank(MPI_COMM_WORLD, &_XMP_world_rank);
39  MPI_Comm_size(MPI_COMM_WORLD, &_XMP_world_size);
40 
41  // int result = 0;
42  // MPI_Comm_compare(MPI_COMM_WORLD, comm, &result);
43  // if(result != MPI_IDENT)
44  // _XMP_fatal("Now implementation does not support subcommunicator");
45 
46 #ifdef _XMP_XACC
47  _XACC_init();
48 #endif
49 
50 #ifdef _XMP_TCA
51  _XMP_init_tca();
52 #endif
53 
54 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_TCA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
56 #endif
57 #ifdef _XMP_MPI3
59 #endif
61  }
62 
63 
64  _XMP_init_world(NULL, NULL);
66 
67  if (!_XMP_runtime_working) {
69  }
70  _XMP_runtime_working = _XMP_N_INT_TRUE;
71 }
Here is the caller 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_init_nodes_ref()

_XMP_nodes_ref_t* _XMP_init_nodes_ref ( _XMP_nodes_t n,
int *  rank_array 
)
1208 {
1209  _XMP_nodes_ref_t *nodes_ref = _XMP_alloc(sizeof(_XMP_nodes_ref_t));
1210  int dim = n->dim;
1211  int *new_rank_array = _XMP_alloc(sizeof(int) * dim);
1212 
1213  int shrink_nodes_size = 1;
1214  for(int i=0;i<dim;i++){
1215  new_rank_array[i] = rank_array[i];
1216  if(new_rank_array[i] == _XMP_N_UNSPECIFIED_RANK){
1217  shrink_nodes_size *= (n->info[i].size);
1218  }
1219  }
1220 
1221  nodes_ref->nodes = n;
1222  nodes_ref->ref = new_rank_array;
1223  nodes_ref->shrink_nodes_size = shrink_nodes_size;
1224 
1225  return nodes_ref;
1226 }
Here is the call graph for this function:

◆ _XMP_init_nodes_struct_EXEC()

_XMP_nodes_t* _XMP_init_nodes_struct_EXEC ( int  dim,
int *  dim_size,
int  is_static 
)
393 {
394  _XMP_nodes_t *exec_nodes = _XMP_get_execution_nodes();
395  int size = exec_nodes->comm_size;
396 
397  MPI_Comm *comm = _XMP_alloc(sizeof(MPI_Comm));
398  MPI_Comm_dup(*((MPI_Comm *)exec_nodes->comm), comm);
399 
400  _XMP_nodes_t *n = _XMP_create_new_nodes(_XMP_N_INT_TRUE, dim, size, (_XMP_comm_t *)comm);
401 
402  // calc inherit info
403  _XMP_nodes_t *inherit_nodes = _XMP_get_execution_nodes();
404  n->inherit_nodes = inherit_nodes;
405  n->inherit_info = _XMP_calc_inherit_info(inherit_nodes);
407 
408  // calc info
409  _XMP_init_nodes_info(n, dim_size, is_static);
410 
411  n->info[0].multiplier = 1;
412  for(int i=1;i<dim;i++)
413  n->info[i].multiplier = n->info[i-1].multiplier * dim_size[i-1];
414 
415  return n;
416 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_init_nodes_struct_GLOBAL()

_XMP_nodes_t* _XMP_init_nodes_struct_GLOBAL ( int  dim,
int *  dim_size,
int  is_static 
)
345 {
346  MPI_Comm *comm = _XMP_alloc(sizeof(MPI_Comm));
347  MPI_Comm_dup(MPI_COMM_WORLD, comm);
348 
349  _XMP_nodes_t *n = _XMP_create_new_nodes(_XMP_N_INT_TRUE, dim, _XMP_world_size, (_XMP_comm_t *)comm);
350 
351  // calc inherit info
352  n->inherit_nodes = NULL;
353  n->inherit_info = NULL;
354  n->attr = _XMP_ENTIRE_NODES;
355 
356  // set dim_size if XMP_NODE_SIZEn is set.
357  if(!is_static){
358  is_static = _XMP_N_INT_TRUE;
359  for(int i=0;i<dim;i++){
360  if(dim_size[i] == -1){
361  char name[20];
362  sprintf(name, "XMP_NODE_SIZE%d", i);
363  char *size = getenv(name);
364 
365  if(!size){
366  if(i == dim - 1){
367  is_static = _XMP_N_INT_FALSE;
368  break;
369  }
370  else _XMP_fatal("XMP_NODE_SIZE not specified although '*' is in the dimension of a node array\n");
371  }
372  else{
373  dim_size[i] = atoi(size);
374  if(dim_size[i] <= 0 || dim_size[i] > _XMP_world_size)
375  _XMP_fatal("Wrong value in XMP_NODE_SIZE\n");
376  }
377  }
378  }
379  }
380 
381  _XMP_init_nodes_info(n, dim_size, is_static);
382 
383  n->info[0].multiplier = 1;
384  for(int i=1;i<dim;i++)
385  n->info[i].multiplier = n->info[i-1].multiplier * dim_size[i-1];
386 
387  n->subcomm = create_subcomm(n);
388 
389  return n;
390 }
Here is the caller graph for this function:

◆ _XMP_init_nodes_struct_NODES_NAMED()

_XMP_nodes_t* _XMP_init_nodes_struct_NODES_NAMED ( int  dim,
_XMP_nodes_t ref_nodes,
int *  shrink,
int *  ref_lower,
int *  ref_upper,
int *  ref_stride,
int *  dim_size,
int  is_static 
)
500 {
501  int ref_dim = ref_nodes->dim;
502  int is_ref_member = ref_nodes->is_member;
503  int color = 1;
504  int is_member = _XMP_N_INT_TRUE;
505 
506  if(is_ref_member){
507  int acc_nodes_size = 1;
508  for(int i=0;i<ref_dim;i++){
509  int size = ref_nodes->info[i].size;
510  int rank = ref_nodes->info[i].rank;
511 
512  if(shrink[i]){
513  color += (acc_nodes_size * rank);
514  }
515  else{
516  _XMP_validate_nodes_ref(&ref_lower[i], &ref_upper[i], &ref_stride[i], size);
517  is_member = is_member && _XMP_check_nodes_ref_inclusion(ref_lower[i], ref_upper[i], ref_stride[i], size, rank);
518  }
519 
520  acc_nodes_size *= size;
521  }
522 
523  if(!is_member){
524  color = 0;
525  }
526  }
527  else{
528  is_member = _XMP_N_INT_FALSE;
529  color = 0;
530  }
531 
532  int comm_size = 1;
533  for(int i=0;i<ref_dim;i++)
534  if(!shrink[i])
535  comm_size *= _XMP_M_COUNT_TRIPLETi(ref_lower[i], ref_upper[i], ref_stride[i]);
536 
537  MPI_Comm *comm;
538  int use_subcomm;
539  if(check_subcomm(ref_nodes, ref_lower, ref_upper, ref_stride, shrink)){
540  use_subcomm = _XMP_N_INT_TRUE;
541  comm = (MPI_Comm *)get_subcomm(ref_nodes, ref_lower, ref_upper, ref_stride, shrink);
542  // MPI_Comm_dup(*(MPI_Comm *)get_subcomm(ref_nodes, ref_lower, ref_upper, ref_stride, shrink), comm);
543  }
544  else if(comm_size == 1){
545  use_subcomm = _XMP_N_INT_FALSE;
546  comm = _XMP_alloc(sizeof(MPI_Comm));
547  MPI_Comm_dup(MPI_COMM_SELF, comm);
548  }
549  else{
550  use_subcomm = _XMP_N_INT_FALSE;
551  comm = _XMP_alloc(sizeof(MPI_Comm));
552  MPI_Comm_split(*((MPI_Comm *)ref_nodes->comm), color, _XMP_world_rank, comm);
553  }
554 
555  _XMP_nodes_t *n = _XMP_create_new_nodes(is_member, dim, comm_size, (_XMP_comm_t *)comm);
556 
557  // calc inherit info
558  n->inherit_nodes = ref_nodes;
559  n->inherit_info = _XMP_calc_inherit_info_by_ref(ref_nodes, shrink, ref_lower, ref_upper, ref_stride);
561  n->use_subcomm = use_subcomm;
562 
563  // calc info
564  _XMP_init_nodes_info(n, dim_size, is_static);
565 
566  n->info[0].multiplier = 1;
567  for(int i=1;i<dim;i++)
568  n->info[i].multiplier = n->info[i-1].multiplier * dim_size[i-1];
569 
570  return n;
571 }
Here is the caller graph for this function:

◆ _XMP_init_nodes_struct_NODES_NUMBER()

_XMP_nodes_t* _XMP_init_nodes_struct_NODES_NUMBER ( int  dim,
int  ref_lower,
int  ref_upper,
int  ref_stride,
int *  dim_size,
int  is_static 
)
420 {
421  _XMP_validate_nodes_ref(&ref_lower, &ref_upper, &ref_stride, _XMP_world_size);
422  int is_member = _XMP_check_nodes_ref_inclusion(ref_lower, ref_upper, ref_stride, _XMP_world_size, _XMP_world_rank);
423 
424  MPI_Comm *comm = _XMP_alloc(sizeof(MPI_Comm));
425  MPI_Comm_split(*((MPI_Comm *)(_XMP_get_execution_nodes())->comm), is_member, _XMP_world_rank, comm);
426 
427  _XMP_nodes_t *n = _XMP_create_new_nodes(is_member, dim, _XMP_M_COUNT_TRIPLETi(ref_lower, ref_upper, ref_stride),
428  (_XMP_comm_t *)comm);
429 
430  // calc inherit info
431  int shrink[1] = {_XMP_N_INT_FALSE};
432  int l[1] = {ref_lower};
433  int u[1] = {ref_upper};
434  int s[1] = {ref_stride};
436  n->inherit_info = _XMP_calc_inherit_info_by_ref(_XMP_world_nodes, shrink, l, u, s);
437  n->attr = _XMP_ENTIRE_NODES;
438 
439  // calc info
440  _XMP_init_nodes_info(n, dim_size, is_static);
441 
442  n->info[0].multiplier = 1;
443  for(int i=1;i<dim;i++)
444  n->info[i].multiplier = n->info[i-1].multiplier * dim_size[i-1];
445 
446  n->subcomm = create_subcomm(n);
447 
448  return n;
449 }
Here is the caller graph for this function:

◆ _XMP_init_reflect_sched()

void _XMP_init_reflect_sched ( _XMP_reflect_sched_t sched)
218  {
219  //sched->is_periodic = -1; /* not used yet */
220  sched->reflect_is_initialized = 0;
221  sched->reduce_is_initialized = 0;
222  sched->prev_pcopy_sched_type = 0;
223  sched->datatype_lo = MPI_DATATYPE_NULL;
224  sched->datatype_hi = MPI_DATATYPE_NULL;
225  for (int j = 0; j < 4; j++){
226  sched->req[j] = MPI_REQUEST_NULL;
227  sched->req_reduce[j] = MPI_REQUEST_NULL;
228  }
229  sched->lo_send_buf = NULL;
230  sched->lo_recv_buf = NULL;
231  sched->hi_send_buf = NULL;
232  sched->hi_recv_buf = NULL;
233 }
Here is the caller graph for this function:

◆ _XMP_init_shadow()

void _XMP_init_shadow ( _XMP_array_t array,
  ... 
)
261  {
262  int dim = array->dim;
263  va_list args;
264  va_start(args, array);
265  for (int i = 0; i < dim; i++) {
266  _XMP_array_info_t *ai = &(array->info[i]);
267 
268  int type = va_arg(args, int);
269  switch (type) {
270  case _XMP_N_SHADOW_NONE:
272  break;
274  {
276 
277  int lo = va_arg(args, int);
278  if (lo < 0) {
279  _XMP_fatal("<shadow-width> should be a nonnegative integer");
280  }
281 
282  int hi = va_arg(args, int);
283  if (hi < 0) {
284  _XMP_fatal("<shadow-width> should be a nonnegative integer");
285  }
286 
287  if ((lo == 0) && (hi == 0)) {
289  }
290  else {
292  ai->shadow_size_lo = lo;
293  ai->shadow_size_hi = hi;
294 
295  if (array->is_allocated) {
296  ai->local_lower += lo;
297  ai->local_upper += lo;
298  // ai->local_stride is not changed
299  ai->alloc_size += lo + hi;
300 
301  *(ai->temp0) -= lo;
302  ai->temp0_v -= lo;
303  }
304 
305  if (!ai->reflect_sched){
308  ai->reflect_sched = sched;
309  }
310 #ifdef _XMP_XACC
311  if (!ai->reflect_acc_sched){
314  ai->reflect_acc_sched = sched;
315  }
316 #endif
317 
318  _XMP_create_shadow_comm(array, i);
319  }
320 
321  break;
322  }
323  case _XMP_N_SHADOW_FULL:
324  {
326 
327  if (array->is_allocated) {
328  ai->shadow_size_lo = ai->par_lower - ai->ser_lower;
329  ai->shadow_size_hi = ai->ser_upper - ai->par_upper;
330 
331  ai->local_lower = ai->par_lower - ai->ser_lower;
332  ai->local_upper = ai->par_upper - ai->ser_lower;
333  ai->local_stride = ai->par_stride;
334  ai->alloc_size = ai->ser_size;
335  }
336 
337  _XMP_create_shadow_comm(array, i);
338  break;
339  }
340  default:
341  _XMP_fatal("unknown shadow type");
342  }
343  }
344 }
Here is the call graph for this function:

◆ _XMP_init_template_chunk()

void _XMP_init_template_chunk ( _XMP_template_t template,
_XMP_nodes_t nodes 
)
306 {
307  template->is_distributed = true;
308  template->is_owner = nodes->is_member;
309  template->onto_nodes = nodes;
310  template->chunk = _XMP_alloc(sizeof(_XMP_template_chunk_t) * (template->dim));
311 }
Here is the call graph for this function:

◆ _XMP_init_template_FIXED()

void _XMP_init_template_FIXED ( _XMP_template_t **  template,
int  dim,
  ... 
)
266 {
267  // alloc descriptor
269 
270  // calc info
271  va_list args;
272  va_start(args, dim);
273  for(int i=0;i<dim;i++){
274  t->info[i].ser_lower = va_arg(args, long long);
275  t->info[i].ser_upper = va_arg(args, long long);
276  }
277  va_end(args);
278 
280 
281  *template = t;
282 }
Here is the call graph for this function:

◆ _XMP_init_world()

void _XMP_init_world ( int *  argc,
char ***  argv 
)
12  {
13  int flag = 0;
14  MPI_Initialized(&flag);
15  if (!flag) MPI_Init(argc, argv);
16 
17  MPI_Comm *comm = _XMP_alloc(sizeof(MPI_Comm));
18  MPI_Comm_dup(MPI_COMM_WORLD, comm);
23  _XMP_world_nodes = n;
24  _XMP_push_nodes(n);
25 
26  MPI_Barrier(MPI_COMM_WORLD);
27 }

◆ _XMP_initialize_async_comm_tab()

void _XMP_initialize_async_comm_tab ( )
51 {
52  for(int i=0;i<_XMP_ASYNC_COMM_SIZE;i++){
53  _XMP_async_comm_tab[i].nreqs = 0;
54  _XMP_async_comm_tab[i].nnodes = 0;
55  _XMP_async_comm_tab[i].is_used = false;
56  _XMP_async_comm_tab[i].type = _XMP_COMM_NONE;
57  _XMP_async_comm_tab[i].node = NULL;
58  _XMP_async_comm_tab[i].reqs = NULL;
59  _XMP_async_comm_tab[i].gmove = NULL;
60  _XMP_async_comm_tab[i].a = NULL;
61  _XMP_async_comm_tab[i].next = NULL;
62  }
63 }

◆ _XMP_initialize_onesided_functions()

void _XMP_initialize_onesided_functions ( )
72 {
73 #ifdef _XMP_FJRDMA
74  if(_XMP_world_size > _XMP_ONESIDED_MAX_PROCS){
75  if(_XMP_world_rank == 0)
76  fprintf(stderr, "Warning : Onesided operations cannot be not used in %d processes (up to %d processes)\n",
77  _XMP_world_size, _XMP_ONESIDED_MAX_PROCS);
78 
79  return;
80  }
81 #endif
82 
83 #ifdef _XMP_GASNET
84  size_t _xmp_heap_size, _xmp_stride_size;
85  _xmp_heap_size = _get_size("XMP_ONESIDED_HEAP_SIZE");
86  _xmp_stride_size = _get_size("XMP_ONESIDED_STRIDE_SIZE");
87  _xmp_heap_size += _xmp_stride_size;
88  _XMP_gasnet_initialize(_xmp_heap_size, _xmp_stride_size);
90 #elif _XMP_FJRDMA
92 #elif _XMP_UTOFU
94 #elif _XMP_MPI3_ONESIDED
95  size_t _xmp_heap_size;
96  _xmp_heap_size = _get_size("XMP_ONESIDED_HEAP_SIZE");
97  _XMP_mpi_onesided_initialize(_xmp_heap_size);
98 #endif
99 
100 #ifdef _XMP_TCA
102 #endif
103 
104 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_TCA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
108 #endif
109 
110  /* Temporary */
111  if(getenv("XMP_PUT_NB") != NULL){
112  _XMP_flag_put_nb = true; // defalt false
113  if(_XMP_world_rank == 0)
114  printf("*** _XMP_coarray_contiguous_put() is Non-Blocking ***\n");
115  }
116 
117  if(getenv("XMP_GET_NB") != NULL){
118  _XMP_flag_get_nb = true; // defalt false
119  if(_XMP_world_rank == 0)
120  printf("*** _XMP_coarray_contiguous_get() is Non-Blocking ***\n");
121  }
122 
123 #if defined(_XMP_FJRDMA)
124  if(getenv("XMP_PUT_NB_RR") != NULL){
125  _XMP_flag_put_nb = true; // defalt false
126  _XMP_flag_put_nb_rr = true; // defalt false
127  if(_XMP_world_rank == 0)
128  printf("*** _XMP_coarray_contiguous_put() is Non-Blocking and Round-Robin ***\n");
129  }
130 
131  if(getenv("XMP_PUT_NB_RR_I") != NULL){
132  _XMP_flag_put_nb = true; // defalt false
133  _XMP_flag_put_nb_rr = true; // defalt false
134  _XMP_flag_put_nb_rr_i = true; // defalt false
135  if(_XMP_world_rank == 0)
136  printf("*** _XMP_coarray_contiguous_put() is Non-Blocking, Round-Robin and Immediately ***\n");
137  }
138 #endif
139  /* End Temporary */
140 }
Here is the call graph for this function:

◆ _XMP_L2G()

void _XMP_L2G ( int  local_idx,
long long int *  global_idx,
_XMP_template_t template,
int  template_index 
)
6 {
7  if(! template->is_owner){
8  return;
9  }
10 
11  _XMP_template_chunk_t *chunk = &(template->chunk[template_index]);
12  _XMP_nodes_info_t *n_info = chunk->onto_nodes_info;
13  long long base = template->info[template_index].ser_lower;
14 
15  switch(chunk->dist_manner){
17  //*global_idx = base + local_idx ;
18  *global_idx = local_idx ;
19  break;
20  case _XMP_N_DIST_BLOCK:
21  *global_idx = base + n_info->rank * chunk->par_chunk_width + local_idx;
22  //xmpf_dbg_printf("%d -> %d, base = %d, rank = %d, chunk = %d\n", local_idx, *global_idx, base, n_info->rank, chunk->par_chunk_width);
23  break;
24  case _XMP_N_DIST_CYCLIC:
25  *global_idx = base + n_info->rank + n_info->size * local_idx;
26  break;
28  {
29  int w = chunk->par_width;
30  *global_idx = base + n_info->rank * w
31  + (local_idx/w) * w * n_info->size + local_idx%w;
32  }
33  break;
34  case _XMP_N_DIST_GBLOCK:
35  *global_idx = local_idx + chunk->mapping_array[n_info->rank];
36  break;
37  default:
38  _XMP_fatal("_XMP_: unknown chunk dist_manner");
39  }
40 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_local_get()

void _XMP_local_get ( void *  ,
const _XMP_coarray_t ,
const int  ,
const int  ,
const int  ,
const int  ,
const _XMP_array_section_t ,
const _XMP_array_section_t ,
const  size_t,
const  size_t 
)
600 {
601  size_t dst_offset = _XMP_get_offset(dst_info, dst_dims);
602  size_t src_offset = _XMP_get_offset(src_info, src_dims);
603  size_t elmt_size = src_desc->elmt_size;
604 
605  if(dst_contiguous && src_contiguous)
606  _XMP_local_contiguous_copy((char *)dst+dst_offset, (char *)src_desc->real_addr+src_offset,
607  dst_elmts, src_elmts, elmt_size);
608  else
609  _local_NON_contiguous_copy((char *)dst+dst_offset, (char *)src_desc->real_addr+src_offset,
610  dst_dims, src_dims, dst_info, src_info, dst_elmts, src_elmts, elmt_size);
611 }
Here is the call graph for this function:

◆ _XMP_local_put()

void _XMP_local_put ( _XMP_coarray_t ,
const void *  ,
const int  ,
const int  ,
const int  ,
const int  ,
const _XMP_array_section_t ,
const _XMP_array_section_t ,
const  size_t,
const  size_t 
)
566 {
567  size_t dst_offset = _XMP_get_offset(dst_info, dst_dims);
568  size_t src_offset = _XMP_get_offset(src_info, src_dims);
569  size_t elmt_size = dst_desc->elmt_size;
570 
571  if(dst_contiguous && src_contiguous)
572  _XMP_local_contiguous_copy((char *)dst_desc->real_addr+dst_offset, (char *)src+src_offset,
573  dst_elmts, src_elmts, elmt_size);
574  else
575  _local_NON_contiguous_copy((char *)dst_desc->real_addr+dst_offset, (char *)src+src_offset,
576  dst_dims, src_dims, dst_info, src_info, dst_elmts, src_elmts, elmt_size);
577 }
Here is the call graph for this function:

◆ _XMP_mpi_coarray_deallocate()

void _XMP_mpi_coarray_deallocate ( _XMP_coarray_t ,
bool  is_acc 
)
223 {
225  MPI_Win_unlock_all(c->win);
227  _XMP_mpi_onesided_dealloc_win(&(c->win), (void **)&(c->real_addr), is_acc);
228  }
229 }
Here is the call graph for this function:

◆ _XMP_nodes_dealloc_after_wait_async()

void _XMP_nodes_dealloc_after_wait_async ( _XMP_nodes_t n)
273 {
274  if(_tmp_async->nnodes >= _XMP_MAX_ASYNC_NODES) // Fix me
275  _XMP_fatal("Too many nodes");
276 
277  if(_tmp_async->nnodes == 0)
278  _tmp_async->node = _XMP_alloc(sizeof(_XMP_nodes_t*) * _XMP_MAX_ASYNC_NODES);
279 
280  _tmp_async->node[_tmp_async->nnodes] = n;
281  _tmp_async->nnodes++;
282 }
Here is the caller graph for this function:

◆ _XMP_normalize_array_section()

void _XMP_normalize_array_section ( _XMP_gmv_desc_t gmv_desc,
int  idim,
int *  lower,
int *  upper,
int *  stride 
)
899  {
900  // setup temporary variables
901 
902  //_XMPC_array_t *array = gmv_desc->a_desc;
903  int l, u;
904  int s = *(stride);
905  if (s > 0) {
906  l = *lower;
907  u = *upper;
908  }
909  else if (s < 0) {
910  l = *upper;
911  u = *lower;
912  }
913  else { // s == 0 (scalar), do nothing
914  return;
915  /* if (*lower==0 && *upper==0){ */
916  /* if (gmv_desc->is_global == true){ */
917  /* l = array->info[idim].ser_lower; */
918  /* u = array->info[idim].ser_upper; */
919  /* s = 1; */
920  /* }else{ */
921  /* l = gmv_desc->a_lb[idim]; */
922  /* u = gmv_desc->a_ub[idim]; */
923  /* s = 1; */
924  /* } */
925  /* }else{ */
926  /* l = *lower; */
927  /* u = *lower; */
928  /* s = 1; */
929  /* } */
930  /* // _XMP_fatal("the stride of <array-section> is 0"); */
931  /* // l = 0; u = 0; // XXX dummy */
932  }
933 
934  // normalize values
935  if (s > 0) {
936  u = u - ((u - l) % s);
937  }
938  else {
939  s = -s;
940  l = l + ((u - l) % s);
941  }
942  *lower = l;
943  *upper = u;
944  *stride = s;
945 }

◆ _XMP_pack_vector()

void _XMP_pack_vector ( char *restrict  dst,
char *restrict  src,
int  count,
int  blocklength,
long  stride 
)
10  {
11  long i;
12  if (_xmp_omp_num_procs > 1 && count > 8 * _xmp_omp_num_procs){
13 #pragma omp parallel for private(i)
14  for (i = 0; i < count; i++){
15  memcpy(dst + i * blocklength, src + i * stride, blocklength);
16  }
17  }
18  else {
19  for (i = 0; i < count; i++){
20  memcpy(dst + i * blocklength, src + i * stride, blocklength);
21  }
22  }
23 
24 }
Here is the caller graph for this function:

◆ _XMP_pack_vector2()

void _XMP_pack_vector2 ( char *restrict  dst,
char *restrict  src,
int  count,
int  blocklength,
int  nnodes,
int  type_size,
int  src_block_dim 
)
28  {
29  long j,k;
30  if (src_block_dim == 1){
31 #pragma omp parallel for private(j,k)
32  for (j = 0; j < count; j++){
33  for (k = 0; k < nnodes; k++){
34  memcpy(dst + ((k * count +j ) * blocklength ) * type_size,
35  src + ((k + j * nnodes) * blocklength ) * type_size,
36  blocklength * type_size);
37  }
38  }
39  }
40 }

◆ _XMP_pop_n_free_nodes()

void _XMP_pop_n_free_nodes ( void  )
31 {
32  _XMP_nodes_dish_t *freed_dish = _XMP_nodes_stack_top;
33  _XMP_nodes_stack_top = freed_dish->prev;
34  _XMP_finalize_nodes(freed_dish->nodes);
35  _XMP_free(freed_dish);
36 }

◆ _XMP_pop_n_free_nodes_wo_finalize_comm()

void _XMP_pop_n_free_nodes_wo_finalize_comm ( void  )
39 {
40  _XMP_nodes_dish_t *freed_dish = _XMP_nodes_stack_top;
41  _XMP_nodes_stack_top = freed_dish->prev;
42  _XMP_free(freed_dish->nodes);
43  _XMP_free(freed_dish);
44 }

◆ _XMP_pop_nodes()

void _XMP_pop_nodes ( void  )
24 {
25  _XMP_nodes_dish_t *freed_dish = _XMP_nodes_stack_top;
26  _XMP_nodes_stack_top = freed_dish->prev;
27  _XMP_free(freed_dish);
28 }

◆ _XMP_push_comm()

void _XMP_push_comm ( _XMP_comm_t comm)

◆ _XMP_push_nodes()

void _XMP_push_nodes ( _XMP_nodes_t nodes)
16 {
17  _XMP_nodes_dish_t *new_dish = _XMP_alloc(sizeof(_XMP_nodes_dish_t));
18  new_dish->nodes = nodes;
19  new_dish->prev = _XMP_nodes_stack_top;
20  _XMP_nodes_stack_top = new_dish;
21 }
Here is the call graph for this function:

◆ _XMP_reduce_CLAUSE()

void _XMP_reduce_CLAUSE ( void *  data_addr,
int  count,
int  datatype,
int  op 
)
351  {
353 
354  // setup information
355  MPI_Datatype mpi_datatype = MPI_INT; // dummy
356  size_t datatype_size; // not used in this function
357  MPI_Op mpi_op = MPI_SUM; // dummy
358  _XMP_setup_reduce_type(&mpi_datatype, &datatype_size, datatype);
359  _XMP_setup_reduce_op(&mpi_op, op);
360 
361  // reduce
362  MPI_Allreduce(MPI_IN_PLACE, data_addr, count, mpi_datatype, mpi_op, *((MPI_Comm *)(_XMP_get_execution_nodes())->comm));
363 }
Here is the call graph for this function:

◆ _XMP_reduce_NODES_ENTIRE()

void _XMP_reduce_NODES_ENTIRE ( _XMP_nodes_t nodes,
void *  addr,
int  count,
int  datatype,
int  op 
)
217  {
218  if (count == 0) {
219  return; // FIXME not good implementation
220  }
221 
222  if (!nodes->is_member) {
223  return;
224  }
225 
226  // setup information
227  MPI_Datatype mpi_datatype = MPI_INT; //dummy
228  size_t datatype_size;
229  MPI_Op mpi_op = MPI_SUM; // dummy
230  _XMP_setup_reduce_type(&mpi_datatype, &datatype_size, datatype);
231  _XMP_setup_reduce_op(&mpi_op, op);
232 
233 #ifdef _XMP_MPI3
234  if(xmp_is_async()){
236  MPI_Iallreduce(MPI_IN_PLACE, addr, count, mpi_datatype, mpi_op, *((MPI_Comm *)nodes->comm),
237  &async->reqs[async->nreqs]);
238  async->nreqs++;
239  }
240  else
241 #endif
242  MPI_Allreduce(MPI_IN_PLACE, addr, count, mpi_datatype, mpi_op, *((MPI_Comm *)nodes->comm));
243 }
Here is the call graph for this function:

◆ _XMP_reduce_shadow_sum()

void _XMP_reduce_shadow_sum ( _XMP_array_t a)
154 {
155  int type_size = a->type_size;
156 
157  for (int i = 0; i < a->dim; i++){
158 
159  _XMP_array_info_t *ai = &(a->info[i]);
160  _XMP_reflect_sched_t *shadow_sched = ai->reflect_sched;
161 
162  if (!shadow_sched) continue;
163 
164  int lwidth = shadow_sched->lo_width;
165  int uwidth = shadow_sched->hi_width;
166  int is_periodic = shadow_sched->is_periodic;
167 
168  if (ai->shadow_type == _XMP_N_SHADOW_NORMAL){
169 
170  int target_dim = ai->align_template_index;
171  int my_pos = a->align_template->chunk[target_dim].onto_nodes_info->rank;
172  int lb_pos = _XMP_get_owner_pos(a, i, ai->ser_lower);
173  int ub_pos = _XMP_get_owner_pos(a, i, ai->ser_upper);
174 
175  // for lower reduce_shadow
176  if (lwidth && (is_periodic || my_pos != ub_pos)){
178  (char *)shadow_sched->lo_send_array,
179  (char *)shadow_sched->lo_send_buf,
180  shadow_sched->count, lwidth * shadow_sched->blocklength / type_size,
181  shadow_sched->stride / type_size);
182  }
183 
184  // for upper reduce_shadow
185  if (uwidth && (is_periodic || my_pos != lb_pos)){
187  (char *)shadow_sched->hi_send_array,
188  (char *)shadow_sched->hi_send_buf,
189  shadow_sched->count, uwidth * shadow_sched->blocklength / type_size,
190  shadow_sched->stride / type_size);
191  }
192 
193  }
194 
195  }
196 
197 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_reduce_shadow_wait()

void _XMP_reduce_shadow_wait ( _XMP_array_t a)
128 {
129  for (int i = 0; i < a->dim; i++){
130 
131  _XMP_array_info_t *ai = &(a->info[i]);
132  _XMP_reflect_sched_t *shadow_sched = ai->reflect_sched;
133 
134  if (!shadow_sched) continue;
135 
136  int lwidth = shadow_sched->lo_width;
137  int uwidth = shadow_sched->hi_width;
138 
139  if (!lwidth && !uwidth) continue;
140 
141  if (ai->shadow_type == _XMP_N_SHADOW_NORMAL){
142  MPI_Waitall(4, shadow_sched->req_reduce, MPI_STATUSES_IGNORE);
143  }
144  else if (ai->shadow_type == _XMP_N_SHADOW_FULL){
145  ;
146  }
147 
148  }
149 
150 }

◆ _XMP_reflect__()

void _XMP_reflect__ ( _XMP_array_t a)
120 {
121 
122  int is_ordinal = 1;
123 
124  //_XMP_RETURN_IF_SINGLE;
125  if (!a->is_allocated){
126  _xmp_set_reflect_flag = 0;
127  return;
128  }
129 
130  if (!_xmp_set_reflect_flag){
131  for (int i = 0; i < a->dim; i++){
132  _XMP_array_info_t *ai = &(a->info[i]);
133  _xmp_lwidth[i] = ai->shadow_size_lo;
134  _xmp_uwidth[i] = ai->shadow_size_hi;
135  _xmp_is_periodic[i] = 0;
136  }
137  }
138 
139  _XMP_TSTART(t0);
140  for (int i = 0; i < a->dim; i++){
141 
142  _XMP_array_info_t *ai = &(a->info[i]);
143 
144  if (ai->shadow_type == _XMP_N_SHADOW_NONE){
145  continue;
146  }
147  else if (ai->shadow_type == _XMP_N_SHADOW_NORMAL){
148 
149  _XMP_reflect_sched_t *reflect = ai->reflect_sched;
150 
151  if (_xmp_lwidth[i] || _xmp_uwidth[i]){
152 
153  _XMP_ASSERT(reflect);
154 
155  /* if (!reflect->reflect_is_initialized || */
156  /* _xmp_lwidth[i] != reflect->lo_width || */
157  /* _xmp_uwidth[i] != reflect->hi_width || */
158  /* _xmp_is_periodic[i] != reflect->is_periodic){ */
159 
160  /* reflect->lo_width = _xmp_lwidth[i]; */
161  /* reflect->hi_width = _xmp_uwidth[i]; */
162  /* reflect->is_periodic = _xmp_is_periodic[i]; */
163 
164  /* if (_xmp_reflect_pack_flag){ */
165  /* _XMP_reflect_pcopy_sched_dim(a, i, _xmp_lwidth[i], _xmp_uwidth[i], _xmp_is_periodic[i], 0); */
166  /* } */
167  /* else { */
168  /* _XMP_reflect_normal_sched_dim(a, i, _xmp_lwidth[i], _xmp_uwidth[i], _xmp_is_periodic[i]); */
169  /* } */
170 
171  /* reflect->reflect_is_initialized = 1; */
172  /* } */
173 
174  if (!reflect->reflect_is_initialized ||
175  _xmp_lwidth[i] != reflect->lo_width ||
176  _xmp_uwidth[i] != reflect->hi_width ||
177  _xmp_is_periodic[i] != reflect->is_periodic){
178 
180  _XMP_reflect_pcopy_sched_dim(a, i, _xmp_lwidth[i], _xmp_uwidth[i], _xmp_is_periodic[i], _XMP_COMM_REFLECT);
181  }
182  else {
183  _XMP_reflect_normal_sched_dim(a, i, _xmp_lwidth[i], _xmp_uwidth[i], _xmp_is_periodic[i]);
184  }
185 
186  reflect->reflect_is_initialized = 1;
187  reflect->lo_width = _xmp_lwidth[i];
188  reflect->hi_width = _xmp_uwidth[i];
189  reflect->is_periodic = _xmp_is_periodic[i];
190  }
191 
192  if (_xmp_reflect_pack_flag && reflect->req[0] != MPI_REQUEST_NULL){
193  _XMP_TSTART(t0);
194  _XMP_reflect_pack_dim(a, i, _xmp_lwidth, _xmp_uwidth, _xmp_is_periodic, _XMP_COMM_REFLECT);
195  _XMP_TEND(xmptiming_.t_copy, t0);
196  }
197 
198  _XMP_TSTART(t0);
199  if (reflect->req[0] != MPI_REQUEST_NULL) // if req[0] isn't null, any others shouldn't be null.
200  MPI_Startall(4, reflect->req);
201  _XMP_TEND2(xmptiming_.t_comm, xmptiming_.tdim_comm[i], t0);
202 
203  if (is_ordinal){
204  _XMP_TSTART(t0);
205  MPI_Waitall(4, reflect->req, MPI_STATUSES_IGNORE);
206  _XMP_TEND2(xmptiming_.t_wait, xmptiming_.tdim_wait[i], t0);
207  if (_xmp_reflect_pack_flag && reflect->req[0] != MPI_REQUEST_NULL){
208  _XMP_TSTART(t0);
209  _XMP_reflect_unpack_dim(a, i, _xmp_lwidth, _xmp_uwidth, _xmp_is_periodic);
210  _XMP_TEND(xmptiming_.t_copy, t0);
211  }
212  }
213 
214  }
215 
216  }
217  else { /* _XMP_N_SHADOW_FULL */
219  }
220 
221  }
222  _XMP_TEND(xmptiming_.t_sched, t0);
223 
224  // t0 = MPI_Wtime();
225  if (!is_ordinal)
226  _XMP_reflect_wait(a, _xmp_lwidth, _xmp_uwidth, _xmp_is_periodic);
227  // t_wait = t_wait + (MPI_Wtime() - t0);
228 
229  _xmp_set_reflect_flag = 0;
230  for (int i = 0; i < a->dim; i++){
231  _xmp_lwidth[i] = 0;
232  _xmp_uwidth[i] = 0;
233  _xmp_is_periodic[i] = 0;
234  }
235 
236 }

◆ _XMP_reflect_async__()

void _XMP_reflect_async__ ( _XMP_array_t a,
int  async_id 
)
942  {
943 
944  int is_ordinal = 1;
945 
946  //_XMP_RETURN_IF_SINGLE;
947  if (!a->is_allocated){
948  _xmp_set_reflect_flag = 0;
949  return;
950  }
951 
952  if (!_xmp_set_reflect_flag){
953  for (int i = 0; i < a->dim; i++){
954  _XMP_array_info_t *ai = &(a->info[i]);
955  if (ai->shadow_type == _XMP_N_SHADOW_FULL){
956  _XMP_fatal("asynchronous reflect for full shadow not supported.");
957  }
958  _xmp_lwidth[i] = ai->shadow_size_lo;
959  _xmp_uwidth[i] = ai->shadow_size_hi;
960  _xmp_is_periodic[i] = 0;
961  }
962  }
963 
964  int reflect_ndims = 0;
965  for (int i = 0; i < a->dim; i++){
966  if (_xmp_lwidth[i] || _xmp_uwidth[i]){
967  reflect_ndims++;
968  }
969  }
970 
971  if (reflect_ndims == 0){
972  return;
973  }
974  else if (reflect_ndims == 1 || !is_ordinal){
975  _XMP_reflect_async_cardinal(a, async_id);
976  }
977  else {
978  _XMP_reflect_async_ordinal(a, async_id);
979  }
980 
981  _xmp_set_reflect_flag = 0;
982  for (int i = 0; i < a->dim; i++){
983  _xmp_lwidth[i] = 0;
984  _xmp_uwidth[i] = 0;
985  _xmp_is_periodic[i] = 0;
986  }
987 
988 }

◆ _XMP_reflect_shadow_FULL()

void _XMP_reflect_shadow_FULL ( void *  array_addr,
_XMP_array_t array_desc,
int  array_index 
)
726  {
728 
729  if (!array_desc->is_allocated) {
730  return;
731  }
732 
733  _XMP_array_info_t *ai = &(array_desc->info[array_index]);
734  if ((ai->shadow_comm_size) == 1) {
735  return;
736  }
737 
738  int array_dim = array_desc->dim;
739 
740  // using allgather/allgatherv in special cases
741  if ((array_dim == 1) && (ai->align_manner == _XMP_N_ALIGN_BLOCK) && (ai->is_regular_chunk)) {
742  _XMP_reflect_shadow_FULL_ALLGATHER(array_addr, array_desc, array_index);
743  }
744  else {
745  _XMP_reflect_shadow_FULL_BCAST(array_addr, array_desc, array_index);
746  }
747 }

◆ _XMP_sched_loop_template_BLOCK()

void _XMP_sched_loop_template_BLOCK ( int  ser_init,
int  ser_cond,
int  ser_step,
int *  par_init,
int *  par_cond,
int *  par_step,
_XMP_template_t template,
int  template_index 
)
198  {
199  _XMP_ASSERT(template->is_distributed);
200 
201  if (!template->is_owner) {
202  *par_init = 0;
203  *par_cond = 0;
204  *par_step = 1;
205  return;
206  }
207 
208  _XMP_template_info_t *template_info = &(template->info[template_index]);
209  int template_ser_lower = template_info->ser_lower;
210 
211  _XMP_template_chunk_t *template_chunk = &(template->chunk[template_index]);
212  int template_lower = template_chunk->par_lower;
213  int template_upper = template_chunk->par_upper;
214  int template_stride = template_chunk->par_stride;
215  int chunk_width = template_chunk->par_chunk_width;
216 
217  int reverse_iter = _XMP_N_INT_FALSE;
218  _XMP_SM_NORM_SCHED_PARAMS(ser_init, ser_cond, ser_step, reverse_iter)
219 
220  // calc par_init, par_cond, par_step
221  if (_XMP_sched_loop_template_width_1(ser_init, ser_cond, ser_step, par_init, par_cond, par_step,
222  template_lower, template_upper, template_stride)) {
223  *par_init = _XMP_SM_GTOL_BLOCK(*par_init, template_ser_lower, chunk_width);
224  *par_cond = _XMP_SM_GTOL_BLOCK(*par_cond, template_ser_lower, chunk_width);
225  *par_step = ser_step;
226 
227  // finalize iter
228  _XMP_SM_FINALIZE_ITER(par_init, par_cond, par_step, reverse_iter);
229  } else {
230  *par_init = 0;
231  *par_cond = 0;
232  *par_step = 1;
233  }
234 
235  /* // */
236  /* // for EXPAND/MARGIN */
237  /* // */
238 
239  /* if (expand_type == _XMP_LOOP_NONE){ */
240  /* return; */
241  /* } */
242  /* else if (expand_type == _XMP_LOOP_EXPAND){ */
243 
244  /* if ((*par_init) <= (*par_cond)){ // iterates at least once */
245  /* (*par_init) -= lwidth; */
246  /* (*par_cond) += uwidth; */
247  /* } */
248 
249  /* } */
250  /* else if (expand_type == _XMP_LOOP_MARGIN){ */
251 
252  /* if ((*par_init) <= (*par_cond)){ // iterates at least once */
253 
254  /* if (lwidth > 0){ */
255  /* (*par_init) -= lwidth; */
256  /* (*par_cond) = (*par_init) + lwidth; */
257  /* } */
258  /* else if (lwidth < 0){ */
259  /* (*par_cond) = (*par_init) - lwidth; */
260  /* // (*par_init) */
261  /* } */
262  /* else if (uwidth > 0){ */
263  /* (*par_cond) += uwidth; */
264  /* (*par_init) = (*par_cond) - uwidth; */
265  /* } */
266  /* else if (uwidth < 0){ */
267  /* (*par_init) = (*par_cond) + uwidth; */
268  /* // (*par_cond) */
269  /* } */
270 
271  /* } */
272 
273  /* } */
274 
275  /* if (unbound_flag == 0){ */
276 
277  /* long long int ser_init2; */
278  /* _XMP_L2G(*par_init, &ser_init2, template, template_index); */
279  /* if (ser_init2 < ser_init){ */
280  /* (*par_init) += lwidth; */
281  /* } */
282 
283  /* long long int ser_cond2; */
284  /* _XMP_L2G(*par_cond-1, &ser_cond2, template, template_index); */
285  /* // because (*par_cond) is (upper_bound + 1). */
286  /* if (ser_cond2 > ser_cond){ */
287  /* (*par_cond) -= uwidth; */
288  /* } */
289  /* } */
290 
291 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_sched_loop_template_BLOCK_CYCLIC()

void _XMP_sched_loop_template_BLOCK_CYCLIC ( int  ser_init,
int  ser_cond,
int  ser_step,
int *  par_init,
int *  par_cond,
int *  par_step,
_XMP_template_t template,
int  template_index 
)
337  {
338  _XMP_ASSERT(template->is_distributed);
339 
340  if (!template->is_owner) {
341  *par_init = 0;
342  *par_cond = 0;
343  *par_step = 1;
344  return;
345  }
346 
347  _XMP_template_info_t *template_info = &(template->info[template_index]);
348  int template_ser_lower = template_info->ser_lower;
349  int template_ser_upper = template_info->ser_upper;
350 
351  _XMP_template_chunk_t *template_chunk = &(template->chunk[template_index]);
352  int nodes_size = (template_chunk->onto_nodes_info)->size;
353  int template_lower = template_chunk->par_lower;
354  int template_upper = template_chunk->par_upper;
355  int template_stride = template_chunk->par_stride;
356  int width = template_chunk->par_width;
357 
358  int reverse_iter = _XMP_N_INT_FALSE;
359  _XMP_SM_NORM_SCHED_PARAMS(ser_init, ser_cond, ser_step, reverse_iter)
360 
361  // calc par_init, par_cond, par_step
362  if (_XMP_sched_loop_template_width_N(ser_init, ser_cond, ser_step, par_init, par_cond, par_step,
363  template_lower, template_upper, template_stride,
364  width, template_ser_lower, template_ser_upper)) {
365  *par_init = _XMP_SM_GTOL_BLOCK_CYCLIC(width, *par_init, template_ser_lower, nodes_size);
366  *par_cond = _XMP_SM_GTOL_BLOCK_CYCLIC(width, *par_cond, template_ser_lower, nodes_size);
367  *par_step = 1;
368 
369  // finalize iter
370  _XMP_SM_FINALIZE_ITER(par_init, par_cond, par_step, reverse_iter);
371  } else {
372  *par_init = 0;
373  *par_cond = 0;
374  *par_step = 1;
375  }
376 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_sched_loop_template_CYCLIC()

void _XMP_sched_loop_template_CYCLIC ( int  ser_init,
int  ser_cond,
int  ser_step,
int *  par_init,
int *  par_cond,
int *  par_step,
_XMP_template_t template,
int  template_index 
)
296  {
297  _XMP_ASSERT(template->is_distributed);
298 
299  if (!template->is_owner) {
300  *par_init = 0;
301  *par_cond = 0;
302  *par_step = 1;
303  return;
304  }
305 
306  _XMP_template_info_t *template_info = &(template->info[template_index]);
307  int template_ser_lower = template_info->ser_lower;
308 
309  _XMP_template_chunk_t *template_chunk = &(template->chunk[template_index]);
310  int nodes_size = (template_chunk->onto_nodes_info)->size;
311  int template_lower = template_chunk->par_lower;
312  int template_upper = template_chunk->par_upper;
313  int template_stride = template_chunk->par_stride;
314 
315  int reverse_iter = _XMP_N_INT_FALSE;
316  _XMP_SM_NORM_SCHED_PARAMS(ser_init, ser_cond, ser_step, reverse_iter)
317 
318  // calc par_init, par_cond, par_step
319  if (_XMP_sched_loop_template_width_1(ser_init, ser_cond, ser_step, par_init, par_cond, par_step,
320  template_lower, template_upper, template_stride)) {
321  *par_init = _XMP_SM_GTOL_CYCLIC(*par_init, template_ser_lower, nodes_size);
322  *par_cond = _XMP_SM_GTOL_CYCLIC(*par_cond, template_ser_lower, nodes_size);
323  *par_step = 1;
324 
325  // finalize iter
326  _XMP_SM_FINALIZE_ITER(par_init, par_cond, par_step, reverse_iter);
327  } else {
328  *par_init = 0;
329  *par_cond = 0;
330  *par_step = 1;
331  }
332 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_sched_loop_template_DUPLICATION()

void _XMP_sched_loop_template_DUPLICATION ( int  ser_init,
int  ser_cond,
int  ser_step,
int *  par_init,
int *  par_cond,
int *  par_step,
_XMP_template_t template,
int  template_index 
)
165  {
166  _XMP_ASSERT(template->is_distributed); // FIXME too strict?
167 
168  if (!template->is_owner) {
169  *par_init = 0;
170  *par_cond = 0;
171  *par_step = 1;
172  return;
173  }
174 
175  _XMP_template_chunk_t *template_chunk = &(template->chunk[template_index]);
176  int template_lower = template_chunk->par_lower;
177  int template_upper = template_chunk->par_upper;
178  int template_stride = template_chunk->par_stride;
179 
180  int reverse_iter = _XMP_N_INT_FALSE;
181  _XMP_SM_NORM_SCHED_PARAMS(ser_init, ser_cond, ser_step, reverse_iter)
182 
183  // calc par_init, par_cond, par_step
184  if (_XMP_sched_loop_template_width_1(ser_init, ser_cond, ser_step, par_init, par_cond, par_step,
185  template_lower, template_upper, template_stride)) {
186  // finalize iter
187  _XMP_SM_FINALIZE_ITER(par_init, par_cond, par_step, reverse_iter);
188  } else {
189  *par_init = 0;
190  *par_cond = 0;
191  *par_step = 1;
192  }
193 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_sched_loop_template_GBLOCK()

void _XMP_sched_loop_template_GBLOCK ( int  ser_init,
int  ser_cond,
int  ser_step,
int *  par_init,
int *  par_cond,
int *  par_step,
_XMP_template_t template,
int  template_index 
)
381  {
382 
383  _XMP_ASSERT(template->is_distributed);
384 
385  if (!template->is_owner) {
386  *par_init = 0;
387  *par_cond = 0;
388  *par_step = 1;
389  return;
390  }
391 
392  _XMP_template_chunk_t *template_chunk = &(template->chunk[template_index]);
393  int rank = template_chunk->onto_nodes_info->rank;
394  int template_lower = template_chunk->par_lower;
395  int template_upper = template_chunk->par_upper;
396  int template_stride = template_chunk->par_stride;
397  long long *mapping_array = template_chunk->mapping_array;
398 
399  int reverse_iter = _XMP_N_INT_FALSE;
400  _XMP_SM_NORM_SCHED_PARAMS(ser_init, ser_cond, ser_step, reverse_iter)
401 
402  // calc par_init, par_cond, par_step
403  if (_XMP_sched_loop_template_width_1(ser_init, ser_cond, ser_step, par_init, par_cond, par_step,
404  template_lower, template_upper, template_stride)) {
405 
406  *par_init = _XMP_SM_GTOL_GBLOCK(*par_init, mapping_array[rank]);
407  *par_cond = _XMP_SM_GTOL_GBLOCK(*par_cond, mapping_array[rank]);
408  *par_step = ser_step;
409 
410  // finalize iter
411  _XMP_SM_FINALIZE_ITER(par_init, par_cond, par_step, reverse_iter);
412  } else {
413  *par_init = 0;
414  *par_cond = 0;
415  *par_step = 1;
416  }
417 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_sched_loop_template_width_1()

int _XMP_sched_loop_template_width_1 ( int  ser_init,
int  ser_cond,
int  ser_step,
int *  par_init,
int *  par_cond,
int *  par_step,
int  template_lower,
int  template_upper,
int  template_stride 
)
55  {
56  int x, x_max = _XMP_floori((template_upper - template_lower), template_stride);
57  if (ser_step == 1) {
58  // calc par_init
59  x = _XMP_ceili((ser_init - template_lower), template_stride);
60  if (x < 0) {
61  *par_init = template_lower;
62  } else if (x > x_max) {
63  return _XMP_N_INT_FALSE;
64  } else {
65  *par_init = (x * template_stride) + template_lower;
66  }
67 
68  // calc par_cond
69  x = _XMP_floori((ser_cond - template_lower), template_stride);
70  if (x < 0) {
71  return _XMP_N_INT_FALSE;
72  } else if (x > x_max) {
73  *par_cond = template_upper;
74  } else {
75  *par_cond = (x * template_stride) + template_lower;
76  }
77 
78  // calc par_step
79  *par_step = template_stride;
80  } else {
81  if ((template_upper < ser_init) || (ser_cond < template_lower)) {
82  return _XMP_N_INT_FALSE;
83  }
84 
85  // calc par_init
86  for (int i = template_lower; i <= template_upper; i += template_stride) {
87  if (i < ser_init) {
88  continue;
89  } else if (((i - ser_init) % ser_step) == 0) {
90  *par_init = i;
91  goto calc_par_cond;
92  }
93  }
94  return _XMP_N_INT_FALSE;
95 
96 calc_par_cond:
97  // calc par_cond
98  for (int i = template_upper; i >= template_lower; i -= template_stride) {
99  if (i > ser_cond) {
100  continue;
101  } else if (((i - ser_init) % ser_step) == 0) {
102  *par_cond = i;
103  goto calc_par_step;
104  }
105  }
106  return _XMP_N_INT_FALSE;
107 
108 calc_par_step:
109  // calc par_step
110  *par_step = _XMP_lcm(ser_step, template_stride);
111  }
112 
113  return _XMP_N_INT_TRUE;
114 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_sched_loop_template_width_N()

int _XMP_sched_loop_template_width_N ( int  ser_init,
int  ser_cond,
int  ser_step,
int *  par_init,
int *  par_cond,
int *  par_step,
int  template_lower,
int  template_upper,
int  template_stride,
int  width,
int  template_ser_lower,
int  template_ser_upper 
)
119  {
120  int si = ((ser_init - template_ser_lower) / width) + template_ser_lower;
121  int sc = ((ser_cond - template_ser_lower) / width) + template_ser_lower;
122  int tl = ((template_lower - template_ser_lower) / width) + template_ser_lower;
123  int tu = ((template_upper - template_ser_lower) / width) + template_ser_lower;
124  int ts = template_stride / width;
125 
126  /* FIXME HOW IMPLEMENT??? */
127  if (ser_step != 1) {
128  _XMP_fatal("loop step is not 1, -1: unsupported case");
129  }
130 
131  if (_XMP_sched_loop_template_width_1(si, sc, 1, par_init, par_cond, par_step, tl, tu, ts)) {
132  // init par_init
133  int par_init_temp = ((*par_init - template_ser_lower) * width) + template_ser_lower;
134  if (par_init_temp < ser_init) {
135  *par_init = ser_init;
136  } else {
137  *par_init = par_init_temp;
138  }
139 
140  // init par_cond
141  int par_cond_temp = ((*par_cond - template_ser_lower) * width) + template_ser_lower + width - 1;
142  if (par_cond_temp > template_ser_upper) {
143  par_cond_temp = template_ser_upper;
144  }
145 
146  if (par_cond_temp > ser_cond) {
147  *par_cond = ser_cond;
148  } else {
149  *par_cond = par_cond_temp;
150  }
151 
152  // init par_step
153  // FIXME how implement???
154 
155  return _XMP_N_INT_TRUE;
156  } else {
157  return _XMP_N_INT_FALSE;
158  }
159 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_set_reflect__()

void _XMP_set_reflect__ ( _XMP_array_t a,
int  dim,
int  lwidth,
int  uwidth,
int  is_periodic 
)
64 {
65  _xmp_set_reflect_flag = 1;
66  _xmp_lwidth[dim] = lwidth;
67  _xmp_uwidth[dim] = uwidth;
68  _xmp_is_periodic[dim] = is_periodic;
69 }

◆ _XMP_sort()

void _XMP_sort ( _XMP_array_t a_desc,
_XMP_array_t b_desc,
int  is_up 
)
92  {
93 
94  void *a_adr = a_desc->array_addr_p;
95  int a_lshadow = a_desc->info[0].shadow_size_lo;
96 
97  int a_size = a_desc->info[0].ser_size;
98  int a_ndims = a_desc->dim;
99  int a_type = a_desc->type;
100 
101  int b_size = b_desc->info[0].ser_size;
102  int b_ndims = b_desc->dim;
103  int b_type = b_desc->type;
104 
105  if (a_size != b_size) _XMP_fatal("xmp_sort: different size for array arguments");
106  if (a_ndims != 1 || b_ndims != 1) _XMP_fatal("xmp_sort: array arguments must be one-dimensional");
107  if (a_type != b_type) _XMP_fatal("xmp_sort: different type for array arguments");
108 
109  int lsize = a_desc->info[0].par_size;
110 
111  comm = a_desc->array_nodes->comm;
112  me = a_desc->array_nodes->comm_rank;
113  nprocs = a_desc->array_nodes->comm_size;
114 
115  set_funcs(a_desc, is_up);
116  datasize = a_desc->type_size;
117 
118  do_sort((char *)a_adr + a_lshadow * datasize, lsize, b_desc);
119 
120 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_split_world_by_color()

int _XMP_split_world_by_color ( int  color)
42  {
43  int new_comm_rank;
44  MPI_Comm new_comm;
45  MPI_Comm_split(MPI_COMM_WORLD, color, _XMP_world_rank, &new_comm);
46  MPI_Comm_rank(new_comm, &new_comm_rank);
47  MPI_Comm_free(&new_comm);
48 
49  return new_comm_rank;
50 }

◆ _XMP_sync_images_EXEC()

void _XMP_sync_images_EXEC ( int *  status)
1100 {
1103 }
Here is the call graph for this function:

◆ _XMP_threads_finalize()

void _XMP_threads_finalize ( void  )
7  {
8  return;
9 }

◆ _XMP_threads_init()

void _XMP_threads_init ( void  )
3  {
4  return;
5 }

◆ _XMP_translate_nodes_rank_array_to_ranks()

void _XMP_translate_nodes_rank_array_to_ranks ( _XMP_nodes_t nodes,
int *  ranks,
int *  rank_array,
int  shrink_nodes_size 
)
1271 {
1272  int calc_flag = _XMP_N_INT_TRUE;
1273  int nodes_dim = nodes->dim;
1274 
1275  for(int i=0;i<nodes_dim;i++){
1276  if(rank_array[i] == _XMP_N_UNSPECIFIED_RANK){
1277  calc_flag = _XMP_N_INT_FALSE;
1278  int nodes_size = nodes->info[i].size;
1279  int new_shrink_nodes_size = shrink_nodes_size / nodes_size;
1280  for(int j=0;j<nodes_size;j++){
1281  rank_array[i] = j;
1282  _XMP_translate_nodes_rank_array_to_ranks(nodes, ranks + (j * new_shrink_nodes_size), rank_array, new_shrink_nodes_size);
1283  }
1284  }
1285  }
1286 
1287  if(calc_flag)
1288  *ranks = _XMP_calc_linear_rank(nodes, rank_array);
1289 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_unexpected_error()

void _XMP_unexpected_error ( void  )
54 {
55  _XMP_fatal("unexpected error in runtime");
56 }
Here is the call graph for this function:

◆ _XMP_unpack_vector()

void _XMP_unpack_vector ( char *restrict  dst,
char *restrict  src,
int  count,
int  blocklength,
long  stride 
)
43  {
44  long i;
45  if (_xmp_omp_num_procs > 1 && count > 8 * _xmp_omp_num_procs){
46 #pragma omp parallel for private(i)
47  for (i = 0; i < count; i++){
48  memcpy(dst + i * stride, src + i * blocklength, blocklength);
49  }
50  }
51  else {
52  for (i = 0; i < count; i++){
53  memcpy(dst + i * stride, src + i * blocklength, blocklength);
54  }
55  }
56 
57 }

◆ _XMP_wait_async__()

void _XMP_wait_async__ ( int  async_id)
88 {
89  _XMP_async_comm_t *async;
90 
91  if(!(async = _XMP_get_async(async_id))) return;
92 
93  int nreqs = async->nreqs;
94  MPI_Request *reqs = async->reqs;
95 
96 #if defined(_KCOMPUTER) && defined(K_RDMA_REFLECT)
97  // For RDMA reflects, async->nreqs > 0 and async->reqs == NULL.
98  if(nreqs && !reqs){
99  _XMP_wait_async_rdma(async);
100  return;
101  }
102 #endif
103 
104  _XMP_async_gmove_t *gmove = async->gmove;
105 
106  if (async->type == _XMP_COMM_REDUCE_SHADOW){
107  MPI_Waitall(nreqs, reqs, MPI_STATUSES_IGNORE);
108  _XMP_reduce_shadow_sum(async->a);
109  }
110  else if (!gmove || gmove->mode == _XMP_N_GMOVE_NORMAL){
111  _XMP_TSTART(t0);
112  MPI_Waitall(nreqs, reqs, MPI_STATUSES_IGNORE);
113  _XMP_TEND(xmptiming_.t_wait, t0);
114  }
115 
116  //
117  // for asynchronous gmove
118  //
119 
120  if (gmove){
121  if (gmove->mode == _XMP_N_GMOVE_NORMAL) _XMP_finalize_async_gmove(gmove);
122 #ifdef _XMP_MPI3_ONESIDED
123  else {
124  int status;
125  // NOTE: the send_buf field is used for an improper purpose.
126  _XMP_sync_images_COMM((MPI_Comm *)gmove->sendbuf, &status);
127  }
128 #endif
129  }
130 
131 }
Here is the call graph for this function:

◆ _XMP_warning()

void _XMP_warning ( char *  msg)
58  {
59  fprintf(stderr, "[RANK:%d] XcalableMP runtime warning: %s\n", _XMP_world_rank, msg);
60 }
Here is the caller graph for this function:

◆ _XMPC_pack_array()

void _XMPC_pack_array ( void *  buffer,
void *  src,
int  array_type,
size_t  array_type_size,
int  array_dim,
int *  l,
int *  u,
int *  s,
unsigned long long *  d 
)
1351  {
1352  if (array_type >= _XMP_N_TYPE_FLOAT_COMPLEX && array_type <= _XMP_N_TYPE_NONBASIC) {
1353  /*_XMP_N_TYPE_FLOAT_COMPLEX || _XMP_N_TYPE_DOUBLE_COMPLEX ||
1354  _XMP_N_TYPE_LONG_DOUBLE_COMPLEX ||
1355  _XMP_N_TYPE_NONBASIC */
1356  _XMPC_pack_array_GENERAL(buffer, src, array_type_size, array_dim, l, u, s, d);
1357 #ifdef __STD_IEC_559_COMPLEX__
1358  } else if (array_type >= _XMP_N_TYPE_FLOAT_IMAGINARY && array_type <= _XMP_N_TYPE_LONG_DOUBLE_IMAGINARY) {
1359  /* _XMP_N_TYPE_FLOAT_IMAGINARY || _XMP_N_TYPE_DOUBLE_IMAGINARY ||
1360  _XMP_N_TYPE_LONG_DOUBLE_IMAGINARY */
1361  _XMPC_pack_array_GENERAL(buffer, src, array_type_size, array_dim, l, u, s, d);
1362 #endif
1363  } else {
1364  _XMPC_pack_array_BASIC(buffer, src, array_type, array_dim, l, u, s, d);
1365  }
1366 }
Here is the call graph for this function:

◆ _XMPC_unpack_array()

void _XMPC_unpack_array ( void *  dst,
void *  buffer,
int  array_type,
size_t  array_type_size,
int  array_dim,
int *  l,
int *  u,
int *  s,
unsigned long long *  d 
)
1369  {
1370  if (array_type >= _XMP_N_TYPE_FLOAT_COMPLEX && array_type <= _XMP_N_TYPE_NONBASIC) {
1371  /*_XMP_N_TYPE_FLOAT_COMPLEX || _XMP_N_TYPE_DOUBLE_COMPLEX ||
1372  _XMP_N_TYPE_LONG_DOUBLE_COMPLEX ||
1373  _XMP_N_TYPE_NONBASIC */
1374  _XMPC_unpack_array_GENERAL(dst, buffer, array_type_size, array_dim, l, u, s, d);
1375 #ifdef __STD_IEC_559_COMPLEX__
1376  } else if (array_type >= _XMP_N_TYPE_FLOAT_IMAGINARY && array_type <= _XMP_N_TYPE_LONG_DOUBLE_IMAGINARY) {
1377  /* _XMP_N_TYPE_FLOAT_IMAGINARY || _XMP_N_TYPE_DOUBLE_IMAGINARY ||
1378  _XMP_N_TYPE_LONG_DOUBLE_IMAGINARY */
1379  _XMPC_unpack_array_GENERAL(dst, buffer, array_type_size, array_dim, l, u, s, d);
1380 #endif
1381  } else {
1382  _XMPC_unpack_array_BASIC(dst, buffer, array_type, array_dim, l, u, s, d);
1383  }
1384 }
Here is the call graph for this function:

◆ _XMPF_reduce_FLMM_NODES_ENTIRE()

void _XMPF_reduce_FLMM_NODES_ENTIRE ( _XMP_nodes_t nodes,
void *  addr,
int  count,
int  datatype,
int  op,
int  num_locs,
void **  loc_vars,
int *  loc_types 
)
298  {
299 
300  if (count == 0) {
301  return; // FIXME not good implementation
302  }
303 
304  if (!nodes->is_member) {
305  return;
306  }
307 
308  // setup information
309  MPI_Datatype mpi_datatype;
310  size_t datatype_size;
311  MPI_Op mpi_op;
312  _XMP_setup_reduce_type(&mpi_datatype, &datatype_size, datatype);
313  _XMP_setup_reduce_op(&mpi_op, op);
314 
315  // reduce <reduction-variable>
316  size_t n = datatype_size * count;
317  void *temp_buffer = _XMP_alloc(n);
318  memcpy(temp_buffer, addr, n);
319 
320  MPI_Allreduce(temp_buffer, addr, count, mpi_datatype, mpi_op, *((MPI_Comm *)nodes->comm));
321 
322  // compare results
323  n = sizeof(int) * count;
324  int *cmp_buffer = _XMP_alloc(n);
325  _XMP_compare_reduce_results(cmp_buffer, temp_buffer, addr, count, datatype);
326 
327  // reduce <location-variable>
328  for (int i = 0; i < num_locs; i++) {
329  void *loc = loc_vars[i];
330  int loc_datatype = loc_types[i];
331 
332  _XMP_setup_reduce_type(&mpi_datatype, &datatype_size, loc_datatype);
333  _XMP_setup_reduce_FLMM_op(&mpi_op, op);
334  _XMP_init_localtion_variables(loc, count, loc_datatype, cmp_buffer, op);
335 
336  n = datatype_size * count;
337  void *loc_temp = _XMP_alloc(n);
338  memcpy(loc_temp, loc, n);
339 
340  MPI_Allreduce(loc_temp, loc, count, mpi_datatype, mpi_op, *((MPI_Comm *)nodes->comm));
341 
342  _XMP_free(loc_temp);
343  }
344 
345  _XMP_free(temp_buffer);
346  _XMP_free(cmp_buffer);
347 }
Here is the call graph for this function:

◆ _XMPF_unpack_transpose_vector()

void _XMPF_unpack_transpose_vector ( char *restrict  dst,
char *restrict  src,
int  dst_stride,
int  src_stride,
int  type_size,
int  dst_block_dim 
)
61  {
62  long i,j;
63  if (dst_block_dim == 1){
64  if (type_size == 16){
65  long ii,jj,imin,jmin,nblk=16;
66  double _Complex *dst0 = (double _Complex *)dst;
67  double _Complex *src0 = (double _Complex *)src;
68  for (jj = 0; jj < src_stride; jj+=nblk){
69  jmin=((jj+nblk) < src_stride)? (jj+nblk):src_stride;
70 #pragma omp parallel for private(i,j,ii,imin)
71  for (ii = 0; ii < dst_stride; ii+=nblk){
72  imin=((ii+nblk) < dst_stride)? (ii+nblk):dst_stride;
73  for (j = jj; j < jmin; j++){
74  for (i = ii; i < imin; i++){
75  dst0[j * dst_stride + i] = src0[i * src_stride + j];
76  }
77  }
78  }
79  }
80  }
81  else {
82  for (j = 0; j < src_stride; j++){
83  for (i = 0; i < dst_stride; i++){
84  memcpy(dst + (j * dst_stride + i) * type_size,
85  src + (i * src_stride + j) * type_size, type_size);
86  }
87  }
88  }
89  }
90 }

◆ alloc_csd()

_XMP_csd_t* alloc_csd ( int  n)
164  {
165  _XMP_csd_t *csd = (_XMP_csd_t *)_XMP_alloc(sizeof(_XMP_csd_t));
166  csd->l = (int *)_XMP_alloc(sizeof(int) * n);
167  csd->u = (int *)_XMP_alloc(sizeof(int) * n);
168  csd->n = n;
169  return csd;
170 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsd2csd()

_XMP_csd_t* bsd2csd ( _XMP_bsd_t bsd)
224  {
225 
226  if (!bsd) return NULL;
227 
228  _XMP_csd_t *csd = alloc_csd(bsd->b);
229  csd->n = bsd->b;
230 
231  for (int i = 0; i < bsd->b; i++){
232  csd->l[i] = bsd->l + i;
233  int t = (bsd->u - csd->l[i]) / bsd->c;
234  csd->u[i] = csd->l[i] + bsd->c * t;
235  }
236 
237  csd->s = bsd->c;
238 
239  return csd;
240 
241 }
Here is the call graph for this function:

◆ copy_csd()

_XMP_csd_t* copy_csd ( _XMP_csd_t csd)
182  {
183  _XMP_csd_t *new_csd = alloc_csd(csd->n);
184  for (int i = 0; i < csd->n; i++){
185  new_csd->l[i] = csd->l[i];
186  new_csd->u[i] = csd->u[i];
187  }
188  new_csd->s = csd->s;
189  return new_csd;
190 }
Here is the call graph for this function:

◆ csd2comm_set()

_XMP_comm_set_t* csd2comm_set ( _XMP_csd_t csd)
244  {
245 
246  if (!csd || csd->n == 0) return NULL;
247 
249 
250  _XMP_comm_set_t *comm_set = comm_set0;
251  comm_set->l = csd->l[0];
252  comm_set->u = csd->l[0];
253  comm_set->next = NULL;
254 
255  for (int j = 0; csd->l[0] + j <= csd->u[0]; j+= csd->s){
256 
257  for (int i = 0; i < csd->n; i++){
258 
259  int l = csd->l[i] + j;
260 
261  if (l > csd->u[i]) continue;
262 
263  if (l == comm_set->u + 1){
264  comm_set->u = l;
265  }
266  else if (l <= comm_set->u){
267  continue;
268  }
269  else {
270  comm_set->next = (_XMP_comm_set_t *)malloc(sizeof(_XMP_comm_set_t));
271  comm_set = comm_set->next;
272  comm_set->l = l;
273  comm_set->u = l;
274  comm_set->next = NULL;
275  }
276  }
277 
278  }
279 
280  return comm_set0;
281 
282 }
Here is the call graph for this function:

◆ free_comm_set()

void free_comm_set ( _XMP_comm_set_t comm_set)
202  {
203 
204  while (comm_set){
205  _XMP_comm_set_t *next = comm_set->next;
206  _XMP_free(comm_set);
207  comm_set = next;
208  }
209 
210 }
Here is the call graph for this function:

◆ free_csd()

void free_csd ( _XMP_csd_t csd)
173  {
174  if (csd){
175  _XMP_free(csd->l);
176  _XMP_free(csd->u);
177  _XMP_free(csd);
178  }
179 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_csd_size()

int get_csd_size ( _XMP_csd_t csd)
193  {
194  int size = 0;
195  for (int i = 0; i < csd->n; i++){
196  size += _XMP_M_COUNT_TRIPLETi(csd->l[i], csd->u[i], csd->s);
197  }
198  return size;
199 }

◆ intersection_csds()

_XMP_csd_t* intersection_csds ( _XMP_csd_t csd1,
_XMP_csd_t csd2 
)
116  {
117 
118  if (!csd1 || !csd2) return NULL;
119 
120  _XMP_csd_t *csd0 = alloc_csd(MAX(csd1->n, csd2->n));
121 
122  int k = 0;
123 
124  csd0->n = 0;
125 
126  for (int i = 0; i < csd1->n; i++){
127  for (int j = 0; j < csd2->n; j++){
128 
129  _XMP_rsd_t *tmp = NULL;
130  _XMP_rsd_t rsd1 = { csd1->l[i], csd1->u[i], csd1->s };
131  _XMP_rsd_t rsd2 = { csd2->l[j], csd2->u[j], csd2->s };
132 
133  tmp = intersection_rsds(&rsd1, &rsd2);
134 
135  if (tmp){
136 
137  csd0->l[k] = tmp->l;
138  csd0->u[k] = tmp->u;
139 
140  // bubble sort
141  int p = k;
142  while (csd0->l[p-1] > tmp->l && p > 0){
143  int s;
144  s = csd0->l[p-1]; csd0->l[p-1] = csd0->l[p]; csd0->l[p] = s;
145  s = csd0->u[p-1]; csd0->u[p-1] = csd0->u[p]; csd0->u[p] = s;
146  p--;
147  }
148 
149  csd0->n++;
150  csd0->s = tmp->s;
151  k++;
152 
153  _XMP_free(tmp);
154  }
155 
156  }
157  }
158 
159  return csd0;
160 
161 }
Here is the call graph for this function:

◆ intersection_rsds()

_XMP_rsd_t* intersection_rsds ( _XMP_rsd_t _rsd1,
_XMP_rsd_t _rsd2 
)
82  {
83 
84  _XMP_rsd_t *rsd1, *rsd2;
85 
86  if (!_rsd1 || !_rsd2) return NULL;
87 
88  if (_rsd1->l <= _rsd2->l){
89  rsd1 = _rsd1;
90  rsd2 = _rsd2;
91  }
92  else {
93  rsd1 = _rsd2;
94  rsd2 = _rsd1;
95  }
96 
97  if (rsd2->l <= rsd1->u){
98  int min_u = MIN(rsd1->u, rsd2->u);
99  for (int i = rsd2->l; i <= min_u; i += rsd2->s){
100  if ((i - rsd1->l) % rsd1->s == 0){
101  _XMP_rsd_t *rsd0 = (_XMP_rsd_t *)_XMP_alloc(sizeof(_XMP_rsd_t));
102  rsd0->l = i;
103  rsd0->s = _XMP_lcm(rsd1->s, rsd2->s);
104  int t = (min_u - rsd0->l) / rsd0->s;
105  rsd0->u = rsd0->l + rsd0->s * t;
106  return rsd0;
107  }
108  }
109  }
110 
111  return NULL;
112 
113 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_bsd()

void print_bsd ( _XMP_bsd_t bsd)
22  {
23  if (!bsd){
24  printf("()\n");
25  }
26  else {
27  printf("(%d : %d : %d : %d)\n", bsd->l, bsd->u, bsd->b, bsd->c);
28  }
29 }

◆ print_comm_set()

void print_comm_set ( _XMP_comm_set_t comm_set0)
62  {
63 
64  if (!comm_set0){
65  printf("()\n");
66  return;
67  }
68 
69  _XMP_comm_set_t *comm_set = comm_set0;
70 
71  printf("(%d : %d)", comm_set->l, comm_set->u);
72 
73  while ((comm_set = comm_set->next)){
74  printf(", (%d : %d)", comm_set->l, comm_set->u);
75  }
76 
77  printf("\n");
78 
79 }

◆ print_csd()

void print_csd ( _XMP_csd_t csd)
32  {
33 
34  if (!csd || csd->n == 0){
35  printf("()\n");
36  return;
37  }
38 
39  printf("(");
40 
41  printf("(%d", csd->l[0]);
42  for (int i = 1; i < csd->n; i++){
43  printf(", %d", csd->l[i]);
44  }
45  printf(")");
46 
47  printf(" : ");
48 
49  printf("(%d", csd->u[0]);
50  for (int i = 1; i < csd->n; i++){
51  printf(", %d", csd->u[i]);
52  }
53  printf(")");
54 
55  printf(" : ");
56 
57  printf("%d)\n", csd->s);
58 
59 }

◆ print_rsd()

void print_rsd ( _XMP_rsd_t rsd)
6  {
7 
8  if (!rsd){
9  printf("()\n");
10  return;
11  }
12 
13  if (rsd->s){
14  printf("(%d : %d : %d)\n", rsd->l, rsd->u, rsd->s);
15  }
16  else {
17  printf("()\n");
18  }
19 }

◆ reduce_csd()

void reduce_csd ( _XMP_csd_t csd[_XMP_N_MAX_DIM],
int  ndims 
)
285  {
286 
287  for (int i = 0; i < ndims; i++){
288  if (!csd[i] || csd[i]->n == 0){
289  for (int j = 0; j < ndims; j++){
290  free_csd(csd[j]);
291  csd[j] = NULL;
292  }
293  return;
294  }
295  }
296 
297 }
Here is the call graph for this function:

◆ rsd2csd()

_XMP_csd_t* rsd2csd ( _XMP_rsd_t rsd)
213  {
214  if (!rsd) return NULL;
215  _XMP_csd_t *csd = alloc_csd(1);
216  csd->l[0] = rsd->l;
217  csd->u[0] = rsd->u;
218  csd->n = 1;
219  csd->s = rsd->s;
220  return csd;
221 }
Here is the call graph for this function:

◆ xmp_get_ruuning()

int xmp_get_ruuning ( )
26 {
27  return _XMP_runtime_working;
28 }

◆ xmp_is_async()

_Bool xmp_is_async ( )
21 {
22  return _xmp_is_async;
23 }
Here is the caller graph for this function:

◆ xmp_reduce_initialize()

void xmp_reduce_initialize ( )
554 {
555  MPI_Op_create(_reduce_maxloc, 1, &_xmp_maxloc);
556  MPI_Op_create(_reduce_minloc, 1, &_xmp_minloc);
557 }

◆ xmpc_end_async()

void xmpc_end_async ( int  )
328 {
329  int hash_id = async_id % _XMP_ASYNC_COMM_SIZE;
330  _XMP_async_comm_t *async = &_XMP_async_comm_tab[hash_id];
331 
332  if(!async->is_used) return;
333 
334  // The case no comm. registered for async_id 0 and xmpc_end_async called for
335  // async_id == 0, may occur and is inconsistent.
336  // But, actually, the code below works without problems in such a case, even if
337  // no hash_id == 0.
338  if(async->async_id == async_id){
339  if(async->next == NULL){
340  initialize_async(async);
341  }
342  else{
343  _XMP_async_comm_t *next = async->next;
344  initialize_async(async);
345  async->async_id = next->async_id;
346  async->nreqs = next->nreqs;
347  async->nnodes = next->nnodes;
348  async->is_used = next->is_used;
349  async->type = next->type;
350  async->node = next->node;
351  async->gmove = next->gmove;
352  async->reqs = next->reqs;
353  async->a = next->a;
354  async->next = next->next;
355  _XMP_free(next);
356  }
357  return;
358  }
359  else{
360  _XMP_async_comm_t *prev = async;
361  while((async = prev->next)){
362  if(async->async_id == async_id){
363  prev->next = async->next;
364  initialize_async(async);
365  _XMP_free(async);
366  return;
367  }
368  prev = async;
369  }
370  }
371 }

◆ xmpc_ltog()

int xmpc_ltog ( int  local_idx,
_XMP_template_t template,
int  template_index,
int  offset 
)
756 {
757  /*long long*/ int global_index = 0;
758  _XMP_template_chunk_t *chunk = &(template->chunk[dim]);
759  _XMP_nodes_info_t *n_info = chunk->onto_nodes_info;
760  long long base = template->info[dim].ser_lower;
761 
762  switch(chunk->dist_manner){
764  global_index = local_idx;
765  break;
766  case _XMP_N_DIST_BLOCK:
767  global_index = base + n_info->rank * chunk->par_chunk_width + local_idx;
768  break;
769  case _XMP_N_DIST_CYCLIC:
770  global_index = base + n_info->rank + n_info->size * local_idx;
771  break;
773  {
774  int w = chunk->par_width;
775  global_index = base + n_info->rank * w
776  + (local_idx/w) * w * n_info->size + local_idx%w;
777  }
778  break;
779  case _XMP_N_DIST_GBLOCK:
780  global_index = local_idx + chunk->mapping_array[n_info->rank];
781  default:
782  _XMP_fatal("_XMP_: unknown chunk dist_manner");
783  }
784 
785  return global_index - offset;
786 
787 }
Here is the call graph for this function:

◆ xmpf_matmul()

void xmpf_matmul ( void *  x_p,
void *  a_p,
void *  b_p 
)
3912 {
3913  xmpf_running = 1;
3914  xmp_matmul(x_p, a_p, b_p);
3915  xmpf_running = 0;
3916 }

◆ xmpf_pack()

void xmpf_pack ( void *  v_p,
void *  a_p,
void *  m_p 
)
6008 {
6009  xmpf_running = 1;
6010  xmp_pack(v_p, a_p, m_p);
6011  xmpf_running = 0;
6012 }

◆ xmpf_pack_mask()

void xmpf_pack_mask ( void *  v_p,
void *  a_p,
void *  m_p 
)
6016 {
6017  xmpf_running = 1;
6018  xmp_pack(v_p, a_p, m_p);
6019  xmpf_running = 0;
6020 }

◆ xmpf_pack_nomask()

void xmpf_pack_nomask ( void *  v_p,
void *  a_p 
)
6024 {
6025  xmpf_running = 1;
6026  xmp_pack(v_p, a_p, NULL);
6027  xmpf_running = 0;
6028 }

◆ xmpf_transpose()

void xmpf_transpose ( void *  dst_p,
void *  src_p,
int  opt 
)
1466 {
1467  xmpf_running = 1;
1468  xmp_transpose(dst_p, src_p, opt);
1469  xmpf_running = 0;
1470 }

◆ xmpf_unpack()

void xmpf_unpack ( void *  a_p,
void *  v_p,
void *  m_p 
)
6308 {
6309  xmpf_running = 1;
6310  xmp_unpack(a_p, v_p, m_p);
6311  xmpf_running = 0;
6312 }

◆ xmpf_unpack_mask()

void xmpf_unpack_mask ( void *  a_p,
void *  v_p,
void *  m_p 
)
6316 {
6317  xmpf_running = 1;
6318  xmp_unpack(a_p, v_p, m_p);
6319  xmpf_running = 0;
6320 }

◆ xmpf_unpack_nomask()

void xmpf_unpack_nomask ( void *  a_p,
void *  v_p 
)
6324 {
6325  xmpf_running = 1;
6326  xmp_unpack(a_p, v_p, NULL);
6327  xmpf_running = 0;
6328 }

Variable Documentation

◆ _XMP_coarray_list_head

_XMP_coarray_list_t* _XMP_coarray_list_head

◆ _XMP_coarray_list_tail

_XMP_coarray_list_t* _XMP_coarray_list_tail

◆ _xmp_pack_array

void(* _xmp_pack_array) (void *buffer, void *src, int array_type, size_t array_type_size, int array_dim, int *l, int *u, int *s, unsigned long long *d)

◆ _xmp_unpack_array

void(* _xmp_unpack_array) (void *dst, void *buffer, int array_type, size_t array_type_size, int array_dim, int *l, int *u, int *s, unsigned long long *d)

◆ _XMP_world_nodes

void* _XMP_world_nodes

◆ _XMP_world_rank

int _XMP_world_rank

◆ _XMP_world_size

int _XMP_world_size

◆ _XMPC_running

int _XMPC_running

◆ _XMPF_running

int _XMPF_running
_XMPC_running
int _XMPC_running
Definition: xmp_runtime.c:15
_XMP_COMM_NONE
#define _XMP_COMM_NONE
Definition: xmp_constant.h:135
_XMP_array_info_type::align_subscript
long long align_subscript
Definition: xmp_data_struct.h:246
_XMP_calc_template_par_triplet
int _XMP_calc_template_par_triplet(_XMP_template_t *template, int template_index, int nodes_rank, int *template_lower, int *template_upper, int *template_stride)
Definition: xmp_template.c:667
_XMP_reflect_sched_type::is_periodic
int is_periodic
Definition: xmp_data_struct.h:126
_XMP_get_owner_pos
int _XMP_get_owner_pos(_XMP_array_t *a, int dim, int index)
Definition: xmp_reflect.c:1688
_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_calc_linear_rank_on_target_nodes
int _XMP_calc_linear_rank_on_target_nodes(_XMP_nodes_t *n, int *rank_array, _XMP_nodes_t *target_nodes)
Definition: xmp_nodes.c:1049
_XMP_SM_GTOL_BLOCK_CYCLIC
#define _XMP_SM_GTOL_BLOCK_CYCLIC(_b, _i, _m, _P)
Definition: xmp_loop.c:11
_XMP_barrier_EXEC
void _XMP_barrier_EXEC(void)
Definition: xmp_barrier.c:16
_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_nodes_inherit_info_type::shrink
int shrink
Definition: xmp_data_struct.h:21
_XMP_flag_put_nb
int _XMP_flag_put_nb
These variables are temporral.
Definition: xmp_onesided.c:5
_XMP_ASYNC_COMM_SIZE
#define _XMP_ASYNC_COMM_SIZE
Definition: xmp_data_struct.h:471
_XMP_create_temporary_nodes
_XMP_nodes_t * _XMP_create_temporary_nodes(_XMP_nodes_t *n)
Definition: xmp_nodes.c:257
_XMP_nodes_type::comm_size
int comm_size
Definition: xmp_data_struct.h:48
_XMP_N_TYPE_BOOL
#define _XMP_N_TYPE_BOOL
Definition: xmp_constant.h:80
_XMP_template_type::info
_XMP_template_info_t info[1]
Definition: xmp_data_struct.h:115
_XMP_N_TYPE_INT
#define _XMP_N_TYPE_INT
Definition: xmp_constant.h:85
_XMP_MAX_ASYNC_NODES
#define _XMP_MAX_ASYNC_NODES
Definition: xmp_data_struct.h:473
_XMP_utofu_finalize
void _XMP_utofu_finalize(void)
Definition: xmp_onesided_utofu.c:79
_XMP_init_tca
void _XMP_init_tca(void)
Definition: xmp_tca_runtime.c:4
_XMP_template_info_type::ser_size
unsigned long long ser_size
Definition: xmp_data_struct.h:74
_XMP_nodes_type::use_subcomm
int use_subcomm
Definition: xmp_data_struct.h:55
_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_N_DIST_BLOCK
#define _XMP_N_DIST_BLOCK
Definition: xmp_constant.h:29
_XMP_nodes_type::subcomm
_XMP_comm_t * subcomm
Definition: xmp_data_struct.h:54
_XMP_gmove_garray_scalar
void _XMP_gmove_garray_scalar(_XMP_gmv_desc_t *gmv_desc_leftp, void *scalar, int mode)
Definition: xmp_gmove.c:4732
_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_rsd_type::u
int u
Definition: xmp_data_struct.h:411
_XMP_M_CEILi
#define _XMP_M_CEILi(a_, b_)
Definition: xmp_gpu_func.hpp:22
xmp_is_async
_Bool xmp_is_async()
Definition: xmp_async.c:20
_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_gmv_desc_type::lb
int * lb
Definition: xmp_data_struct.h:398
_XMP_N_NO_ONTO_NODES
#define _XMP_N_NO_ONTO_NODES
Definition: xmp_constant.h:24
_XMP_finalize_nodes
void _XMP_finalize_nodes(void *nodes)
_XMP_push_nodes
void _XMP_push_nodes(_XMP_nodes_t *nodes)
Definition: xmp_nodes_stack.c:15
_XMP_reflect_sched_type::datatype_hi
MPI_Datatype datatype_hi
Definition: xmp_data_struct.h:129
_XMP_async_comm::next
struct _XMP_async_comm * next
Definition: xmp_data_struct.h:468
_XMPC_pack_array_BASIC
void _XMPC_pack_array_BASIC(void *buffer, void *src, int array_type, int array_dim, int *l, int *u, int *s, unsigned long long *d)
Definition: xmp_array_section.c:947
_XMP_array_info_type
Definition: xmp_data_struct.h:194
_XMP_nodes_type::inherit_nodes
struct _XMP_nodes_type * inherit_nodes
Definition: xmp_data_struct.h:57
_XMP_gmv_desc_type::st
int * st
Definition: xmp_data_struct.h:400
_XMP_array_info_type::reflect_acc_sched
_XMP_reflect_sched_t * reflect_acc_sched
Definition: xmp_data_struct.h:253
_XMP_SM_FINALIZE_ITER
#define _XMP_SM_FINALIZE_ITER(par_init, par_cond, par_step, reverse_iter)
Definition: xmp_loop.c:40
_XMP_template_type::chunk
_XMP_template_chunk_t * chunk
Definition: xmp_data_struct.h:112
_XMP_SM_GTOL_GBLOCK
#define _XMP_SM_GTOL_GBLOCK(_i, _g)
Definition: xmp_loop.c:14
_XMP_csd_type::n
int n
Definition: xmp_data_struct.h:433
xmpc_traverse_init
void xmpc_traverse_init()
_XMP_SM_GTOL_CYCLIC
#define _XMP_SM_GTOL_CYCLIC(_i, _m, _P)
Definition: xmp_loop.c:8
_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_transpose
void xmp_transpose(void *dst_p, void *src_p, int opt)
Definition: xmp_intrinsic.c:1245
_XMP_csd_type::u
int * u
Definition: xmp_data_struct.h:432
_coarray_queue_t::num
int num
How many coarrays are in this queue.
Definition: xmp_coarray.c:20
xmp_unpack
void xmp_unpack(void *a_p, void *v_p, void *m_p)
Definition: xmp_intrinsic.c:6031
_XMP_calc_nodes_index_from_inherit_nodes_index
int _XMP_calc_nodes_index_from_inherit_nodes_index(_XMP_nodes_t *nodes, int inherit_nodes_index)
Definition: xmp_nodes.c:1309
_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_reflect_async_cardinal
void _XMP_reflect_async_cardinal(_XMP_array_t *a, int async_id)
Definition: xmp_reflect.c:991
_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_N_GMOVE_NORMAL
#define _XMP_N_GMOVE_NORMAL
Definition: xmp_constant.h:69
_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_async_gmove::sendbuf
void * sendbuf
Definition: xmp_data_struct.h:451
_XMP_EQUIVALENCE_NODES
#define _XMP_EQUIVALENCE_NODES
Definition: xmp_constant.h:124
free_csd
void free_csd(_XMP_csd_t *csd)
Definition: xmp_section_desc.c:173
_XMP_gmv_desc_type::ub
int * ub
Definition: xmp_data_struct.h:399
_XMP_calc_gmove_array_owner_linear_rank_SCALAR
int _XMP_calc_gmove_array_owner_linear_rank_SCALAR(_XMP_array_t *array, int *ref_index)
Definition: xmp_gmove.c:216
_XMP_template_chunk_type::par_lower
long long par_lower
Definition: xmp_data_struct.h:80
_XMP_gasnet_finalize
void _XMP_gasnet_finalize()
Finalize GASNet job.
Definition: xmp_onesided_gasnet.c:77
_XMP_bsd_type::u
int u
Definition: xmp_data_struct.h:421
_XMP_init_nodes_ref
_XMP_nodes_ref_t * _XMP_init_nodes_ref(_XMP_nodes_t *n, int *rank_array)
Definition: xmp_nodes.c:1207
_XMP_world_size
int _XMP_world_size
Definition: xmp_world.c:8
_XMP_get_array_addr
void * _XMP_get_array_addr(_XMP_array_t *a, int *gidx)
Definition: xmp_gmove.c:47
_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_mpi_coarray_lastly_deallocate
void _XMP_mpi_coarray_lastly_deallocate(bool is_acc)
Deallocate memory region when calling _XMP_coarray_lastly_deallocate()
Definition: xmp_coarray_mpi.c:216
_XMP_array_info_type::shadow_comm_size
int shadow_comm_size
Definition: xmp_data_struct.h:256
_XMPC_pack_array_GENERAL
void _XMPC_pack_array_GENERAL(void *buffer, void *src, size_t array_type_size, int array_dim, int *l, int *u, int *s, unsigned long long *d)
Definition: xmp_array_section.c:1134
_XMP_utofu_initialize
void _XMP_utofu_initialize(void)
Definition: xmp_onesided_utofu.c:5
_XMP_world_nodes
void * _XMP_world_nodes
Definition: xmp_world.c:10
_XMP_bsd_type::b
int b
Definition: xmp_data_struct.h:422
_XMP_reflect_sched_type::lo_recv_buf
void * lo_recv_buf
Definition: xmp_data_struct.h:134
_XMP_SM_NORM_SCHED_PARAMS
#define _XMP_SM_NORM_SCHED_PARAMS(ser_init, ser_cond, ser_step, reverse_iter)
Definition: xmp_loop.c:17
alloc_csd
_XMP_csd_t * alloc_csd(int n)
Definition: xmp_section_desc.c:164
datasize
size_t datasize
Definition: xmp_sort.c:68
_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_mpi_sync_memory
void _XMP_mpi_sync_memory()
Execute sync_memory.
Definition: xmp_coarray_mpi.c:542
_XMP_finalize_world
void _XMP_finalize_world(void)
_XMP_async_comm::gmove
_XMP_async_gmove_t * gmove
Definition: xmp_data_struct.h:466
_XMP_nodes_dish_type::prev
struct _XMP_nodes_dish_type * prev
Definition: xmp_nodes_stack.c:10
_XMP_gmv_desc_type::a_ub
int * a_ub
Definition: xmp_data_struct.h:395
_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)
min
#define min(x, y)
Definition: xmp_template.c:404
_XMP_N_GMOVE_OUT
#define _XMP_N_GMOVE_OUT
Definition: xmp_constant.h:71
_XMP_gasnet_build_sync_images_table
void _XMP_gasnet_build_sync_images_table()
Build table and Initialize for sync images.
Definition: xmp_coarray_gasnet.c:1600
_XMP_TEND
#define _XMP_TEND(t, t0)
Definition: xmp_internal.h:748
_XMP_init_reflect_sched_acc
void _XMP_init_reflect_sched_acc(_XMP_reflect_sched_t *sched)
Definition: xmp_reflect_acc.c:74
_XMP_init_nodes_struct_NODES_NAMED
_XMP_nodes_t * _XMP_init_nodes_struct_NODES_NAMED(int dim, _XMP_nodes_t *ref_nodes, int *shrink, int *ref_lower, int *ref_upper, int *ref_stride, int *dim_size, int is_static)
Definition: xmp_nodes.c:498
_xmp_reflect_pack_flag
int _xmp_reflect_pack_flag
Definition: xmp_pack_vector.c:298
_XMP_calc_coord_on_target_nodes2
_Bool _XMP_calc_coord_on_target_nodes2(_XMP_nodes_t *n, int *ncoord, _XMP_nodes_t *target_n, int *target_ncoord)
Definition: xmp_nodes.c:1090
_XMP_sched_loop_template_width_1
int _XMP_sched_loop_template_width_1(int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, int template_lower, int template_upper, int template_stride)
Definition: xmp_loop.c:53
_XMP_async_comm::type
int type
Definition: xmp_data_struct.h:463
_XMP_template_chunk_type::onto_nodes_info
_XMP_nodes_info_t * onto_nodes_info
Definition: xmp_data_struct.h:94
_XMP_reflect_sched_type::req
MPI_Request req[4]
Definition: xmp_data_struct.h:131
_XMP_check_template_ref_inclusion
int _XMP_check_template_ref_inclusion(int ref_lower, int ref_upper, int ref_stride, _XMP_template_t *t, int index)
Definition: xmp_template.c:243
_XMP_initialize_async_comm_tab
void _XMP_initialize_async_comm_tab()
Definition: xmp_async.c:50
_XMP_nodes_dish_type::nodes
_XMP_nodes_t * nodes
Definition: xmp_nodes_stack.c:9
_XMP_nodes_ref_type::shrink_nodes_size
int shrink_nodes_size
Definition: xmp_data_struct.h:66
_XMP_calc_global_index_HOMECOPY
int _XMP_calc_global_index_HOMECOPY(_XMP_array_t *dst_array, int dst_dim_index, int *dst_l, int *dst_u, int *dst_s, int *src_l, int *src_u, int *src_s)
Definition: xmp_gmove.c:404
_XMP_template_type::is_fixed
_Bool is_fixed
Definition: xmp_data_struct.h:104
_XMP_rsd_type::l
int l
Definition: xmp_data_struct.h:410
_XMP_calc_linear_rank_on_target_nodes
int _XMP_calc_linear_rank_on_target_nodes(_XMP_nodes_t *n, int *rank_array, _XMP_nodes_t *target_nodes)
Definition: xmp_nodes.c:1049
_XMP_SM_GTOL_CYCLIC
#define _XMP_SM_GTOL_CYCLIC(_i, _m, _P)
Definition: xmp_gmove.c:16
_XMPC_unpack_array_GENERAL
void _XMPC_unpack_array_GENERAL(void *dst, void *buffer, size_t array_type_size, int array_dim, int *l, int *u, int *s, unsigned long long *d)
Definition: xmp_array_section.c:1336
xmp_matmul
void xmp_matmul(void *x_p, void *a_p, void *b_p)
Definition: xmp_intrinsic.c:3785
_XMP_calc_linear_rank
int _XMP_calc_linear_rank(_XMP_nodes_t *n, int *rank_array)
Definition: xmp_nodes.c:1035
_XMP_gmove_array_array_common
void _XMP_gmove_array_array_common(_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int *dst_l, int *dst_u, int *dst_s, unsigned long long *dst_d, int *src_l, int *src_u, int *src_s, unsigned long long *src_d, int mode)
Definition: xmp_gmove.c:2036
_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_nodes_type::comm_rank
int comm_rank
Definition: xmp_data_struct.h:52
_XMP_reflect_sched_type::reflect_is_initialized
int reflect_is_initialized
Definition: xmp_data_struct.h:121
_XMP_async_reflect_type::nreqs
int nreqs
Definition: xmp_data_struct.h:189
_xmp_omp_num_procs
int _xmp_omp_num_procs
Definition: xmp_pack_vector.c:7
_XMP_sched_loop_template_width_N
int _XMP_sched_loop_template_width_N(int ser_init, int ser_cond, int ser_step, int *par_init, int *par_cond, int *par_step, int template_lower, int template_upper, int template_stride, int width, int template_ser_lower, int template_ser_upper)
Definition: xmp_loop.c:116
_XMP_array_info_type::dim_elmts
unsigned long long dim_elmts
Definition: xmp_data_struct.h:243
_XMP_flag_get_nb
int _XMP_flag_get_nb
Definition: xmp_onesided.c:6
_XMP_template_chunk_type::par_chunk_width
unsigned long long par_chunk_width
Definition: xmp_data_struct.h:86
_XMP_async_comm::is_used
_Bool is_used
Definition: xmp_data_struct.h:462
_XACC_init
void _XACC_init(void)
Definition: xacc_runtime.c:3
_XMP_calc_array_dim_elmts
void _XMP_calc_array_dim_elmts(_XMP_array_t *array, int array_index)
Definition: xmp_align.c:17
_XMP_SM_GTOL_BLOCK_CYCLIC
#define _XMP_SM_GTOL_BLOCK_CYCLIC(_b, _i, _m, _P)
Definition: xmp_gmove.c:19
_XMP_flag_put_nb_rr
int _XMP_flag_put_nb_rr
_XMP_flag_multi_win
int _XMP_flag_multi_win
Definition: xmp_onesided_mpi.c:23
_XMP_COMM_REDUCE_SHADOW
#define _XMP_COMM_REDUCE_SHADOW
Definition: xmp_constant.h:137
_XMP_world_rank
int _XMP_world_rank
Definition: xmp_world.c:9
xmp_array_gtol
int xmp_array_gtol(xmp_desc_t d, int dim, int g_idx, int *lidx)
Definition: xmp_lib.c:234
_XMP_gasnet_coarray_lastly_deallocate
void _XMP_gasnet_coarray_lastly_deallocate()
Deallocate memory region when calling _XMP_coarray_lastly_deallocate()
Definition: xmp_coarray_gasnet.c:784
_XMP_reflect_sched_type::hi_send_buf
void * hi_send_buf
Definition: xmp_data_struct.h:135
_XMP_reflect_sched_type::datatype_lo
MPI_Datatype datatype_lo
Definition: xmp_data_struct.h:128
_XMP_nodes_inherit_info_type
Definition: xmp_data_struct.h:20
_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_calc_gmove_rank_array_SCALAR
void _XMP_calc_gmove_rank_array_SCALAR(_XMP_array_t *array, int *ref_index, int *rank_array)
Definition: xmp_gmove.c:197
_XMP_array_info_type::local_stride
int local_stride
Definition: xmp_data_struct.h:211
_XMP_post_wait_initialize
void _XMP_post_wait_initialize()
Definition: xmp_post_wait.c:8
_XMP_finalize_reflect_sched
void _XMP_finalize_reflect_sched(_XMP_reflect_sched_t *sched, _Bool free_buf)
Definition: xmp_shadow.c:236
_XMP_calc_template_owner_SCALAR
int _XMP_calc_template_owner_SCALAR(_XMP_template_t *template, int dim_index, long long ref_index)
Definition: xmp_template.c:632
_XMP_array_info_type::temp0_v
int temp0_v
Definition: xmp_data_struct.h:240
_XMP_N_GMOVE_IN
#define _XMP_N_GMOVE_IN
Definition: xmp_constant.h:70
_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_template_type::desc_kind
int desc_kind
Definition: xmp_data_struct.h:100
_XMP_array_type::align_comm
_XMP_comm_t * align_comm
Definition: xmp_data_struct.h:300
_XMPF_running
int _XMPF_running
Definition: xmp_runtime.c:16
_XMP_COMM_REFLECT
#define _XMP_COMM_REFLECT
Definition: xmp_constant.h:136
_XMP_array_info_type::shadow_size_lo
int shadow_size_lo
Definition: xmp_data_struct.h:249
_XMP_gmove_localcopy_ARRAY
void _XMP_gmove_localcopy_ARRAY(int type, int type_size, void *dst_addr, int dst_dim, int *dst_l, int *dst_u, int *dst_s, unsigned long long *dst_d, void *src_addr, int src_dim, int *src_l, int *src_u, int *src_s, unsigned long long *src_d)
Definition: xmp_gmove.c:322
_XMP_TSTART
#define _XMP_TSTART(t0)
Definition: xmp_internal.h:747
intersection_rsds
_XMP_rsd_t * intersection_rsds(_XMP_rsd_t *_rsd1, _XMP_rsd_t *_rsd2)
Definition: xmp_section_desc.c:82
_XMP_calc_template_size
void _XMP_calc_template_size(_XMP_template_t *t)
Definition: xmp_template.c:30
_XMP_array_type::align_template
_XMP_template_t * align_template
Definition: xmp_data_struct.h:312
_XMP_csd_type::s
int s
Definition: xmp_data_struct.h:434
_XMP_nodes_ref_type::ref
int * ref
Definition: xmp_data_struct.h:65
_XMP_async_comm::nnodes
int nnodes
Definition: xmp_data_struct.h:461
_XMP_N_TYPE_LONG
#define _XMP_N_TYPE_LONG
Definition: xmp_constant.h:87
_XMP_create_shadow_comm
void _XMP_create_shadow_comm(_XMP_array_t *array, int array_index)
Definition: xmp_shadow.c:16
_XMP_warning
void _XMP_warning(char *msg)
Definition: xmp_util.c:58
_XMP_N_DEFAULT_ROOT_RANK
#define _XMP_N_DEFAULT_ROOT_RANK
Definition: xmp_constant.h:25
_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_reflect_async_ordinal
void _XMP_reflect_async_ordinal(_XMP_array_t *a, int async_id)
Definition: xmp_reflect.c:1055
_XMP_ENTIRE_NODES
#define _XMP_ENTIRE_NODES
Definition: xmp_constant.h:121
_XMP_IS_SINGLE
#define _XMP_IS_SINGLE
Definition: xmp_internal.h:50
_XMP_comm_set_type::u
int u
Definition: xmp_data_struct.h:441
_XMP_N_INT_FALSE
#define _XMP_N_INT_FALSE
Definition: xmp_constant.h:5
_XMP_N_UNSPECIFIED_RANK
#define _XMP_N_UNSPECIFIED_RANK
Definition: xmp_constant.h:22
_XMP_N_DIST_CYCLIC
#define _XMP_N_DIST_CYCLIC
Definition: xmp_constant.h:30
_XMP_nodes_inherit_info_type::stride
int stride
Definition: xmp_data_struct.h:25
_XMP_init_world
void _XMP_init_world(int *argc, char ***argv)
Definition: xmp_world.c:12
_XMP_template_type
Definition: xmp_data_struct.h:98
_XMP_get_current_async
_XMP_async_comm_t * _XMP_get_current_async()
Definition: xmp_async.c:205
_XMP_N_TYPE_UNSIGNED_LONG
#define _XMP_N_TYPE_UNSIGNED_LONG
Definition: xmp_constant.h:88
_XMP_N_SHADOW_FULL
#define _XMP_N_SHADOW_FULL
Definition: xmp_constant.h:66
_XMP_nodes_ref_type
Definition: xmp_data_struct.h:63
_XMP_array_type::total_elmts
unsigned long long total_elmts
Definition: xmp_data_struct.h:293
_XMP_reflect_sched_type::blocklength
int blocklength
Definition: xmp_data_struct.h:140
_XMP_SM_GTOL_BLOCK
#define _XMP_SM_GTOL_BLOCK(_i, _m, _w)
Definition: xmp_gmove.c:13
_XMP_array_type::align_comm_rank
int align_comm_rank
Definition: xmp_data_struct.h:302
_XMP_fjrdma_build_sync_images_table
void _XMP_fjrdma_build_sync_images_table()
Build table and Initialize for sync images.
Definition: xmp_coarray_fjrdma.c:2148
_XMP_array_type::async_reflect
_XMP_async_reflect_t * async_reflect
Definition: xmp_data_struct.h:296
_XMP_tca_initialize
void _XMP_tca_initialize()
Initialize TCA.
Definition: xmp_onesided_tca.c:22
_XMP_array_info_type::ser_lower
int ser_lower
Definition: xmp_data_struct.h:199
_XMP_comm_set_type::next
struct _XMP_comm_set_type * next
Definition: xmp_data_struct.h:442
_XMP_nodes_type::inherit_info
_XMP_nodes_inherit_info_t * inherit_info
Definition: xmp_data_struct.h:59
_XMP_reflect_sched_type::stride
long long stride
Definition: xmp_data_struct.h:141
_XMP_reflect_sched_type::hi_width
int hi_width
Definition: xmp_data_struct.h:125
_XMP_template_chunk_type
Definition: xmp_data_struct.h:78
_XMP_comm_t
#define _XMP_comm_t
Definition: xmp_data_struct.h:17
_XMP_async_comm::nreqs
int nreqs
Definition: xmp_data_struct.h:460
_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_reflect_pack_dim
void _XMP_reflect_pack_dim(_XMP_array_t *a, int i, int *lwidth, int *uwidth, int *is_periodic, int shadow_comm_type)
Definition: xmp_reflect.c:1768
_XMP_template_chunk_type::onto_nodes_index
int onto_nodes_index
Definition: xmp_data_struct.h:92
_XMP_N_DIST_BLOCK_CYCLIC
#define _XMP_N_DIST_BLOCK_CYCLIC
Definition: xmp_constant.h:31
_XMP_array_info_type::local_lower
int local_lower
Definition: xmp_data_struct.h:209
_XMP_N_DIST_GBLOCK
#define _XMP_N_DIST_GBLOCK
Definition: xmp_constant.h:32
_XMP_create_nodes_ref_for_target_nodes
_XMP_nodes_ref_t * _XMP_create_nodes_ref_for_target_nodes(_XMP_nodes_t *n, int *rank_array, _XMP_nodes_t *target_nodes)
Definition: xmp_nodes.c:1234
_XMP_gasnet_intrinsic_initialize
void _XMP_gasnet_intrinsic_initialize()
Definition: xmp_intrinsic_gasnet.c:33
_XMP_N_DIST_DUPLICATION
#define _XMP_N_DIST_DUPLICATION
Definition: xmp_constant.h:28
_XMP_translate_nodes_rank_array_to_ranks
void _XMP_translate_nodes_rank_array_to_ranks(_XMP_nodes_t *nodes, int *ranks, int *rank_array, int shrink_nodes_size)
Definition: xmp_nodes.c:1270
_XMP_gmv_desc_type::local_data
void * local_data
Definition: xmp_data_struct.h:393
_XMP_array_info_type::shadow_size_hi
int shadow_size_hi
Definition: xmp_data_struct.h:250
_XMP_get_execution_nodes
_XMP_nodes_t * _XMP_get_execution_nodes(void)
Definition: xmp_nodes_stack.c:46
_XMP_mpi_onesided_dealloc_win
void _XMP_mpi_onesided_dealloc_win(MPI_Win *win, void **addr, bool is_acc)
Definition: xmp_onesided_mpi.c:129
_XMP_tca_finalize
void _XMP_tca_finalize()
Finalize TCA.
Definition: xmp_onesided_tca.c:45
_XMP_build_coarray_queue
void _XMP_build_coarray_queue()
Build queue for coarray.
Definition: xmp_coarray.c:1574
_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_async_comm::reqs
MPI_Request * reqs
Definition: xmp_data_struct.h:464
_XMP_SM_GTOL_BLOCK
#define _XMP_SM_GTOL_BLOCK(_i, _m, _w)
Definition: xmp_loop.c:5
_XMP_async_comm
Definition: xmp_data_struct.h:458
_XMP_template_chunk_type::par_stride
int par_stride
Definition: xmp_data_struct.h:85
_XMP_gmv_desc_type::ndims
int ndims
Definition: xmp_data_struct.h:389
_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_N_COARRAY_PUT
#define _XMP_N_COARRAY_PUT
Definition: xmp_constant.h:112
_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_get_offset
size_t _XMP_get_offset(const _XMP_array_section_t *array_info, const int dims)
Definition: xmp_coarray_utils.c:22
_XMP_N_ALIGN_BLOCK
#define _XMP_N_ALIGN_BLOCK
Definition: xmp_constant.h:37
_XMP_initialize_onesided_functions
void _XMP_initialize_onesided_functions()
Definition: xmp_onesided.c:71
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_EXECUTING_NODES
#define _XMP_EXECUTING_NODES
Definition: xmp_constant.h:122
_XMP_reflect_sched_type::req_reduce
MPI_Request req_reduce[4]
Definition: xmp_data_struct.h:132
_XMP_free
void _XMP_free(void *p)
Definition: xmp_util.c:37
xmp_reduce_initialize
void xmp_reduce_initialize()
Definition: xmp_reduce.c:553
_XMP_mpi_onesided_initialize
void _XMP_mpi_onesided_initialize(const size_t heap_size)
Definition: xmp_onesided_mpi.c:25
_XMP_ASSERT
#define _XMP_ASSERT(_flag)
Definition: xmp_internal.h:34
_XMP_fjrdma_initialize
void _XMP_fjrdma_initialize(int argc, char **argv)
Initialize FUJITSU RDMA for the K computer and FX10.
Definition: xmp_onesided_fjrdma.c:7
_XMP_build_sync_images_table
void _XMP_build_sync_images_table()
Build table for sync images.
Definition: xmp_coarray.c:1558
_XMP_N_TYPE_LONG_DOUBLE_COMPLEX
#define _XMP_N_TYPE_LONG_DOUBLE_COMPLEX
Definition: xmp_constant.h:103
_XMP_gmv_desc_type::is_global
_Bool is_global
Definition: xmp_data_struct.h:388
_XMP_reflect_sched_type::lo_send_array
void * lo_send_array
Definition: xmp_data_struct.h:137
_XMP_csd_type::l
int * l
Definition: xmp_data_struct.h:431
_XMP_mpi_onesided_finalize
void _XMP_mpi_onesided_finalize()
Definition: xmp_onesided_mpi.c:64
_XMP_nodes_inherit_info_type::lower
int lower
Definition: xmp_data_struct.h:23
_XMP_bcast_NODES_ENTIRE_NODES_V
void _XMP_bcast_NODES_ENTIRE_NODES_V(_XMP_nodes_t *bcast_nodes, void *addr, int count, size_t datatype_size, _XMP_nodes_t *from_nodes, va_list args)
Definition: xmp_bcast.c:69
_XMP_nodes_info_type::multiplier
int multiplier
Definition: xmp_data_struct.h:37
_XMP_reflect_pcopy_sched_dim
void _XMP_reflect_pcopy_sched_dim(_XMP_array_t *adesc, int target_dim, int lwidth, int uwidth, int is_periodic, int shadow_comm_type)
Definition: xmp_reflect.c:468
_XMP_N_ALIGN_NOT_ALIGNED
#define _XMP_N_ALIGN_NOT_ALIGNED
Definition: xmp_constant.h:35
_XMP_check_gmove_array_ref_inclusion_SCALAR
int _XMP_check_gmove_array_ref_inclusion_SCALAR(_XMP_array_t *array, int array_index, int ref_index)
Definition: xmp_gmove.c:309
_XMP_sum_vector
void _XMP_sum_vector(int type, char *restrict dst, char *restrict src, int count, int blocklength, long stride)
Definition: xmp_pack_vector.c:101
_XMP_bsd_type::c
int c
Definition: xmp_data_struct.h:423
_XMP_async_comm::a
_XMP_array_t * a
Definition: xmp_data_struct.h:467
_XMP_DESC_TEMPLATE
#define _XMP_DESC_TEMPLATE
Definition: xmp_constant.h:132
_XMP_fjrdma_coarray_lastly_deallocate
void _XMP_fjrdma_coarray_lastly_deallocate()
Deallocate memory region when calling _XMP_coarray_lastly_deallocate()
Definition: xmp_coarray_fjrdma.c:1593
_XMP_array_type::array_addr_p
void * array_addr_p
Definition: xmp_data_struct.h:279
_XMP_calc_coord_on_target_nodes
_Bool _XMP_calc_coord_on_target_nodes(_XMP_nodes_t *n, int *ncoord, _XMP_nodes_t *target_n, int *target_ncoord)
Definition: xmp_nodes.c:1150
_XMP_N_ALIGN_BLOCK_CYCLIC
#define _XMP_N_ALIGN_BLOCK_CYCLIC
Definition: xmp_constant.h:39
_XMP_nodes_type::comm
_XMP_comm_t * comm
Definition: xmp_data_struct.h:53
_XMP_sync_images_COMM
void _XMP_sync_images_COMM(MPI_Comm *comm, int *status)
Definition: xmp_coarray_mpi.c:1105
_XMP_lcm
int _XMP_lcm(int a, int b)
Definition: xmp_math_function.c:66
_XMP_async_comm::node
_XMP_nodes_t ** node
Definition: xmp_data_struct.h:465
_XMP_create_nodes_by_comm
_XMP_nodes_t * _XMP_create_nodes_by_comm(int is_member, _XMP_comm_t *comm)
Definition: xmp_nodes.c:1007
_XMP_world_size
int _XMP_world_size
Definition: xmp_world.c:8
_XMP_get_async
_XMP_async_comm_t * _XMP_get_async(int async_id)
Definition: xmp_async.c:30
_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_pack
void xmp_pack(void *v_p, void *a_p, void *m_p)
Definition: xmp_intrinsic.c:5728
_XMP_utofu_build_sync_images_table
void _XMP_utofu_build_sync_images_table(void)
Definition: xmp_coarray_utofu.c:983
_XMP_fatal
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42
_XMP_reduce_shadow_sum
void _XMP_reduce_shadow_sum(_XMP_array_t *a)
Definition: xmp_reduce_shadow.c:153
_XMP_reflect_sched_type::prev_pcopy_sched_type
int prev_pcopy_sched_type
Definition: xmp_data_struct.h:123
_XMP_floori
int _XMP_floori(int a, int b)
Definition: xmp_math_function.c:43
_XMP_check_reflect_type
void _XMP_check_reflect_type(void)
Definition: xmp_pack_vector.c:300
_XMP_finalize_onesided_functions
void _XMP_finalize_onesided_functions()
Definition: xmp_onesided.c:142
_XMP_gmv_desc_type::a_desc
_XMP_array_t * a_desc
Definition: xmp_data_struct.h:391
_XMP_M_COUNTi
#define _XMP_M_COUNTi(a_, b_)
Definition: xmp_math_function.h:15
_XMP_array_info_type::dim_acc
unsigned long long dim_acc
Definition: xmp_data_struct.h:242
_XMP_csd_type
Definition: xmp_data_struct.h:430
_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_calc_rank_array
void _XMP_calc_rank_array(_XMP_nodes_t *n, int *rank_array, int linear_rank)
Definition: xmp_nodes.c:1026
_XMP_world_nodes
void * _XMP_world_nodes
Definition: xmp_world.c:10
_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_reflect_sched_type::reduce_is_initialized
int reduce_is_initialized
Definition: xmp_data_struct.h:122
_XMP_N_COARRAY_GET
#define _XMP_N_COARRAY_GET
Definition: xmp_constant.h:111
_XMP_nodes_ref_type::nodes
_XMP_nodes_t * nodes
Definition: xmp_data_struct.h:64
_XMP_gasnet_initialize
void _XMP_gasnet_initialize(const size_t xmp_gasnet_heap_size, const size_t xmp_gasnet_stride_size)
Initialize GASNet job.
Definition: xmp_onesided_gasnet.c:32
_XMP_N_TYPE_LONGLONG
#define _XMP_N_TYPE_LONGLONG
Definition: xmp_constant.h:89
_XMP_fatal
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42
_XMP_rsd_type
Definition: xmp_data_struct.h:409
_XMP_gmove_SENDRECV_GSCALAR
void _XMP_gmove_SENDRECV_GSCALAR(void *dst_addr, void *src_addr, _XMP_array_t *dst_array, _XMP_array_t *src_array, int dst_ref_index[], int src_ref_index[])
Definition: xmp_gmove.c:889
_XMP_push_nodes
void _XMP_push_nodes(void *nodes)
_XMP_template_type::is_distributed
_Bool is_distributed
Definition: xmp_data_struct.h:105
_XMP_create_template_desc
_XMP_template_t * _XMP_create_template_desc(int dim, _Bool is_fixed)
Definition: xmp_template.c:10
_XMP_world_rank
int _XMP_world_rank
Definition: xmp_world.c:9
_XMP_nodes_type::dim
int dim
Definition: xmp_data_struct.h:47
_XMP_bsd_type::l
int l
Definition: xmp_data_struct.h:420
_XMP_nodes_type::attr
int attr
Definition: xmp_data_struct.h:49
_XMP_nodes_type
Definition: xmp_data_struct.h:40
_XMP_async_comm::async_id
int async_id
Definition: xmp_data_struct.h:459
_XMP_modi_ll_i
int _XMP_modi_ll_i(long long value, int cycle)
Definition: xmp_math_function.c:9
xmpc_traverse_finalize
void xmpc_traverse_finalize()
_XMP_M_COUNT_TRIPLETi
#define _XMP_M_COUNT_TRIPLETi(l_, u_, s_)
Definition: xmp_gpu_func.hpp:25
_XMP_async_gmove::mode
int mode
Definition: xmp_data_struct.h:450
_XMP_RETURN_IF_SINGLE
#define _XMP_RETURN_IF_SINGLE
Definition: xmp_internal.h:37
_XMP_array_info_type::temp0
int * temp0
Definition: xmp_data_struct.h:239
_XMP_reflect_sched_type::count
int count
Definition: xmp_data_struct.h:140
_XMP_get_on_ref_id
unsigned long long _XMP_get_on_ref_id(void)
Definition: xmp_util.c:13
_XMP_array_type::is_align_comm_member
_Bool is_align_comm_member
Definition: xmp_data_struct.h:271
_coarray_queue_t::max_size
size_t max_size
Max size of queue.
Definition: xmp_coarray.c:19
_XMP_async_gmove
Definition: xmp_data_struct.h:449
_XMP_reflect_sched_type::lo_send_buf
void * lo_send_buf
Definition: xmp_data_struct.h:134
_XMPC_unpack_array_BASIC
void _XMPC_unpack_array_BASIC(void *dst, void *buffer, int array_type, int array_dim, int *l, int *u, int *s, unsigned long long *d)
Definition: xmp_array_section.c:1148
_XMP_N_MAX_DIM
#define _XMP_N_MAX_DIM
Definition: xmp_constant.h:6
_XMP_reflect_sched_type::hi_recv_buf
void * hi_recv_buf
Definition: xmp_data_struct.h:135
_XMP_nodes_dish_type
Definition: xmp_nodes_stack.c:8
_XMP_RETURN_IF_AFTER_FINALIZATION
#define _XMP_RETURN_IF_AFTER_FINALIZATION
Definition: xmp_internal.h:45
_XMP_gtol_calc_offset
unsigned long long _XMP_gtol_calc_offset(_XMP_array_t *a, int g_idx[])
Definition: xmp_gmove.c:2991
_XMP_gmove_BCAST_GSCALAR
void _XMP_gmove_BCAST_GSCALAR(void *dst_addr, _XMP_array_t *array, int ref_index[])
Definition: xmp_gmove.c:687
_XMP_N_SHADOW_NORMAL
#define _XMP_N_SHADOW_NORMAL
Definition: xmp_constant.h:65
_XMP_gmove_inout_scalar
void _XMP_gmove_inout_scalar(void *scalar, _XMP_gmv_desc_t *gmv_desc, int rdma_type)
_XMP_TEND2
#define _XMP_TEND2(t, tt, t0)
Definition: xmp_internal.h:749
_XMP_flag_put_nb_rr_i
int _XMP_flag_put_nb_rr_i
_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_reflect_sched_type::hi_send_array
void * hi_send_array
Definition: xmp_data_struct.h:138
_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
_coarray_queue_t::coarrays
_XMP_coarray_t ** coarrays
pointer of coarrays
Definition: xmp_coarray.c:21
_XMP_reflect_shadow_FULL
void _XMP_reflect_shadow_FULL(void *array_addr, void *array_desc, int array_index)
_XMP_rsd_type::s
int s
Definition: xmp_data_struct.h:412
_XMP_N_ALIGN_GBLOCK
#define _XMP_N_ALIGN_GBLOCK
Definition: xmp_constant.h:40
_XMP_normalize_array_section
void _XMP_normalize_array_section(int *lower, int *upper, int *stride)
_XMP_template_chunk_type::mapping_array
long long * mapping_array
Definition: xmp_data_struct.h:88
_xmp_reflect_pack_flag
int _xmp_reflect_pack_flag
Definition: xmp_pack_vector.c:298
_XMP_array_type::is_allocated
_Bool is_allocated
Definition: xmp_data_struct.h:270
_XMP_reflect_sched_type::lo_width
int lo_width
Definition: xmp_data_struct.h:125
_XMP_gtol_array_ref_triplet
void _XMP_gtol_array_ref_triplet(_XMP_array_t *array, int dim_index, int *lower, int *upper, int *stride)
Definition: xmp_gmove.c:114
_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_comm_set_type
Definition: xmp_data_struct.h:439
_XMP_template_type::on_ref_id
unsigned long long on_ref_id
Definition: xmp_data_struct.h:102
_XMP_local_contiguous_copy
void _XMP_local_contiguous_copy(char *dst, const char *src, const size_t dst_elmts, const size_t src_elmts, const size_t elmt_size)
Definition: xmp_coarray_utils.c:79
_XMP_template_type::is_owner
_Bool is_owner
Definition: xmp_data_struct.h:106
_XMP_array_info_type::par_lower
int par_lower
Definition: xmp_data_struct.h:204
_XMP_mpi_build_sync_images_table
void _XMP_mpi_build_sync_images_table()
Build table and Initialize for sync images.
Definition: xmp_coarray_mpi.c:951
_XMP_comm_set_type::l
int l
Definition: xmp_data_struct.h:440
MIN
#define MIN(a, b)
Definition: xmp_internal.h:12
_XMP_ceili
int _XMP_ceili(int a, int b)
Definition: xmp_math_function.c:29
_XMP_async_reflect_type
Definition: xmp_data_struct.h:181
_XMP_init_reflect_sched
void _XMP_init_reflect_sched(_XMP_reflect_sched_t *sched)
Definition: xmp_shadow.c:218
_XMP_nodes_inherit_info_type::upper
int upper
Definition: xmp_data_struct.h:24
_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
xmp_get_ruuning
int xmp_get_ruuning()
Definition: xmp_runtime.c:25
_XMP_fjrdma_finalize
void _XMP_fjrdma_finalize()
Finalize FUJITSU RDMA for the K computer and FX10.
Definition: xmp_onesided_fjrdma.c:16
_XMP_gmv_desc_type::a_lb
int * a_lb
Definition: xmp_data_struct.h:394