libxmp/libxmpf in Omni Compiler  1.3.4
xmp_coarray_tca.c File Reference
#include "tca-api.h"
#include "xmp_internal.h"
Include dependency graph for xmp_coarray_tca.c:

Data Structures

struct  _coarray_comm_t
 

Macros

#define NUM_COMM_CACHES   (16)
 

Typedefs

typedef struct _coarray_comm_t _coarray_comm_t
 

Enumerations

enum  comm_pattern { contiguous, blockstride, others }
 

Functions

void _XMP_tca_malloc (_XMP_coarray_t *coarray_desc, void **addr, const size_t coarray_size)
 
void _XMP_tca_contiguous_put (const int target_rank, const size_t dst_offset, const size_t src_offset, const _XMP_coarray_t *dst_desc, const _XMP_coarray_t *src_desc, const size_t dst_elmts, const size_t src_elmts, const size_t elmt_size)
 
void _XMP_tca_sync_memory ()
 Execute sync_memory. More...
 

Macro Definition Documentation

◆ NUM_COMM_CACHES

#define NUM_COMM_CACHES   (16)

Typedef Documentation

◆ _coarray_comm_t

Enumeration Type Documentation

◆ comm_pattern

Enumerator
contiguous 
blockstride 
others 
17  {
18  contiguous,
20  others,
21 };

Function Documentation

◆ _XMP_tca_contiguous_put()

void _XMP_tca_contiguous_put ( const int  target_rank,
const size_t  dst_offset,
const size_t  src_offset,
const _XMP_coarray_t dst_desc,
const _XMP_coarray_t src_desc,
const size_t  dst_elmts,
const size_t  src_elmts,
const size_t  elmt_size 
)
145 {
146  if(dst_elmts != src_elmts){
147  _XMP_fatal("Coarray Error ! transfer size is wrong.\n");
148  }
149 
150  _coarray_comm_t *comm = find_comm(contiguous,
151  target_rank,
152  dst_desc, src_desc,
153  dst_offset, src_offset,
154  dst_elmts,
155  0,0,0,
156  elmt_size);
157 
158  if(comm != NULL){
159  exec_coarray_comm(comm);
160  return;
161  }
162 
163  comm = create_coarray_comm(contiguous,
164  target_rank,
165  dst_desc, src_desc,
166  dst_offset, src_offset,
167  dst_elmts,
168  0,0,0,
169  elmt_size);
170  exec_coarray_comm(comm);
171  cache_comm(comm);
172 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_tca_malloc()

void _XMP_tca_malloc ( _XMP_coarray_t coarray_desc,
void **  addr,
const size_t  coarray_size 
)
108 {
109  char *real_addr;
110  tcaHandle handle;
111 
112  _XMP_tca_lock();
113  TCA_CHECK(tcaMalloc((void**)&real_addr, coarray_size, tcaMemoryGPU));
114  TCA_CHECK(tcaCreateHandle(&handle, real_addr, coarray_size, tcaMemoryGPU));
115  _XMP_tca_unlock();
116 
117  tcaHandle* handles = (tcaHandle*)_XMP_alloc(sizeof(tcaHandle)*_XMP_world_size); // handle of a local array on each node
118 
119  MPI_Allgather(&handle, sizeof(tcaHandle), MPI_BYTE,
120  handles, sizeof(tcaHandle), MPI_BYTE, MPI_COMM_WORLD);
121 
122  coarray_desc->addr_dev = (char**)handles;
123  coarray_desc->real_addr_dev = real_addr;
124  *addr = real_addr;
125 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_tca_sync_memory()

void _XMP_tca_sync_memory ( )

Execute sync_memory.

178 {
179  wait_incomplete_DMA();
180 }
Here is the caller graph for this function:
_XMP_tca_lock
void _XMP_tca_lock()
Definition: xmp_onesided_tca.c:415
_XMP_alloc
void * _XMP_alloc(size_t size)
Definition: xmp_util.c:21
_coarray_comm_t
Definition: xmp_coarray_tca.c:23
_XMP_world_size
int _XMP_world_size
Definition: xmp_world.c:8
_XMP_tca_unlock
void _XMP_tca_unlock()
Definition: xmp_onesided_tca.c:423
others
@ others
Definition: xmp_coarray_tca.c:20
contiguous
@ contiguous
Definition: xmp_coarray_tca.c:18
blockstride
@ blockstride
Definition: xmp_coarray_tca.c:19
_XMP_fatal
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42