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

Functions

void _XMP_gasnet_build_shift_queue ()
 Set initial value to the shift queue. More...
 
void _XMP_gasnet_initialize (const size_t xmp_gasnet_heap_size, const size_t xmp_gasnet_stride_size)
 Initialize GASNet job. More...
 
void _XMP_gasnet_finalize ()
 Finalize GASNet job. More...
 

Variables

size_t _xmp_gasnet_heap_size
 
size_t _xmp_gasnet_stride_size
 
size_t _xmp_gasnet_coarray_shift = 0
 
char ** _xmp_gasnet_buf
 
int * _xmp_gasnet_stride_queue
 
gasnet_handlerentry_t htable []
 

Function Documentation

◆ _XMP_gasnet_build_shift_queue()

void _XMP_gasnet_build_shift_queue ( )

Set initial value to the shift queue.

739 {
740  _shift_queue.max_size = _XMP_GASNET_COARRAY_SHIFT_QUEUE_INITIAL_SIZE;
741  _shift_queue.num = 0;
742  _shift_queue.shifts = malloc(sizeof(size_t*) * _shift_queue.max_size);
743 }
Here is the caller graph for this function:

◆ _XMP_gasnet_finalize()

void _XMP_gasnet_finalize ( )

Finalize GASNet job.

78 {
80  gasnet_exit(0);
81 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_gasnet_initialize()

void _XMP_gasnet_initialize ( const size_t  xmp_gasnet_heap_size,
const size_t  xmp_gasnet_stride_size 
)

Initialize GASNet job.

34 {
35  // In XMP/Fortran, this function is called with "argc == 0" & "**argv == NULL".
36  // But if the second argument of gasnet_init() is NULL, gasnet_init() returns error.
37  // So dummy argument is created and used.
38  int argc = 1;
39  char **c = malloc(sizeof(char *));
40  c[0] = malloc(sizeof(char));
41  gasnet_init(&argc, &c);
42 
43  _XMP_world_rank = gasnet_mynode();
44  _XMP_world_size = gasnet_nodes();
45 
46  if(xmp_gasnet_heap_size % GASNET_PAGESIZE != 0){
47  if(xmp_gasnet_heap_size <= GASNET_PAGESIZE){
48  _xmp_gasnet_heap_size = GASNET_PAGESIZE;
49  }
50  else{
51  _xmp_gasnet_heap_size = (xmp_gasnet_heap_size/GASNET_PAGESIZE + 1) * GASNET_PAGESIZE;
52  }
53  }
54  else{
55  _xmp_gasnet_heap_size = xmp_gasnet_heap_size;
56  }
57 
58  _xmp_gasnet_stride_size = xmp_gasnet_stride_size;
59  gasnet_attach(htable, sizeof(htable)/sizeof(gasnet_handlerentry_t), (uintptr_t)_xmp_gasnet_heap_size, 0);
60  _xmp_gasnet_buf = (char **)malloc(sizeof(char*) * _XMP_world_size);
61 
62  gasnet_node_t i;
63  gasnet_seginfo_t *s = (gasnet_seginfo_t *)malloc(_XMP_world_size*sizeof(gasnet_seginfo_t));
64  gasnet_getSegmentInfo(s, _XMP_world_size);
65  for(i=0;i<_XMP_world_size;i++)
66  _xmp_gasnet_buf[i] = (char*)s[i].addr;
67 
68  _xmp_gasnet_coarray_shift = xmp_gasnet_stride_size;
69  _xmp_gasnet_stride_queue = malloc(sizeof(int) * _XMP_GASNET_STRIDE_INIT_SIZE);
70 
72 }
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ _xmp_gasnet_buf

char** _xmp_gasnet_buf

◆ _xmp_gasnet_coarray_shift

size_t _xmp_gasnet_coarray_shift = 0

◆ _xmp_gasnet_heap_size

size_t _xmp_gasnet_heap_size

◆ _xmp_gasnet_stride_queue

int* _xmp_gasnet_stride_queue

◆ _xmp_gasnet_stride_size

size_t _xmp_gasnet_stride_size

◆ htable

gasnet_handlerentry_t htable[]
Initial value:
= {
{ _XMP_GASNET_LOCK_REQUEST, _xmp_gasnet_lock_request },
{ _XMP_GASNET_SETLOCKSTATE, _xmp_gasnet_setlockstate },
{ _XMP_GASNET_UNLOCK_REQUEST, _xmp_gasnet_unlock_request },
{ _XMP_GASNET_LOCKHANDOFF, _xmp_gasnet_lockhandoff },
{ _XMP_GASNET_POSTREQ, _xmp_gasnet_postreq },
{ _XMP_GASNET_UNPACK, _xmp_gasnet_unpack },
{ _XMP_GASNET_UNPACK_USING_BUF, _xmp_gasnet_unpack_using_buf },
{ _XMP_GASNET_UNPACK_REPLY, _xmp_gasnet_unpack_reply },
{ _XMP_GASNET_PACK, _xmp_gasnet_pack },
{ _XMP_GASNET_UNPACK_GET_REPLY, _xmp_gasnet_unpack_get_reply},
{ _XMP_GASNET_PACK_USING_BUF, _xmp_gasnet_pack_using_buf},
{ _XMP_GASNET_UNPACK_GET_REPLY_USING_BUF, _xmp_gasnet_unpack_get_reply_using_buf},
{ _XMP_GASNET_PACK_GET_HANDLER, _xmp_gasnet_pack_get },
{ _XMP_GASNET_UNPACK_GET_REPLY_NONC, _xmp_gasnet_unpack_get_reply_nonc },
{ _XMP_GASNET_ADD_NOTIFY, _xmp_gasnet_add_notify },
{ _XMP_GASNET_ATOMIC_DEFINE_DO, _xmp_gasnet_atomic_define_do },
{ _XMP_GASNET_ATOMIC_DEFINE_REPLY_DO, _xmp_gasnet_atomic_define_reply_do },
{ _XMP_GASNET_ATOMIC_REF_DO, _xmp_gasnet_atomic_ref_do },
{ _XMP_GASNET_ATOMIC_REF_REPLY_DO, _xmp_gasnet_atomic_ref_reply_do }
}
_xmp_gasnet_postreq
void _xmp_gasnet_postreq(gasnet_token_t token, const int node, const int tag)
Definition: xmp_post_wait_gasnet.c:57
_xmp_gasnet_lock_request
void _xmp_gasnet_lock_request(gasnet_token_t token, int node, uint32_t addr_hi, uint32_t addr_lo)
Definition: xmp_lock_unlock_gasnet.c:133
_xmp_gasnet_unpack
void _xmp_gasnet_unpack(gasnet_token_t t, const char *src_addr, const size_t nbytes, const int addr_hi, const int addr_lo, const int dst_dims, const int ith, const int flag)
Unpack received data.
Definition: xmp_coarray_gasnet.c:934
_xmp_gasnet_coarray_shift
size_t _xmp_gasnet_coarray_shift
Definition: xmp_onesided_gasnet.c:3
_xmp_gasnet_atomic_define_reply_do
void _xmp_gasnet_atomic_define_reply_do(gasnet_token_t token, gasnet_handlerarg_t local_atomic_operations)
Definition: xmp_intrinsic_gasnet.c:52
_XMP_world_size
int _XMP_world_size
Definition: xmp_world.c:8
_XMP_gasnet_build_shift_queue
void _XMP_gasnet_build_shift_queue()
Set initial value to the shift queue.
Definition: xmp_coarray_gasnet.c:738
htable
gasnet_handlerentry_t htable[]
Definition: xmp_onesided_gasnet.c:7
_xmp_gasnet_atomic_ref_do
void _xmp_gasnet_atomic_ref_do(gasnet_token_t token, const size_t elmt_size, gasnet_handlerarg_t src_addr_hi, gasnet_handlerarg_t src_addr_lo, gasnet_handlerarg_t dst_addr_hi, gasnet_handlerarg_t dst_addr_lo, gasnet_handlerarg_t local_atomic_operations)
Definition: xmp_intrinsic_gasnet.c:75
_shift_queue_t::shifts
size_t * shifts
shifts array
Definition: xmp_coarray_gasnet.c:11
_xmp_gasnet_unpack_get_reply_nonc
void _xmp_gasnet_unpack_get_reply_nonc(gasnet_token_t t, char *archive, size_t transfer_size, const int dst_addr_hi, const int dst_addr_lo, const int dst_dims)
Definition: xmp_coarray_gasnet.c:1243
_xmp_gasnet_stride_size
size_t _xmp_gasnet_stride_size
Definition: xmp_onesided_gasnet.c:3
_xmp_gasnet_unpack_using_buf
void _xmp_gasnet_unpack_using_buf(gasnet_token_t t, const int addr_hi, const int addr_lo, const int dst_dims, const int ith, const int flag)
Unpack received data which is stored in buffer.
Definition: xmp_coarray_gasnet.c:919
_xmp_gasnet_unpack_reply
void _xmp_gasnet_unpack_reply(gasnet_token_t t, const int ith)
Registor finish information of unpack operation.
Definition: xmp_coarray_gasnet.c:895
_shift_queue_t::num
int num
How many shifts are in this queue.
Definition: xmp_coarray_gasnet.c:10
_XMP_world_rank
int _XMP_world_rank
Definition: xmp_world.c:9
_shift_queue_t::max_size
size_t max_size
Max size of queue.
Definition: xmp_coarray_gasnet.c:9
_XMP_gasnet_sync_all
void _XMP_gasnet_sync_all()
Execute sync_all.
Definition: xmp_coarray_gasnet.c:846
_xmp_gasnet_unpack_get_reply
void _xmp_gasnet_unpack_get_reply(gasnet_token_t t, char *archive, size_t transfer_size, const int dst_addr_hi, const int dst_addr_lo)
Definition: xmp_coarray_gasnet.c:1266
_xmp_gasnet_pack
void _xmp_gasnet_pack(gasnet_token_t t, const char *array_info, const size_t am_request_size, const int src_addr_hi, const int src_addr_lo, const int src_dims, const size_t tansfer_size, const int dst_addr_hi, const int dst_addr_lo)
Definition: xmp_coarray_gasnet.c:1190
_xmp_gasnet_lockhandoff
void _xmp_gasnet_lockhandoff(gasnet_token_t token, int handoffarg)
Definition: xmp_lock_unlock_gasnet.c:171
_xmp_gasnet_pack_using_buf
void _xmp_gasnet_pack_using_buf(gasnet_token_t t, const char *array_info, const size_t am_request_size, const int src_addr_hi, const int src_addr_lo, const int src_dims, const int target_rank)
Definition: xmp_coarray_gasnet.c:1292
_xmp_gasnet_atomic_define_do
void _xmp_gasnet_atomic_define_do(gasnet_token_t token, const char *src_addr, const size_t elmt_size, gasnet_handlerarg_t addr_hi, gasnet_handlerarg_t addr_lo, gasnet_handlerarg_t local_atomic_operations)
Definition: xmp_intrinsic_gasnet.c:39
_xmp_gasnet_unlock_request
void _xmp_gasnet_unlock_request(gasnet_token_t token, int node, uint32_t addr_hi, uint32_t addr_lo)
Definition: xmp_lock_unlock_gasnet.c:156
_xmp_gasnet_unpack_get_reply_using_buf
void _xmp_gasnet_unpack_get_reply_using_buf(gasnet_token_t t)
Set done flag for get operation.
Definition: xmp_coarray_gasnet.c:1276
_xmp_gasnet_stride_queue
int * _xmp_gasnet_stride_queue
Definition: xmp_onesided_gasnet.c:5
_xmp_gasnet_atomic_ref_reply_do
void _xmp_gasnet_atomic_ref_reply_do(gasnet_token_t token, int *dst_addr, size_t elmt_size, gasnet_handlerarg_t src_addr_hi, gasnet_handlerarg_t src_addr_lo, gasnet_handlerarg_t local_atomic_operations)
Definition: xmp_intrinsic_gasnet.c:85
_xmp_gasnet_buf
char ** _xmp_gasnet_buf
Definition: xmp_onesided_gasnet.c:4
_xmp_gasnet_heap_size
size_t _xmp_gasnet_heap_size
Definition: xmp_onesided_gasnet.c:3
_xmp_gasnet_pack_get
void _xmp_gasnet_pack_get(gasnet_token_t t, const char *array_info, const size_t am_request_size, const int src_addr_hi, const int src_addr_lo, const int src_dims, const int dst_dims, const size_t tansfer_size, const int dst_addr_hi, const int dst_addr_lo)
Definition: xmp_coarray_gasnet.c:1216
_xmp_gasnet_add_notify
void _xmp_gasnet_add_notify(gasnet_token_t token, const int rank)
Definition: xmp_coarray_gasnet.c:1616
_xmp_gasnet_setlockstate
void _xmp_gasnet_setlockstate(gasnet_token_t token, int state)
Definition: xmp_lock_unlock_gasnet.c:145