libxmp/libxmpf in Omni Compiler  1.3.4
xmp_intrinsic.c File Reference
#include "xmp.h"
#include "xmp_internal.h"
#include "mpi.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
Include dependency graph for xmp_intrinsic.c:

Macros

#define MPI_PORTABLE_PLATFORM_H
 

Functions

void _XMP_align_local_idx (long long int global_idx, int *local_idx, _XMP_array_t *array, int array_axis, int *rank)
 
int check_template (_XMP_template_t *dst_t, _XMP_template_t *src_t)
 
void xmp_transpose (void *dst_p, void *src_p, int opt)
 
void xmpf_transpose (void *dst_p, void *src_p, int opt)
 
void xmp_matmul (void *x_p, void *a_p, void *b_p)
 
void xmpf_matmul (void *x_p, void *a_p, void *b_p)
 
void xmp_gather (void *x_d, void *a_d,...)
 
void xmpf_gather (void *x_p, void *a_p, _XMP_array_t **idx_array)
 
void xmp_scatter (void *x_d, void *a_d,...)
 
void xmpf_scatter (void *x_p, void *a_p, _XMP_array_t **idx_array)
 
void xmp_pack (void *v_p, void *a_p, void *m_p)
 
void xmp_pack_mask (void *v_p, void *a_p, void *m_p)
 
void xmp_pack_nomask (void *v_p, void *a_p)
 
void xmpf_pack (void *v_p, void *a_p, void *m_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 xmp_unpack (void *a_p, void *v_p, void *m_p)
 
void xmp_unpack_mask (void *a_p, void *v_p, void *m_p)
 
void xmp_unpack_nomask (void *a_p, void *v_p)
 
void xmpf_unpack (void *a_p, void *v_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 _XMP_atomic_define_0 (void *dst_desc, size_t dst_offset, int value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_define_1 (void *dst_desc, size_t dst_offset, int image0, int value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_define_2 (void *dst_desc, size_t dst_offset, int image0, int image1, int value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_define_3 (void *dst_desc, size_t dst_offset, int image0, int image1, int image2, int value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_define_4 (void *dst_desc, size_t dst_offset, int image0, int image1, int image2, int image3, int value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_define_5 (void *dst_desc, size_t dst_offset, int image0, int image1, int image2, int image3, int image4, int value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_define_6 (void *dst_desc, size_t dst_offset, int image0, int image1, int image2, int image3, int image4, int image5, int value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_define_7 (void *dst_desc, size_t dst_offset, int image0, int image1, int image2, int image3, int image4, int image5, int image6, int value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_ref_0 (void *dst_desc, size_t dst_offset, int *value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_ref_1 (void *dst_desc, size_t dst_offset, int image, int *value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_ref_2 (void *dst_desc, size_t dst_offset, int image0, int image1, int *value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_ref_3 (void *dst_desc, size_t dst_offset, int image0, int image1, int image2, int *value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_ref_4 (void *dst_desc, size_t dst_offset, int image0, int image1, int image2, int image3, int *value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_ref_5 (void *dst_desc, size_t dst_offset, int image0, int image1, int image2, int image3, int image4, int *value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_ref_6 (void *dst_desc, size_t dst_offset, int image0, int image1, int image2, int image3, int image4, int image5, int *value, void *src_desc, size_t src_offset, size_t elmt_size)
 
void _XMP_atomic_ref_7 (void *dst_desc, size_t dst_offset, int image0, int image1, int image2, int image3, int image4, int image5, int image6, int *value, void *src_desc, size_t src_offset, size_t elmt_size)
 

Macro Definition Documentation

◆ MPI_PORTABLE_PLATFORM_H

#define MPI_PORTABLE_PLATFORM_H

Function Documentation

◆ _XMP_align_local_idx()

void _XMP_align_local_idx ( long long int  global_idx,
int *  local_idx,
_XMP_array_t array,
int  array_axis,
int *  rank 
)
1360 {
1361  _XMP_template_t *template = array->align_template;
1362  int template_index = array->info[array_axis].align_template_index;
1363  _XMP_template_chunk_t *chunk = &(template->chunk[template_index]);
1364  _XMP_nodes_info_t *n_info = chunk->onto_nodes_info;
1365  long long base = array->info[array_axis].ser_lower;
1366  long long tbase = template->info[template_index].ser_lower;
1367  int offset = array->info[array_axis].align_subscript + (base - tbase);
1368  int irank, idiv, imod;
1369 
1370  switch(array->info[array_axis].align_manner){
1372  {
1373  *rank=0;
1374  *local_idx = global_idx + offset - base;
1375  }
1376  break;
1377  case _XMP_N_ALIGN_BLOCK:
1378  {
1379  *rank = (global_idx + offset - base) / chunk->par_chunk_width;
1380  *local_idx = (global_idx + offset - base ) - *rank * chunk->par_chunk_width + array->info[array_axis].shadow_size_lo;
1381  idiv = offset / (chunk->par_chunk_width);
1382  if (*rank == idiv){
1383  *local_idx = *local_idx - offset%(chunk->par_chunk_width);
1384  }
1385  }
1386  break;
1387  case _XMP_N_ALIGN_CYCLIC:
1388  {
1389  idiv = offset/n_info->size;
1390  imod = offset%n_info->size;
1391  *rank = (global_idx + offset - base) % n_info->size;
1392  *local_idx = (global_idx + offset - base) / n_info->size;
1393  if (imod > *rank){
1394  *local_idx = *local_idx - (idiv + 1);
1395  } else {
1396  *local_idx = *local_idx - idiv;
1397  }
1398  }
1399  break;
1401  {
1402  int w = chunk->par_width;
1403  idiv = (offset/w)/n_info->size;
1404  int imod1 = (offset/w)%n_info->size;
1405  int imod2 = offset%w;
1406  int off = global_idx + offset - base;
1407  *local_idx = (off / (n_info->size*w)) * w + off%w;
1408 
1409  *rank=(off/w)% (n_info->size);
1410  if (imod1 > 0){
1411  if (imod1 == *rank ){
1412  *local_idx = *local_idx - idiv*w-imod2;
1413  }else if (imod1 > *rank){
1414  *local_idx = *local_idx - (idiv+1)*w;
1415  }
1416  }else if (imod1 == 0){
1417  if (imod1 == *rank ){
1418  *local_idx = *local_idx - idiv*w -imod2;
1419  }else{
1420  *local_idx = *local_idx - idiv*w;
1421  }
1422  }
1423  }
1424  break;
1425  case _XMP_N_ALIGN_GBLOCK:
1426  {
1427  irank=-1;
1428  idiv=0;
1429  for(int i=1;i<(n_info->size+1);i++){
1430  if(global_idx + offset < chunk->mapping_array[i]+ (base - tbase)){
1431  *rank = i - 1;
1432  break;
1433  }
1434  }
1435  *local_idx = global_idx + offset - chunk->mapping_array[*rank]- (base - tbase) + array->info[array_axis].shadow_size_lo;
1436  for(int i=1;i<n_info->size+1;i++){
1437  if(offset < chunk->mapping_array[i]+(base-tbase)){
1438  irank = i - 1;
1439  idiv = offset - (chunk->mapping_array[i-1] + (base - tbase) - base);
1440  break;
1441  }
1442  }
1443  if (*rank == irank){
1444  *local_idx = *local_idx - idiv;
1445  }
1446  }
1447  break;
1449  {
1450  *rank=0;
1451  *local_idx=global_idx - base;
1452  }
1453  break;
1454  default:
1455  _XMP_fatal("_XMP_: unknown chunk dist_manner");
1456  }
1457 
1458 }

◆ _XMP_atomic_define_0()

void _XMP_atomic_define_0 ( void *  dst_desc,
size_t  dst_offset,
int  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6333 {
6334 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6335  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6336 #endif
6337 
6338 #ifdef _XMP_GASNET
6339  _XMP_gasnet_atomic_define(_XMP_world_rank, c, dst_offset, value, src_desc, src_offset, elmt_size);
6340 #elif _XMP_FJRDMA
6341  _XMP_fjrdma_atomic_define(_XMP_world_rank, c, dst_offset, value, src_desc, src_offset, elmt_size);
6342 #elif _XMP_UTOFU
6343  _XMP_utofu_atomic_define(_XMP_world_rank, c, dst_offset, value, elmt_size);
6344 #elif _XMP_MPI3_ONESIDED
6345  _XMP_mpi_atomic_define(_XMP_world_rank, c, dst_offset, value, elmt_size);
6346 #endif
6347 }
Here is the call graph for this function:

◆ _XMP_atomic_define_1()

void _XMP_atomic_define_1 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6351 {
6352 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6353  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6354 #endif
6355 
6356 #ifdef _XMP_GASNET
6357  _XMP_gasnet_atomic_define(image0, c, dst_offset, value, src_desc, src_offset, elmt_size);
6358 #elif _XMP_FJRDMA
6359  _XMP_fjrdma_atomic_define(image0, c, dst_offset, value, src_desc, src_offset, elmt_size);
6360 #elif _XMP_UTOFU
6361  _XMP_utofu_atomic_define(image0, c, dst_offset, value, elmt_size);
6362 #elif _XMP_MPI3_ONESIDED
6363  _XMP_mpi_atomic_define(image0, c, dst_offset, value, elmt_size);
6364 #endif
6365 }
Here is the call graph for this function:

◆ _XMP_atomic_define_2()

void _XMP_atomic_define_2 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6369 {
6370 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6371  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6372  int image = c->distance_of_image_elmts[0] * image0 + c->distance_of_image_elmts[1] * image1;
6373 #endif
6374 
6375 #ifdef _XMP_GASNET
6376  _XMP_gasnet_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6377 #elif _XMP_FJRDMA
6378  _XMP_fjrdma_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6379 #elif _XMP_UTOFU
6380  _XMP_utofu_atomic_define(image, c, dst_offset, value, elmt_size);
6381 #elif _XMP_MPI3_ONESIDED
6382  _XMP_mpi_atomic_define(image, c, dst_offset, value, elmt_size);
6383 #endif
6384 }
Here is the call graph for this function:

◆ _XMP_atomic_define_3()

void _XMP_atomic_define_3 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int  image2,
int  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6388 {
6389 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6390  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6391  int image = c->distance_of_image_elmts[0] * image0
6392  + c->distance_of_image_elmts[1] * image1
6393  + c->distance_of_image_elmts[2] * image2;
6394 #endif
6395 
6396 #ifdef _XMP_GASNET
6397  _XMP_gasnet_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6398 #elif _XMP_FJRDMA
6399  _XMP_fjrdma_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6400 #elif _XMP_UTOFU
6401  _XMP_utofu_atomic_define(image, c, dst_offset, value, elmt_size);
6402 #elif _XMP_MPI3_ONESIDED
6403  _XMP_mpi_atomic_define(image, c, dst_offset, value, elmt_size);
6404 #endif
6405 }
Here is the call graph for this function:

◆ _XMP_atomic_define_4()

void _XMP_atomic_define_4 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int  image2,
int  image3,
int  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6409 {
6410 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6411  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6412  int image = c->distance_of_image_elmts[0] * image0
6413  + c->distance_of_image_elmts[1] * image1
6414  + c->distance_of_image_elmts[2] * image2
6415  + c->distance_of_image_elmts[3] * image3;
6416 #endif
6417 
6418 #ifdef _XMP_GASNET
6419  _XMP_gasnet_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6420 #elif _XMP_FJRDMA
6421  _XMP_fjrdma_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6422 #elif _XMP_UTOFU
6423  _XMP_utofu_atomic_define(image, c, dst_offset, value, elmt_size);
6424 #elif _XMP_MPI3_ONESIDED
6425  _XMP_mpi_atomic_define(image, c, dst_offset, value, elmt_size);
6426 #endif
6427 }
Here is the call graph for this function:

◆ _XMP_atomic_define_5()

void _XMP_atomic_define_5 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int  image2,
int  image3,
int  image4,
int  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6431 {
6432 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6433  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6434  int image = c->distance_of_image_elmts[0] * image0
6435  + c->distance_of_image_elmts[1] * image1
6436  + c->distance_of_image_elmts[2] * image2
6437  + c->distance_of_image_elmts[3] * image3
6438  + c->distance_of_image_elmts[4] * image4;
6439 #endif
6440 
6441 #ifdef _XMP_GASNET
6442  _XMP_gasnet_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6443 #elif _XMP_FJRDMA
6444  _XMP_fjrdma_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6445 #elif _XMP_UTOFU
6446  _XMP_utofu_atomic_define(image, c, dst_offset, value, elmt_size);
6447 #elif _XMP_MPI3_ONESIDED
6448  _XMP_mpi_atomic_define(image, c, dst_offset, value, elmt_size);
6449 #endif
6450 }
Here is the call graph for this function:

◆ _XMP_atomic_define_6()

void _XMP_atomic_define_6 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int  image2,
int  image3,
int  image4,
int  image5,
int  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6455 {
6456 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6457  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6458  int image = c->distance_of_image_elmts[0] * image0
6459  + c->distance_of_image_elmts[1] * image1
6460  + c->distance_of_image_elmts[2] * image2
6461  + c->distance_of_image_elmts[3] * image3
6462  + c->distance_of_image_elmts[4] * image4
6463  + c->distance_of_image_elmts[5] * image5;
6464 #endif
6465 
6466 #ifdef _XMP_GASNET
6467  _XMP_gasnet_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6468 #elif _XMP_FJRDMA
6469  _XMP_fjrdma_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6470 #elif _XMP_UTOFU
6471  _XMP_utofu_atomic_define(image, c, dst_offset, value, elmt_size);
6472 #elif _XMP_MPI3_ONESIDED
6473  _XMP_mpi_atomic_define(image, c, dst_offset, value, elmt_size);
6474 #endif
6475 }
Here is the call graph for this function:

◆ _XMP_atomic_define_7()

void _XMP_atomic_define_7 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int  image2,
int  image3,
int  image4,
int  image5,
int  image6,
int  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6480 {
6481 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6482  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6483  int image = c->distance_of_image_elmts[0] * image0
6484  + c->distance_of_image_elmts[1] * image1
6485  + c->distance_of_image_elmts[2] * image2
6486  + c->distance_of_image_elmts[3] * image3
6487  + c->distance_of_image_elmts[4] * image4
6488  + c->distance_of_image_elmts[5] * image5
6489  + c->distance_of_image_elmts[6] * image6;
6490 #endif
6491 
6492 #ifdef _XMP_GASNET
6493  _XMP_gasnet_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6494 #elif _XMP_FJRDMA
6495  _XMP_fjrdma_atomic_define(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6496 #elif _XMP_UTOFU
6497  _XMP_utofu_atomic_define(image, c, dst_offset, value, elmt_size);
6498 #elif _XMP_MPI3_ONESIDED
6499  _XMP_mpi_atomic_define(image, c, dst_offset, value, elmt_size);
6500 #endif
6501 }
Here is the call graph for this function:

◆ _XMP_atomic_ref_0()

void _XMP_atomic_ref_0 ( void *  dst_desc,
size_t  dst_offset,
int *  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6505 {
6506 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6507  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6508 #endif
6509 
6510  // Memo: This function requires a polling operation
6511 #ifdef _XMP_GASNET
6512  _XMP_gasnet_atomic_ref(_XMP_world_rank, c, dst_offset, value, elmt_size);
6513 #elif _XMP_FJRDMA
6514  _XMP_fjrdma_atomic_ref(_XMP_world_rank, c, dst_offset, value, src_desc, src_offset, elmt_size);
6515 #elif _XMP_UTOFU
6516  _XMP_utofu_atomic_ref(_XMP_world_rank, c, dst_offset, value, elmt_size);
6517 #elif _XMP_MPI3_ONESIDED
6518  _XMP_mpi_atomic_ref(_XMP_world_rank, c, dst_offset, value, elmt_size);
6519 #endif
6520 }
Here is the call graph for this function:

◆ _XMP_atomic_ref_1()

void _XMP_atomic_ref_1 ( void *  dst_desc,
size_t  dst_offset,
int  image,
int *  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6524 {
6525 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6526  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6527 #endif
6528 
6529 #ifdef _XMP_GASNET
6530  _XMP_gasnet_atomic_ref(image, c, dst_offset, value, elmt_size);
6531 #elif _XMP_FJRDMA
6532  _XMP_fjrdma_atomic_ref(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6533 #elif _XMP_UTOFU
6534  _XMP_utofu_atomic_ref(image, c, dst_offset, value, elmt_size);
6535 #elif _XMP_MPI3_ONESIDED
6536  _XMP_mpi_atomic_ref(image, c, dst_offset, value, elmt_size);
6537 #endif
6538 }
Here is the call graph for this function:

◆ _XMP_atomic_ref_2()

void _XMP_atomic_ref_2 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int *  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6542 {
6543 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6544  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6545  int image = c->distance_of_image_elmts[0] * image0
6546  + c->distance_of_image_elmts[1] * image1;
6547 #endif
6548 
6549 #ifdef _XMP_GASNET
6550  _XMP_gasnet_atomic_ref(image, c, dst_offset, value, elmt_size);
6551 #elif _XMP_FJRDMA
6552  _XMP_fjrdma_atomic_ref(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6553 #elif _XMP_UTOFU
6554  _XMP_utofu_atomic_ref(image, c, dst_offset, value, elmt_size);
6555 #elif _XMP_MPI3_ONESIDED
6556  _XMP_mpi_atomic_ref(image, c, dst_offset, value, elmt_size);
6557 #endif
6558 }
Here is the call graph for this function:

◆ _XMP_atomic_ref_3()

void _XMP_atomic_ref_3 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int  image2,
int *  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6562 {
6563 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6564  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6565  int image = c->distance_of_image_elmts[0] * image0
6566  + c->distance_of_image_elmts[1] * image1
6567  + c->distance_of_image_elmts[2] * image2;
6568 #endif
6569 
6570 #ifdef _XMP_GASNET
6571  _XMP_gasnet_atomic_ref(image, c, dst_offset, value, elmt_size);
6572 #elif _XMP_FJRDMA
6573  _XMP_fjrdma_atomic_ref(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6574 #elif _XMP_UTOFU
6575  _XMP_utofu_atomic_ref(image, c, dst_offset, value, elmt_size);
6576 #elif _XMP_MPI3_ONESIDED
6577  _XMP_mpi_atomic_ref(image, c, dst_offset, value, elmt_size);
6578 #endif
6579 }
Here is the call graph for this function:

◆ _XMP_atomic_ref_4()

void _XMP_atomic_ref_4 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int  image2,
int  image3,
int *  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6583 {
6584 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6585  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6586  int image = c->distance_of_image_elmts[0] * image0
6587  + c->distance_of_image_elmts[1] * image1
6588  + c->distance_of_image_elmts[2] * image2
6589  + c->distance_of_image_elmts[3] * image3;
6590 #endif
6591 
6592 #ifdef _XMP_GASNET
6593  _XMP_gasnet_atomic_ref(image, c, dst_offset, value, elmt_size);
6594 #elif _XMP_FJRDMA
6595  _XMP_fjrdma_atomic_ref(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6596 #elif _XMP_UTOFU
6597  _XMP_utofu_atomic_ref(image, c, dst_offset, value, elmt_size);
6598 #elif _XMP_MPI3_ONESIDED
6599  _XMP_mpi_atomic_ref(image, c, dst_offset, value, elmt_size);
6600 #endif
6601 }
Here is the call graph for this function:

◆ _XMP_atomic_ref_5()

void _XMP_atomic_ref_5 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int  image2,
int  image3,
int  image4,
int *  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6606 {
6607 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6608  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6609  int image = c->distance_of_image_elmts[0] * image0
6610  + c->distance_of_image_elmts[1] * image1
6611  + c->distance_of_image_elmts[2] * image2
6612  + c->distance_of_image_elmts[3] * image3
6613  + c->distance_of_image_elmts[4] * image4;
6614 #endif
6615 
6616 #ifdef _XMP_GASNET
6617  _XMP_gasnet_atomic_ref(image, c, dst_offset, value, elmt_size);
6618 #elif _XMP_FJRDMA
6619  _XMP_fjrdma_atomic_ref(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6620 #elif _XMP_UTOFU
6621  _XMP_utofu_atomic_ref(image, c, dst_offset, value, elmt_size);
6622 #elif _XMP_MPI3_ONESIDED
6623  _XMP_mpi_atomic_ref(image, c, dst_offset, value, elmt_size);
6624 #endif
6625 }
Here is the call graph for this function:

◆ _XMP_atomic_ref_6()

void _XMP_atomic_ref_6 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int  image2,
int  image3,
int  image4,
int  image5,
int *  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6630 {
6631 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6632  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6633  int image = c->distance_of_image_elmts[0] * image0
6634  + c->distance_of_image_elmts[1] * image1
6635  + c->distance_of_image_elmts[2] * image2
6636  + c->distance_of_image_elmts[3] * image3
6637  + c->distance_of_image_elmts[4] * image4
6638  + c->distance_of_image_elmts[5] * image5;
6639 #endif
6640 
6641 #ifdef _XMP_GASNET
6642  _XMP_gasnet_atomic_ref(image, c, dst_offset, value, elmt_size);
6643 #elif _XMP_FJRDMA
6644  _XMP_fjrdma_atomic_ref(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6645 #elif _XMP_UTOFU
6646  _XMP_utofu_atomic_ref(image, c, dst_offset, value, elmt_size);
6647 #elif _XMP_MPI3_ONESIDED
6648  _XMP_mpi_atomic_ref(image, c, dst_offset, value, elmt_size);
6649 #endif
6650 }
Here is the call graph for this function:

◆ _XMP_atomic_ref_7()

void _XMP_atomic_ref_7 ( void *  dst_desc,
size_t  dst_offset,
int  image0,
int  image1,
int  image2,
int  image3,
int  image4,
int  image5,
int  image6,
int *  value,
void *  src_desc,
size_t  src_offset,
size_t  elmt_size 
)
6655 {
6656 #if defined(_XMP_GASNET) || defined(_XMP_FJRDMA) || defined(_XMP_MPI3_ONESIDED) || defined(_XMP_UTOFU)
6657  _XMP_coarray_t* c = (_XMP_coarray_t*)dst_desc;
6658  int image = c->distance_of_image_elmts[0] * image0
6659  + c->distance_of_image_elmts[1] * image1
6660  + c->distance_of_image_elmts[2] * image2
6661  + c->distance_of_image_elmts[3] * image3
6662  + c->distance_of_image_elmts[4] * image4
6663  + c->distance_of_image_elmts[5] * image5
6664  + c->distance_of_image_elmts[6] * image6;
6665 #endif
6666 
6667 #ifdef _XMP_GASNET
6668  _XMP_gasnet_atomic_ref(image, c, dst_offset, value, elmt_size);
6669 #elif _XMP_FJRDMA
6670  _XMP_fjrdma_atomic_ref(image, c, dst_offset, value, src_desc, src_offset, elmt_size);
6671 #elif _XMP_UTOFU
6672  _XMP_utofu_atomic_ref(image, c, dst_offset, value, elmt_size);
6673 #elif _XMP_MPI3_ONESIDED
6674  _XMP_mpi_atomic_ref(image, c, dst_offset, value, elmt_size);
6675 #endif
6676 }
Here is the call graph for this function:

◆ check_template()

int check_template ( _XMP_template_t dst_t,
_XMP_template_t src_t 
)
1217 {
1218  int i, j;
1219 
1220  if(dst_t == src_t) return 1;
1221 
1222  if(dst_t->dim != src_t->dim ||
1223  dst_t->onto_nodes != src_t->onto_nodes ||
1224  !dst_t->is_fixed || !src_t->is_fixed) return 0;
1225 
1226  for(i=0; i<dst_t->dim; i++){
1227  if(dst_t->chunk[i].par_lower != src_t->chunk[i].par_lower ||
1228  dst_t->chunk[i].par_upper != src_t->chunk[i].par_upper ||
1229  dst_t->chunk[i].par_width != src_t->chunk[i].par_width ||
1230  dst_t->chunk[i].par_stride != src_t->chunk[i].par_stride ||
1231  dst_t->chunk[i].par_chunk_width != src_t->chunk[i].par_chunk_width ||
1232  dst_t->chunk[i].dist_manner != src_t->chunk[i].dist_manner ||
1233  dst_t->chunk[i].onto_nodes_index != src_t->chunk[i].onto_nodes_index) return 0;
1234  if(dst_t->chunk[i].dist_manner == _XMP_N_DIST_GBLOCK){
1235  for(j=0; j<=dst_t->onto_nodes->info[dst_t->chunk[i].onto_nodes_index].size; j++){
1236  if(dst_t->chunk[i].mapping_array[j] != src_t->chunk[i].mapping_array[j]) return 0;
1237  }
1238  }
1239  }
1240 
1241  return 1;
1242 }
Here is the caller graph for this function:

◆ xmp_gather()

void xmp_gather ( void *  x_d,
void *  a_d,
  ... 
)
4768 {
4769  int i;
4770  va_list valst;
4771  _XMP_array_t *idx_p;
4772  _XMP_array_t **idx_array;
4773  _XMP_array_t *a_p = (_XMP_array_t *)a_d;
4774 
4775  idx_array = (_XMP_array_t **)_XMP_alloc(sizeof(_XMP_array_t *)*a_p->dim);
4776 
4777  va_start( valst, a_d );
4778  for(i=0;i<a_p->dim;i++){
4779  idx_p = va_arg( valst , _XMP_array_t* );
4780  idx_array[i] = idx_p;
4781  }
4782  va_end(valst);
4783 
4784  xmp_gather_kernel(x_d, a_d, idx_array);
4785 
4786  _XMP_free(idx_array);
4787 }
Here is the call graph for this function:

◆ xmp_matmul()

void xmp_matmul ( void *  x_p,
void *  a_p,
void *  b_p 
)
3786 {
3787  _XMP_array_t *x_d;
3788  _XMP_array_t *a_d;
3789  _XMP_array_t *b_d;
3790  int same_nodes;
3791  int same_align;
3792  int duplicate;
3793  int dist_dim=0;
3794  int i;
3795 
3796  x_d = (_XMP_array_t*)x_p;
3797  a_d = (_XMP_array_t*)a_p;
3798  b_d = (_XMP_array_t*)b_p;
3799 
3800 
3801  /* error check */
3802  if(x_d->dim != 2 || a_d->dim != 2 || b_d->dim != 2){
3803  _XMP_fatal("xmp_matmul: argument dimension is not 2");
3804  return;
3805  }
3806  if(x_d->type != a_d->type || x_d->type != b_d->type){
3807  _XMP_fatal("xmp_matmul: argument type is not match");
3808  return;
3809  }
3810  if(!x_d->align_template->is_distributed ||
3811  !a_d->align_template->is_distributed ||
3813  _XMP_fatal("xmp_matmul: argument is not distributed");
3814  return;
3815  }
3816 
3817  /* same nodes? */
3818  same_nodes = 1;
3819  if(_XMP_get_execution_nodes()->comm_size != x_d->align_template->onto_nodes->comm_size) same_nodes = 0;
3820  if(_XMP_get_execution_nodes()->comm_size != a_d->align_template->onto_nodes->comm_size) same_nodes = 0;
3821  if(_XMP_get_execution_nodes()->comm_size != b_d->align_template->onto_nodes->comm_size) same_nodes = 0;
3822 
3823  /* duplicate? */
3824  duplicate = 0;
3825  for(i=0; i<x_d->dim; i++){
3826  if(x_d->info[i].align_template_index >= 0){
3827  duplicate++;
3828  }
3829  }
3830  if(duplicate >= x_d->align_template->onto_nodes->dim) duplicate = 0;
3831 
3832  /* distribute & align check */
3833  same_align = 0;
3834  if(same_nodes){
3835  for(i=0; i<x_d->dim; i++){
3836  if(x_d->info[i].align_manner == _XMP_N_ALIGN_BLOCK ||
3838  if(x_d->info[i].align_manner == a_d->info[i].align_manner &&
3839  x_d->info[i].align_manner == b_d->info[i].align_manner &&
3840  x_d->info[i].align_subscript == 0 &&
3841  a_d->info[i].align_subscript == 0 &&
3842  b_d->info[i].align_subscript == 0 &&
3843  x_d->info[i].ser_size == x_d->align_template->info[x_d->info[i].align_template_index].ser_size &&
3844  a_d->info[i].ser_size == a_d->align_template->info[a_d->info[i].align_template_index].ser_size &&
3845  b_d->info[i].ser_size == b_d->align_template->info[b_d->info[i].align_template_index].ser_size){
3846  same_align++;
3847  dist_dim = i;
3848  } else {
3849  same_align = 0;
3850  break;
3851  }
3852  }
3853  }
3854  }
3855 
3856  /* GBLOCK mapping check */
3857  if(same_align == 1 && x_d->info[dist_dim].align_manner == _XMP_N_ALIGN_GBLOCK){
3858  _XMP_template_chunk_t *x_chunk = &(x_d->align_template->chunk[x_d->info[dist_dim].align_template_index]);
3859  if(dist_dim == 0){
3860  _XMP_template_chunk_t *a_chunk = &(a_d->align_template->chunk[a_d->info[dist_dim].align_template_index]);
3861  for(i=0; i<x_d->align_template->onto_nodes->comm_size; i++){
3862  if(x_chunk->mapping_array[i] != a_chunk->mapping_array[i]){
3863  same_align = 0;
3864  break;
3865  }
3866  }
3867  } else {
3868  _XMP_template_chunk_t *b_chunk = &(b_d->align_template->chunk[b_d->info[dist_dim].align_template_index]);
3869  for(i=0; i<x_d->align_template->onto_nodes->comm_size; i++){
3870  if(x_chunk->mapping_array[i] != b_chunk->mapping_array[i]){
3871  same_align = 0;
3872  break;
3873  }
3874  }
3875  }
3876  } else if(same_align == 2){
3877  if(x_d->info[0].align_manner == _XMP_N_ALIGN_GBLOCK){
3880  for(i=0; i<x_d->align_template->onto_nodes->comm_size; i++){
3881  if(x_chunk->mapping_array[i] != a_chunk->mapping_array[i]){
3882  same_align = 0;
3883  break;
3884  }
3885  }
3886  }
3887  if(x_d->info[1].align_manner == _XMP_N_ALIGN_GBLOCK){
3890  for(i=0; i<x_d->align_template->onto_nodes->comm_size; i++){
3891  if(x_chunk->mapping_array[i] != b_chunk->mapping_array[i]){
3892  same_align = 0;
3893  break;
3894  }
3895  }
3896  }
3897  }
3898 
3899  /* */
3900  if(same_nodes && !duplicate && same_align == 1){
3901  xmp_matmul_allgather(x_d, a_d, b_d, dist_dim);
3902  } else if(xmpf_running && same_nodes && !duplicate && same_align == 2){
3903  xmp_matmul_blockf(x_d, a_d, b_d);
3904  } else if(!xmpf_running && same_nodes && !duplicate && same_align == 2){
3905  xmp_matmul_blockc(x_d, a_d, b_d);
3906  } else {
3907  xmp_matmul_no_opt(x_d, a_d, b_d);
3908  }
3909 }
Here is the call graph for this function:

◆ xmp_pack()

void xmp_pack ( void *  v_p,
void *  a_p,
void *  m_p 
)
5729 {
5730  _XMP_array_t *v_d;
5731  _XMP_array_t *a_d;
5732  _XMP_array_t *m_d;
5733  //int *mp;
5734  int i;
5735  MPI_Comm *comm;
5736  int /*myrank,*/size;
5737  MPI_Request *com_req1;
5738  int *offset;
5739  int *lindx;
5740  int *lindx2;
5741  int wkcount;
5742  int masknum;
5743  int localnum_a;
5744  int *maskflag;
5745  int *pickindx;
5746  int icounter;
5747  int vcount;
5748  int packnum;
5749  int packflag;
5750  void (*xmp_pack_recv_info)(_XMP_array_t *, _XMP_array_t *, int, int *,
5751  int *, int *, int *, int *, int, void *);
5752  void (*xmp_pack_send_info)(_XMP_array_t *, _XMP_array_t *, int, int *,
5753  int *, int *, void *);
5754  /* packing */
5755 
5756  /* pack-unpack list */
5757  struct Listindx {
5758  int indx;
5759  struct Listindx *next;
5760  };
5761 
5762  /* pack-unpack list */
5763  struct Listinfo {
5764  int num;
5765  struct Listindx *head;
5766  struct Listindx *tail;
5767  };
5768 
5769  struct Listinfo *listinfo1;
5770  struct Listinfo *listinfo2;
5771 
5772  struct Listindx *p;
5773  MPI_Status istatus;
5774  char *buf;
5775  char *buf2;
5776  int dtoffset;
5777  int dsize;
5778  int comcount;
5779  int j;
5780 
5781  xmp_pack_recv_info = xmp_pack_unpack_array_v;
5782  xmp_pack_send_info = xmp_pack_unpack_array_a;
5783 
5784  v_d = (_XMP_array_t*)v_p;
5785  a_d = (_XMP_array_t*)a_p;
5786  if(m_p==NULL){
5787  m_d = NULL;
5788  }else{
5789  m_d = (_XMP_array_t*)m_p;
5790  }
5791 
5792  /* error check */
5793  if(v_d->dim != 1){
5794  _XMP_fatal("xmp_pack: 1st argument dimension is not 1");
5795  return;
5796  }
5797 
5798  if(m_p!=NULL){
5799  if(a_d->dim != m_d->dim){
5800  _XMP_fatal("xmp_pack: 2nd and 3rd argument dimension is not match");
5801  return;
5802  }
5803  }
5804 
5805  if(v_d->type != a_d->type){
5806  _XMP_fatal("xmp_pack: 1st and 2nd argument type is not match");
5807  return;
5808  }
5809 
5810  if(!v_d->align_template->is_distributed ||
5812  _XMP_fatal("xmp_pack: argument is not distributed");
5813  if(m_p!=NULL){
5814  if(!m_d->align_template->is_distributed){
5815  _XMP_fatal("xmp_pack: argument is not distributed");
5816  }
5817  }
5818  return;
5819  }
5820 /*
5821  mp=NULL;
5822  if(m_d != NULL){
5823  mp=m_d->array_addr_p;
5824  }
5825 */
5826  comm = _XMP_get_execution_nodes()->comm;
5827 // myrank=_XMP_get_execution_nodes()->comm_rank;
5828  size =_XMP_get_execution_nodes()->comm_size;
5829 
5830  offset = (int*)_XMP_alloc((a_d->dim)*sizeof(int));
5831  lindx = (int*)_XMP_alloc((a_d->dim)*sizeof(int));
5832  lindx2 = (int*)_XMP_alloc((a_d->dim)*sizeof(int));
5833 
5834  /* packing */
5835  listinfo1 = (struct Listinfo*)_XMP_alloc(sizeof(struct Listinfo)*size);
5836  listinfo2 = (struct Listinfo*)_XMP_alloc(sizeof(struct Listinfo)*size);
5837  for(i=0;i<size;i++){
5838  listinfo1[i].num = 0;
5839  listinfo1[i].head = NULL;
5840  listinfo1[i].tail = NULL;
5841  listinfo2[i].num = 0;
5842  listinfo2[i].head = NULL;
5843  listinfo2[i].tail = NULL;
5844  }
5845 
5846  for(i=0; i<a_d->dim; i++){
5847  offset[i] = 0 - a_d->info[i].ser_lower;
5848  }
5849 
5850  /* gen maskXXX */
5851  masknum=1;
5852  localnum_a=1;
5853  for(i=0; i<a_d->dim; i++){
5854  masknum *= (a_d->info[i].ser_upper - a_d->info[i].ser_lower + 1);
5855  localnum_a *= (a_d->info[i].local_upper - a_d->info[i].local_lower + 1);
5856  }
5857  maskflag = (int*)_XMP_alloc(masknum*sizeof(int));
5858  pickindx = (int*)_XMP_alloc(masknum*sizeof(int));
5859 
5860  com_req1 = (MPI_Request*)_XMP_alloc(size*sizeof(MPI_Request));
5861 
5862  /* init maksXXX */
5863  for(i=0;i<masknum;i++){
5864  maskflag[i]=0;
5865  pickindx[i]=v_d->info[0].ser_lower - 1;
5866  }
5867  for(i=0;i<size;i++){
5868  com_req1[i] = MPI_REQUEST_NULL;
5869  }
5870 
5871  wkcount=0;
5872 
5873  if(m_d != NULL){
5874  if(xmpf_running){
5875  xmp_pack_unpack_dim(m_d, m_d->dim, offset, &wkcount, maskflag, lindx2);
5876  }else{
5877  xmp_pack_unpack_dim(m_d, -1, offset, &wkcount, maskflag, lindx2);
5878  }
5879  }
5880 
5881  /* gather(reduce) all mask */
5882  if(m_d != NULL){
5883  MPI_Allreduce(MPI_IN_PLACE, maskflag, masknum, MPI_INT, MPI_SUM, *comm);
5884  }else{
5885  for(i=0;i<masknum;i++){
5886  maskflag[i] = 1;
5887  }
5888  wkcount = masknum;
5889  }
5890 
5891  icounter=v_d->info[0].ser_lower;
5892  packnum=0;
5893  for(i=0;i<masknum;i++){
5894  if(maskflag[i]==1){
5895  pickindx[i]=icounter++;
5896  packnum++;
5897  }
5898  }
5899 
5900  packflag = 1;
5901  wkcount=0;
5902  vcount=0;
5903 
5904  /* pack data recv info */
5905  if(xmpf_running){
5906  xmp_pack_recv_info(a_d, v_d, a_d->dim, offset, &wkcount, lindx2, pickindx,
5907  &vcount, packflag,(void *)listinfo2);
5908  }else{
5909  xmp_pack_recv_info(a_d, v_d, -1, offset, &wkcount, lindx2, pickindx,
5910  &vcount, packflag,(void *)listinfo2);
5911  }
5912 
5913  /* pack data send info*/
5914  wkcount=0;
5915 
5916  if(xmpf_running){
5917  xmp_pack_send_info(a_d, v_d, a_d->dim, offset, lindx2, pickindx,
5918  (void *)listinfo1);
5919  }else{
5920  xmp_pack_send_info(a_d, v_d, -1, offset, lindx2, pickindx,
5921  (void *)listinfo1);
5922  }
5923 
5924  /* send packing data */
5925  dsize=0;
5926  for(i=0;i<size;i++){
5927  if(listinfo1[i].num > 0){
5928  p = listinfo1[i].head;
5929  for(j=0;j<listinfo1[i].num;j++){
5930  dsize++;
5931  }
5932  }
5933  }
5934 
5935  buf = (char*)_XMP_alloc(a_d->type_size*dsize);
5936 
5937  comcount=0;
5938  dtoffset=0;
5939  for(i=0;i<size;i++){
5940  if(listinfo1[i].num > 0){
5941  p = listinfo1[i].head;
5942  for(j=0;j<listinfo1[i].num;j++){
5943  memcpy(buf+j*a_d->type_size+dtoffset,
5944  (char *)a_d->array_addr_p+p->indx*a_d->type_size,
5945  a_d->type_size);
5946  p = p->next;
5947  }
5948  MPI_Isend(buf+dtoffset, a_d->type_size*listinfo1[i].num, MPI_BYTE,
5949  i, 99, *comm, &com_req1[comcount]);
5950  dtoffset += listinfo1[i].num*a_d->type_size;
5951  comcount++;
5952  }
5953  }
5954 
5955  /* recv packing data */
5956  for(i=0;i<size;i++){
5957  if(listinfo2[i].num > 0){
5958  buf2 = (char*)_XMP_alloc(v_d->type_size*listinfo2[i].num);
5959 
5960  MPI_Recv(buf2, v_d->type_size*listinfo2[i].num, MPI_BYTE, i, 99, *comm, &istatus);
5961 
5962  p = listinfo2[i].head;
5963  for(j=0;j<listinfo2[i].num;j++){
5964 
5965  memcpy((char *)v_d->array_addr_p+p->indx*v_d->type_size,
5966  buf2+j*v_d->type_size,
5967  v_d->type_size);
5968  p = p->next;
5969  }
5970  _XMP_free(buf2);
5971  }
5972  }
5973 
5974  if(comcount > 0){
5975  MPI_Waitall(comcount, com_req1, MPI_STATUSES_IGNORE);
5976  }
5977  _XMP_free(buf);
5978 
5979  /* duplicate */
5980  duplicate_copy(v_d);
5981 
5982  _XMP_free(maskflag);
5983  _XMP_free(pickindx);
5984  _XMP_free(com_req1);
5985  _XMP_free(offset);
5986  _XMP_free(lindx);
5987  _XMP_free(lindx2);
5988  _XMP_free(listinfo1);
5989  _XMP_free(listinfo2);
5990 
5991  return;
5992 }
Here is the caller graph for this function:

◆ xmp_pack_mask()

void xmp_pack_mask ( void *  v_p,
void *  a_p,
void *  m_p 
)
5996 {
5997  xmp_pack(v_p, a_p, m_p);
5998 }
Here is the call graph for this function:

◆ xmp_pack_nomask()

void xmp_pack_nomask ( void *  v_p,
void *  a_p 
)
6002 {
6003  xmp_pack(v_p, a_p, NULL);
6004 }
Here is the call graph for this function:

◆ xmp_scatter()

void xmp_scatter ( void *  x_d,
void *  a_d,
  ... 
)
5004 {
5005  int i;
5006  va_list valst;
5007  _XMP_array_t *idx_p;
5008  _XMP_array_t **idx_array;
5009  _XMP_array_t *x_p = (_XMP_array_t *)x_d;
5010  _XMP_array_t *a_p = (_XMP_array_t *)a_d;
5011 
5012  idx_array = (_XMP_array_t **)_XMP_alloc(sizeof(_XMP_array_t *)*a_p->dim);
5013 
5014  va_start( valst, a_d );
5015  for(i=0;i<x_p->dim;i++){
5016  idx_p = va_arg( valst , _XMP_array_t* );
5017  idx_array[i] = idx_p;
5018  }
5019  va_end(valst);
5020 
5021  xmp_scatter_kernel(x_d, a_d, idx_array);
5022 
5023  _XMP_free(idx_array);
5024 }
Here is the call graph for this function:

◆ xmp_transpose()

void xmp_transpose ( void *  dst_p,
void *  src_p,
int  opt 
)
1246 {
1247  _XMP_array_t *dst_d;
1248  _XMP_array_t *src_d;
1249  int same_nodes;
1250  int same_template;
1251  int same_align;
1252  int dist_num;
1253  int dist_dim;
1254  int regular;
1255  int duplicate;
1256  int dst_alloc_size[2];
1257  int src_alloc_size[2];
1258  int i, j, k;
1259 
1260  dst_d = (_XMP_array_t*)dst_p;
1261  src_d = (_XMP_array_t*)src_p;
1262 
1263  /* error check */
1264  if(dst_d->dim != 2 || src_d->dim != 2){
1265  _XMP_fatal("xmp_transpose: argument dimension is not 2");
1266  return;
1267  }
1268  if(dst_d->type != src_d->type){
1269  _XMP_fatal("xmp_transpose: argument type is not match");
1270  return;
1271  }
1273  _XMP_fatal("xmp_transpose: argument is not distributed");
1274  return;
1275  }
1276 
1277  /* allocate check */
1278  if(dst_d->is_allocated){
1279  dst_alloc_size[0] = dst_d->info[0].alloc_size;
1280  dst_alloc_size[1] = dst_d->info[1].alloc_size;
1281  } else {
1282  dst_alloc_size[0] = 0;
1283  dst_alloc_size[1] = 0;
1284  }
1285  if(src_d->is_allocated){
1286  src_alloc_size[0] = src_d->info[0].alloc_size;
1287  src_alloc_size[1] = src_d->info[1].alloc_size;
1288  } else {
1289  src_alloc_size[0] = 0;
1290  src_alloc_size[1] = 0;
1291  }
1292 
1293  /* same nodes? */
1294  same_nodes=1;
1295  if(_XMP_get_execution_nodes()->comm_size != dst_d->align_template->onto_nodes->comm_size) same_nodes = 0;
1296  if(_XMP_get_execution_nodes()->comm_size != src_d->align_template->onto_nodes->comm_size) same_nodes = 0;
1297 
1298  /* duplicate? */
1299  duplicate = 0;
1300  for(i=0; i<dst_d->dim; i++){
1301  if(dst_d->info[i].align_template_index >= 0){
1302  duplicate++;
1303  }
1304  }
1305  if(duplicate >= dst_d->align_template->onto_nodes->dim) duplicate = 0;
1306 
1307 
1308  /* same template? */
1309  same_template = check_template(dst_d->align_template, src_d->align_template);
1310 
1311  /* same align? */
1312  same_align = 1;
1313  if(dst_d->info[0].align_template_index != src_d->info[0].align_template_index) same_align = 0;
1314  if(dst_d->info[1].align_template_index != src_d->info[1].align_template_index) same_align = 0;
1315 
1316  /* distribute num & regular */
1317  dist_num = 0;
1318  dist_dim = -1;
1319  regular = 0;
1320  for(i=0; i<src_d->dim; i++){
1321  j = src_d->info[i].align_template_index;
1322  if(j >= 0){
1323  switch(src_d->align_template->chunk[j].dist_manner){
1324  case _XMP_N_DIST_BLOCK:
1325  if(same_align && src_d->info[i].align_manner == dst_d->info[i].align_manner){
1326  if(dist_num == 0 &&
1327  src_d->info[i].ser_size == src_d->align_template->info[j].ser_size &&
1328  src_d->info[i].ser_size%_XMP_get_execution_nodes()->comm_size == 0 &&
1329  dst_d->info[i].ser_size == dst_d->align_template->info[j].ser_size &&
1330  dst_d->info[i].ser_size%_XMP_get_execution_nodes()->comm_size == 0) {
1331  regular = 1;
1332  } else {
1333  regular = 0;
1334  }
1335  }
1336  dist_num++;
1337  dist_dim = i;
1338  break;
1339  case _XMP_N_DIST_CYCLIC:
1341  dist_num++;
1342  dist_dim = i;
1343  break;
1344  case _XMP_N_DIST_GBLOCK:
1345  if(same_align && src_d->info[i].align_manner == dst_d->info[i].align_manner){
1346  _XMP_template_chunk_t *src_c = &(src_d->align_template->chunk[src_d->info[i].align_template_index]);
1347  _XMP_template_chunk_t *dst_c = &(dst_d->align_template->chunk[dst_d->info[i].align_template_index]);
1348  unsigned long long w;
1349  if(dist_num == 0 &&
1350  src_d->info[i].ser_size == src_d->align_template->info[j].ser_size &&
1351  dst_d->info[i].ser_size == dst_d->align_template->info[j].ser_size){
1352  regular = 1;
1353 
1354  w=src_c->mapping_array[1]-src_c->mapping_array[0];
1355  for(k=1; k<=src_c->onto_nodes_info->size; k++){
1356  if((src_c->mapping_array[k]-src_c->mapping_array[k-1]) != w) regular = 0;
1357  }
1358  w=dst_c->mapping_array[1]-dst_c->mapping_array[0];
1359  for(k=1; k<=dst_c->onto_nodes_info->size; k++){
1360  if((dst_c->mapping_array[k]-dst_c->mapping_array[k-1]) != w) regular = 0;
1361  }
1362  }
1363  }
1364  dist_num++;
1365  dist_dim = i;
1366  break;
1367  default:
1368  break;
1369  }
1370  }
1371  }
1372  /* regular? */
1373  if(src_d->info[0].align_subscript != 0 || src_d->info[1].align_subscript != 0 ||
1374  dst_d->info[0].align_subscript != 0 || dst_d->info[1].align_subscript != 0 ) regular = 0;
1375 
1376 #ifdef DEBUG
1377  for(i=0; i<_XMP_get_execution_nodes()->comm_size; i++){
1378  if(i == _XMP_get_execution_nodes()->comm_rank){
1379  printf("rank%d: nodes %d: template %d: align %d: regular %d\n",
1380  i, same_nodes, same_template, same_align, regular);
1381  fflush(stdout);
1382  }
1383  fflush(stdout);
1384  MPI_Barrier(*(MPI_Comm*)(_XMP_get_execution_nodes()->comm));
1385  }
1386 #endif
1387 
1388  /*============================================================================================*/
1389  /* same_node && same_template && !same_align && dist_num==1 : no MPI communication */
1390  /* same_node && same_align && regular && dist_num==1 : use collective MPI communication */
1391  /* other: pack/unpack + send/recv */
1392  /*============================================================================================*/
1393  if(same_nodes && same_template && !same_align && dist_num == 1 &&
1394  dst_d->info[0].align_subscript == src_d->info[1].align_subscript &&
1395  dst_d->info[1].align_subscript == src_d->info[0].align_subscript){
1396  /* no MPI communication transpose */
1397  int di, dj;
1398  char *dst_array_p = (char*)dst_d->array_addr_p;
1399  char *src_array_p = (char*)src_d->array_addr_p;
1400 
1401 #ifdef DEBUG
1402  show_all(src_d);
1403  show_all(dst_d);
1404 #endif
1405  if(xmpf_running){ /* Fortran */
1406  if(dst_d->is_allocated && src_d->is_allocated){
1407  for(j=src_d->info[1].local_lower; j<=src_d->info[1].local_upper; j++){
1408  di = j-src_d->info[1].local_lower+dst_d->info[0].local_lower;
1409  for(i=src_d->info[0].local_lower; i<=src_d->info[0].local_upper; i++){
1410  dj = i-src_d->info[0].local_lower+dst_d->info[1].local_lower;
1411  memcpy(dst_array_p+(dj*dst_alloc_size[0]+di)*dst_d->type_size,
1412  src_array_p+(j*src_alloc_size[0]+i)*src_d->type_size,
1413  src_d->type_size);
1414  }
1415  }
1416  }
1417  } else { /* C */
1418  if(dst_d->is_allocated && src_d->is_allocated){
1419  for(i=src_d->info[0].local_lower; i<=src_d->info[0].local_upper; i++){
1420  dj = i-src_d->info[0].local_lower+dst_d->info[1].local_lower;
1421  for(j=src_d->info[1].local_lower; j<=src_d->info[1].local_upper; j++){
1422  di = j-src_d->info[1].local_lower+dst_d->info[0].local_lower;
1423  memcpy(dst_array_p+(di*dst_alloc_size[1]+dj)*dst_d->type_size,
1424  src_array_p+(i*src_alloc_size[1]+j)*src_d->type_size,
1425  src_d->type_size);
1426  }
1427  }
1428  }
1429  }
1430 #ifdef DEBUG
1431  show_array(src_d, NULL);
1432  show_array(dst_d, NULL);
1433 #endif
1434 
1435  }
1436  else if(xmpf_running && same_nodes && same_align && regular && !duplicate &&
1437  dist_num == 1 && dist_dim == 1 && dst_d->info[dist_dim].align_manner == _XMP_N_ALIGN_BLOCK &&
1438  dst_d->info[dist_dim].shadow_size_lo == 0 && dst_d->info[dist_dim].shadow_size_hi == 0 &&
1439  src_d->info[dist_dim].shadow_size_lo == 0 && src_d->info[dist_dim].shadow_size_hi == 0){
1440  /* original xmp_transpose (Fortran) */
1441  /* start_collection("xmp_transpose_original"); */
1442  xmp_transpose_original(dst_d, src_d, opt);
1443  /* stop_collection("xmp_transpose_original"); */
1444 
1445  }
1446  else if(same_nodes && same_align && regular && !duplicate && dist_num == 1){
1447  /* collective MPI communication transpose */
1448  /* start_collection("xmp_transpose_alltoall"); */
1449  xmp_transpose_alltoall(dst_d, src_d, opt, dist_dim);
1450  /* stop_collection("xmp_transpose_alltoall"); */
1451 
1452  /* } else if(same_nodes && same_align && !duplicate && dist_num == 1){ */
1453  /* TODO: not support (block size is not even) */
1454  /* /\* collective MPI communication transpose *\/ */
1455  /* xmp_transpose_alltoallv(dst_d, src_d, opt, dist_dim); */
1456 
1457  }
1458  else {
1459  /* pack/unpack + sendrecv */
1460  xmp_transpose_no_opt(dst_d, src_d, opt);
1461  }
1462 }
Here is the call graph for this function:

◆ xmp_unpack()

void xmp_unpack ( void *  a_p,
void *  v_p,
void *  m_p 
)
6032 {
6033  _XMP_array_t *v_d;
6034  _XMP_array_t *a_d;
6035  _XMP_array_t *m_d;
6036 // int *mp;
6037  int i;
6038  MPI_Comm *comm;
6039  int /*myrank,*/size;
6040  MPI_Request *com_req2;
6041  int *offset;
6042  int *lindx;
6043  int *lindx2;
6044  int wkcount;
6045  int masknum;
6046  int localnum_v;
6047  int *maskflag;
6048  int *pickindx;
6049  int icounter;
6050  int vcount;
6051  int packnum;
6052  int packflag;
6053  void (*xmp_unpack_send_info)(_XMP_array_t *, _XMP_array_t *, int, int *,
6054  int *, int *, int *, int *, int, void *);
6055  void (*xmp_unpack_recv_info)(_XMP_array_t *, _XMP_array_t *, int, int *,
6056  int *, int *, void *);
6057  /* packing */
6058  /* pack-unpack list */
6059  struct Listindx {
6060  int indx;
6061  struct Listindx *next;
6062  };
6063  /* pack-unpack list */
6064  struct Listinfo {
6065  int num;
6066  struct Listindx *head;
6067  struct Listindx *tail;
6068  };
6069  struct Listinfo *listinfo1;
6070  struct Listinfo *listinfo2;
6071  struct Listindx *p;
6072  MPI_Status istatus;
6073  char *buf;
6074  char *buf2;
6075  int dtoffset;
6076  int dsize;
6077  int comcount;
6078  int j;
6079 
6080  xmp_unpack_send_info = xmp_pack_unpack_array_v;
6081  xmp_unpack_recv_info = xmp_pack_unpack_array_a;
6082 
6083  a_d = (_XMP_array_t*)a_p;
6084  v_d = (_XMP_array_t*)v_p;
6085  if(m_p==NULL){
6086  m_d = NULL;
6087  }else{
6088  m_d = (_XMP_array_t*)m_p;
6089  }
6090 
6091  /* error check */
6092  if(v_d->dim != 1){
6093  _XMP_fatal("xmp_unpack: 2st argument dimension is not 1");
6094  return;
6095  }
6096 
6097  if(m_p!=NULL){
6098  if(a_d->dim != m_d->dim){
6099  _XMP_fatal("xmp_unpack: 1nd and 3rd argument dimension is not match");
6100  return;
6101  }
6102  }
6103 
6104  if(a_d->type != v_d->type){
6105  _XMP_fatal("xmp_unpack: 1st and 2nd argument type is not match");
6106  return;
6107  }
6108 
6109  if(!v_d->align_template->is_distributed ||
6111  _XMP_fatal("xmp_unpack: argument is not distributed");
6112  if(m_p!=NULL){
6113  if(!m_d->align_template->is_distributed){
6114  _XMP_fatal("xmp_unpack: argument is not distributed");
6115  }
6116  }
6117  return;
6118  }
6119 /*
6120  mp=NULL;
6121  if(m_d != NULL){
6122  mp=m_d->array_addr_p;
6123  }*/
6124 
6125  comm = _XMP_get_execution_nodes()->comm;
6126  //myrank=_XMP_get_execution_nodes()->comm_rank;
6127  size =_XMP_get_execution_nodes()->comm_size;
6128 
6129  offset = (int*)_XMP_alloc((a_d->dim)*sizeof(int));
6130  lindx = (int*)_XMP_alloc((a_d->dim)*sizeof(int));
6131  lindx2 = (int*)_XMP_alloc((a_d->dim)*sizeof(int));
6132 
6133  /* packing */
6134  listinfo1 = (struct Listinfo*)_XMP_alloc(sizeof(struct Listinfo)*size);
6135  listinfo2 = (struct Listinfo*)_XMP_alloc(sizeof(struct Listinfo)*size);
6136  for(i=0;i<size;i++){
6137  listinfo1[i].num = 0;
6138  listinfo1[i].head = NULL;
6139  listinfo1[i].tail = NULL;
6140  listinfo2[i].num = 0;
6141  listinfo2[i].head = NULL;
6142  listinfo2[i].tail = NULL;
6143  }
6144 
6145  for(i=0; i<a_d->dim; i++){
6146  offset[i] = 0 - a_d->info[i].ser_lower;
6147  }
6148 
6149  /* gen maskXXX */
6150  masknum=1;
6151  localnum_v=1;
6152  for(i=0; i<a_d->dim; i++){
6153  masknum *= (a_d->info[i].ser_upper - a_d->info[i].ser_lower + 1);
6154  }
6155  for(i=0; i<v_d->dim; i++){
6156  localnum_v *= (v_d->info[i].local_upper - v_d->info[i].local_lower + 1);
6157  }
6158  maskflag = (int*)_XMP_alloc(masknum*sizeof(int));
6159  pickindx = (int*)_XMP_alloc(masknum*sizeof(int));
6160 
6161  com_req2 = (MPI_Request*)_XMP_alloc(size*sizeof(MPI_Request));
6162 
6163  /* init maksXXX */
6164  for(i=0;i<masknum;i++){
6165  maskflag[i]=0;
6166  pickindx[i]=v_d->info[0].ser_lower - 1;
6167  }
6168  for(i=0;i<size;i++){
6169  com_req2[i] = MPI_REQUEST_NULL;
6170  }
6171 
6172  wkcount=0;
6173 
6174  if(m_d != NULL){
6175  if(xmpf_running){
6176  xmp_pack_unpack_dim(m_d, m_d->dim, offset, &wkcount, maskflag, lindx2);
6177  }else{
6178  xmp_pack_unpack_dim(m_d, -1, offset, &wkcount, maskflag, lindx2);
6179  }
6180  }
6181 
6182  /* gather(reduce) all mask */
6183  if(m_d != NULL){
6184  MPI_Allreduce(MPI_IN_PLACE, maskflag, masknum, MPI_INT, MPI_SUM, *comm);
6185  }else{
6186  for(i=0;i<masknum;i++){
6187  maskflag[i] = 1;
6188  }
6189  wkcount = masknum;
6190  }
6191 
6192  icounter=v_d->info[0].ser_lower;
6193  packnum=0;
6194  for(i=0;i<masknum;i++){
6195  if(maskflag[i]==1){
6196  pickindx[i]=icounter++;
6197  packnum++;
6198  }
6199  }
6200 
6201  packflag = 0;
6202  wkcount=0;
6203  vcount=0;
6204 
6205  /* unpack data send info */
6206  if(xmpf_running){
6207  xmp_unpack_send_info(a_d, v_d, a_d->dim, offset, &wkcount, lindx2, pickindx,
6208  &vcount, packflag, listinfo2);
6209  }else{
6210  xmp_unpack_send_info(a_d, v_d, -1, offset, &wkcount, lindx2, pickindx,
6211  &vcount, packflag, listinfo2);
6212  }
6213 
6214  /* unpack data recv info */
6215  wkcount=0;
6216 
6217  if(xmpf_running){
6218  xmp_unpack_recv_info(a_d, v_d, a_d->dim, offset, lindx2, pickindx,
6219  listinfo1);
6220  }else{
6221  xmp_unpack_recv_info(a_d, v_d, -1, offset, lindx2, pickindx,
6222  listinfo1);
6223  }
6224 
6225  /* send packing data */
6226  dsize=0;
6227  for(i=0;i<size;i++){
6228  if(listinfo2[i].num > 0){
6229  p = listinfo2[i].head;
6230  for(j=0;j<listinfo2[i].num;j++){
6231  dsize++;
6232  }
6233  }
6234  }
6235 
6236  buf = (char*)_XMP_alloc(v_d->type_size*dsize);
6237 
6238  comcount=0;
6239  dtoffset=0;
6240  for(i=0;i<size;i++){
6241  if(listinfo2[i].num > 0){
6242  p = listinfo2[i].head;
6243  for(j=0;j<listinfo2[i].num;j++){
6244  memcpy(buf+j*v_d->type_size+dtoffset,
6245  (char *)v_d->array_addr_p+p->indx*v_d->type_size,
6246  v_d->type_size);
6247  p = p->next;
6248  }
6249  MPI_Isend(buf+dtoffset, v_d->type_size*listinfo2[i].num, MPI_BYTE,
6250  i, 99, *comm, &com_req2[comcount]);
6251  dtoffset += listinfo2[i].num*v_d->type_size;
6252  comcount++;
6253  }
6254  }
6255 
6256  /* recv packing data */
6257  for(i=0;i<size;i++){
6258  if(listinfo1[i].num > 0){
6259  buf2 = (char*)_XMP_alloc(a_d->type_size*listinfo1[i].num);
6260 
6261  MPI_Recv(buf2, a_d->type_size*listinfo1[i].num, MPI_BYTE, i, 99, *comm, &istatus);
6262 
6263  p = listinfo1[i].head;
6264  for(j=0;j<listinfo1[i].num;j++){
6265  memcpy((char *)a_d->array_addr_p+p->indx*a_d->type_size,
6266  buf2+j*a_d->type_size,
6267  a_d->type_size);
6268  p = p->next;
6269  }
6270  _XMP_free(buf2);
6271  }
6272  }
6273 
6274  if(comcount > 0){
6275  MPI_Waitall(comcount, com_req2, MPI_STATUSES_IGNORE);
6276  }
6277  _XMP_free(buf);
6278 
6279  /* duplicate */
6280  duplicate_copy(a_d);
6281 
6282  _XMP_free(maskflag);
6283  _XMP_free(pickindx);
6284  _XMP_free(com_req2);
6285  _XMP_free(offset);
6286  _XMP_free(lindx);
6287  _XMP_free(lindx2);
6288  _XMP_free(listinfo1);
6289  _XMP_free(listinfo2);
6290 
6291  return;
6292 }
Here is the caller graph for this function:

◆ xmp_unpack_mask()

void xmp_unpack_mask ( void *  a_p,
void *  v_p,
void *  m_p 
)
6296 {
6297  xmp_unpack(v_p, a_p, m_p);
6298 }
Here is the call graph for this function:

◆ xmp_unpack_nomask()

void xmp_unpack_nomask ( void *  a_p,
void *  v_p 
)
6302 {
6303  xmp_unpack(a_p, v_p, NULL);
6304 }
Here is the call graph for this function:

◆ xmpf_gather()

void xmpf_gather ( void *  x_p,
void *  a_p,
_XMP_array_t **  idx_array 
)
4790 {
4791  xmpf_running = 1;
4792  xmp_gather_kernel(x_p, a_p, idx_array);
4793  xmpf_running = 0;
4794 }

◆ 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_scatter()

void xmpf_scatter ( void *  x_p,
void *  a_p,
_XMP_array_t **  idx_array 
)
5027 {
5028  xmpf_running = 1;
5029  xmp_scatter_kernel(x_p, a_p, idx_array);
5030  xmpf_running = 0;
5031 }

◆ 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 }
_XMP_array_info_type::align_subscript
long long align_subscript
Definition: xmp_data_struct.h:246
_XMP_gasnet_atomic_ref
void _XMP_gasnet_atomic_ref(int target_rank, _XMP_coarray_t *dst_desc, size_t dst_offset, int *value, size_t elmt_size)
Definition: xmp_intrinsic_gasnet.c:95
_XMP_template_chunk_type::par_upper
long long par_upper
Definition: xmp_data_struct.h:81
_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_type::comm_size
int comm_size
Definition: xmp_data_struct.h:48
_XMP_mpi_atomic_ref
void _XMP_mpi_atomic_ref(int target_rank, _XMP_coarray_t *c, size_t offset, int *value, size_t elmt_size)
Definition: xmp_intrinsic_mpi.c:21
_XMP_template_type::info
_XMP_template_info_t info[1]
Definition: xmp_data_struct.h:115
_XMP_template_info_type::ser_size
unsigned long long ser_size
Definition: xmp_data_struct.h:74
_XMP_array_info_type::align_template_index
int align_template_index
Definition: xmp_data_struct.h:260
_XMP_N_DIST_BLOCK
#define _XMP_N_DIST_BLOCK
Definition: xmp_constant.h:29
_XMP_alloc
void * _XMP_alloc(size_t size)
Definition: xmp_util.c:21
_XMP_gasnet_atomic_define
void _XMP_gasnet_atomic_define(int target_rank, _XMP_coarray_t *dst_desc, size_t dst_offset, int value, _XMP_coarray_t *src_desc, size_t src_offset, size_t elmt_size)
Definition: xmp_intrinsic_gasnet.c:57
_XMP_template_type::chunk
_XMP_template_chunk_t * chunk
Definition: xmp_data_struct.h:112
xmp_transpose
void xmp_transpose(void *dst_p, void *src_p, int opt)
Definition: xmp_intrinsic.c:1245
xmp_unpack
void xmp_unpack(void *a_p, void *v_p, void *m_p)
Definition: xmp_intrinsic.c:6031
_XMP_array_info_type::ser_upper
int ser_upper
Definition: xmp_data_struct.h:200
_XMP_template_chunk_type::par_lower
long long par_lower
Definition: xmp_data_struct.h:80
xmp_coarray::distance_of_image_elmts
int * distance_of_image_elmts
Definition: xmp_data_struct.h:357
_XMP_array_info_type::ser_size
int ser_size
Definition: xmp_data_struct.h:201
_XMP_template_chunk_type::onto_nodes_info
_XMP_nodes_info_t * onto_nodes_info
Definition: xmp_data_struct.h:94
head
MemoryChunkOrder_t * head
Definition: xmpco_alloc.c:92
_XMP_template_type::is_fixed
_Bool is_fixed
Definition: xmp_data_struct.h:104
xmp_matmul
void xmp_matmul(void *x_p, void *a_p, void *b_p)
Definition: xmp_intrinsic.c:3785
_XMP_template_type::dim
int dim
Definition: xmp_data_struct.h:108
_XMP_template_chunk_type::par_chunk_width
unsigned long long par_chunk_width
Definition: xmp_data_struct.h:86
_XMP_world_rank
int _XMP_world_rank
Definition: xmp_world.c:9
_XMP_template_type::onto_nodes
_XMP_nodes_t * onto_nodes
Definition: xmp_data_struct.h:111
_XMP_array_info_type::shadow_size_lo
int shadow_size_lo
Definition: xmp_data_struct.h:249
tail
MemoryChunkOrder_t * tail
Definition: xmpco_alloc.c:93
_XMP_array_type::align_template
_XMP_template_t * align_template
Definition: xmp_data_struct.h:312
_XMP_array_info_type::align_manner
int align_manner
Definition: xmp_data_struct.h:197
_XMP_N_DIST_CYCLIC
#define _XMP_N_DIST_CYCLIC
Definition: xmp_constant.h:30
_XMP_template_type
Definition: xmp_data_struct.h:98
_XMP_array_info_type::ser_lower
int ser_lower
Definition: xmp_data_struct.h:199
_XMP_template_chunk_type
Definition: xmp_data_struct.h:78
_XMP_template_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_array_info_type::shadow_size_hi
int shadow_size_hi
Definition: xmp_data_struct.h:250
_XMP_array_type
Definition: xmp_data_struct.h:266
_XMP_template_chunk_type::par_stride
int par_stride
Definition: xmp_data_struct.h:85
_XMP_template_chunk_type::dist_manner
int dist_manner
Definition: xmp_data_struct.h:87
_XMP_array_type::type_size
size_t type_size
Definition: xmp_data_struct.h:274
_XMP_array_info_type::alloc_size
int alloc_size
Definition: xmp_data_struct.h:212
_XMP_N_ALIGN_CYCLIC
#define _XMP_N_ALIGN_CYCLIC
Definition: xmp_constant.h:38
_XMP_N_ALIGN_BLOCK
#define _XMP_N_ALIGN_BLOCK
Definition: xmp_constant.h:37
xmp_coarray
Definition: xmp_data_struct.h:328
_XMP_N_ALIGN_DUPLICATION
#define _XMP_N_ALIGN_DUPLICATION
Definition: xmp_constant.h:36
_XMP_array_type::info
_XMP_array_info_t info[1]
Definition: xmp_data_struct.h:313
_XMP_free
void _XMP_free(void *p)
Definition: xmp_util.c:37
_XMP_fjrdma_atomic_ref
void _XMP_fjrdma_atomic_ref(int target_rank, _XMP_coarray_t *dst_desc, size_t dst_offset, int *value, _XMP_coarray_t *src_desc, size_t src_offset, size_t elmt_size)
Definition: xmp_intrinsic_fjrdma.c:26
_XMP_N_ALIGN_NOT_ALIGNED
#define _XMP_N_ALIGN_NOT_ALIGNED
Definition: xmp_constant.h:35
_XMP_utofu_atomic_define
void _XMP_utofu_atomic_define(int target_rank, _XMP_coarray_t *dst_desc, size_t dst_offset, int value, size_t elmt_size)
Definition: xmp_intrinsic_utofu.c:32
_XMP_array_type::array_addr_p
void * array_addr_p
Definition: xmp_data_struct.h:279
_XMP_N_ALIGN_BLOCK_CYCLIC
#define _XMP_N_ALIGN_BLOCK_CYCLIC
Definition: xmp_constant.h:39
_XMP_array_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_fatal
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42
_XMP_template_chunk_type::par_width
unsigned long long par_width
Definition: xmp_data_struct.h:82
check_template
int check_template(_XMP_template_t *dst_t, _XMP_template_t *src_t)
Definition: xmp_intrinsic.c:1216
_XMP_template_type::is_distributed
_Bool is_distributed
Definition: xmp_data_struct.h:105
_XMP_nodes_type::dim
int dim
Definition: xmp_data_struct.h:47
_XMP_fjrdma_atomic_define
void _XMP_fjrdma_atomic_define(int target_rank, _XMP_coarray_t *dst_desc, size_t dst_offset, int value, _XMP_coarray_t *src_desc, size_t src_offset, size_t elmt_size)
Definition: xmp_intrinsic_fjrdma.c:3
_XMP_mpi_atomic_define
void _XMP_mpi_atomic_define(int target_rank, _XMP_coarray_t *c, size_t offset, int value, size_t elmt_size)
Definition: xmp_intrinsic_mpi.c:3
_XMP_array_type::type
int type
Definition: xmp_data_struct.h:273
_XMP_N_ALIGN_GBLOCK
#define _XMP_N_ALIGN_GBLOCK
Definition: xmp_constant.h:40
_XMP_template_chunk_type::mapping_array
long long * mapping_array
Definition: xmp_data_struct.h:88
_XMP_array_type::is_allocated
_Bool is_allocated
Definition: xmp_data_struct.h:270
_XMP_get_execution_nodes
void * _XMP_get_execution_nodes(void)
Definition: xmp_nodes_stack.c:46
_XMP_utofu_atomic_ref
void _XMP_utofu_atomic_ref(int target_rank, _XMP_coarray_t *dst_desc, size_t dst_offset, int *value, size_t elmt_size)
Definition: xmp_intrinsic_utofu.c:59
_XMP_array_info_type::local_upper
int local_upper
Definition: xmp_data_struct.h:210