libxmp/libxmpf in Omni Compiler  1.3.4
xmp_post_wait_fjrdma.c File Reference

Post/wait functions using Fujitsu RDMA. More...

#include "xmp_internal.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Include dependency graph for xmp_post_wait_fjrdma.c:

Data Structures

struct  _XMP_postreq_info
 
struct  _XMP_postreq
 

Typedefs

typedef struct _XMP_postreq_info _XMP_postreq_info_t
 
typedef struct _XMP_postreq _XMP_postreq_t
 

Functions

void _xmp_fjrdma_post_wait_initialize ()
 Initialize environment for post/wait directives. More...
 
void _xmp_fjrdma_post (const int node, const int tag)
 Post operation. More...
 
void _xmp_fjrdma_wait (const int node, const int tag)
 Wait operation with node-ref and tag. More...
 
void _xmp_fjrdma_wait_node (const int node)
 Wait operation with only node-ref. More...
 
void _xmp_fjrdma_wait_noargs ()
 Wait operation without node-ref and tag. More...
 

Detailed Description

Post/wait functions using Fujitsu RDMA.

Typedef Documentation

◆ _XMP_postreq_info_t

◆ _XMP_postreq_t

typedef struct _XMP_postreq _XMP_postreq_t

Function Documentation

◆ _xmp_fjrdma_post()

void _xmp_fjrdma_post ( const int  node,
const int  tag 
)

Post operation.

Parameters
[in]nodenode number
[in]tagtag
80 {
81  if(tag < 0 || tag > 14){
82  fprintf(stderr, "tag is %d : On the K computer or FX10, 0 <= tag <= 14\n", tag);
84  }
85 
87  if(node == _XMP_world_rank){
88  add_postreq(node, tag);
89  }
90  else{
91  FJMPI_Rdma_put(node, tag, _remote_rdma_addr[node], _local_rdma_addr, sizeof(double), _XMP_POSTREQ_NIC_FLAG);
92  struct FJMPI_Rdma_cq cq;
93  while(FJMPI_Rdma_poll_cq(_XMP_POSTREQ_SEND_NIC, &cq) != FJMPI_RDMA_NOTICE);
94  }
95 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _xmp_fjrdma_post_wait_initialize()

void _xmp_fjrdma_post_wait_initialize ( )

Initialize environment for post/wait directives.

33 {
34  _postreq.num = 0;
35  _postreq.max_size = _XMP_POSTREQ_TABLE_INITIAL_SIZE;
36  _postreq.table = malloc(sizeof(_XMP_postreq_info_t) * _postreq.max_size);
37 
38  double *token = _XMP_alloc(sizeof(double));
39  _local_rdma_addr = FJMPI_Rdma_reg_mem(_XMP_POSTREQ_ID, token, sizeof(double));
40  _remote_rdma_addr = _XMP_alloc(sizeof(uint64_t) * _XMP_world_size);
41 
42  // Obtain remote RDMA addresses
43  MPI_Barrier(MPI_COMM_WORLD);
44  for(int ncount=0,i=1; i<_XMP_world_size+1; ncount++,i++){
45  int partner_rank = (_XMP_world_rank + _XMP_world_size - i) % _XMP_world_size;
46  _remote_rdma_addr[partner_rank] = FJMPI_Rdma_get_remote_addr(partner_rank, _XMP_POSTREQ_ID);
47 
48  if(ncount > _XMP_INIT_RDMA_INTERVAL){
49  MPI_Barrier(MPI_COMM_WORLD);
50  ncount = 0;
51  }
52  }
53 
54 }
Here is the caller graph for this function:

◆ _xmp_fjrdma_wait()

void _xmp_fjrdma_wait ( const int  node,
const int  tag 
)

Wait operation with node-ref and tag.

Parameters
[in]nodenode number
[in]tagtag
138 {
140 
141  struct FJMPI_Rdma_cq cq;
142 
143  while(1){
144  bool table_has_postreq = remove_postreq(node, tag);
145  if(table_has_postreq) break;
146 
147  if(FJMPI_Rdma_poll_cq(_XMP_POSTREQ_RECV_NIC, &cq) == FJMPI_RDMA_HALFWAY_NOTICE)
148  add_postreq(cq.pid, cq.tag);
149  }
150 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _xmp_fjrdma_wait_noargs()

void _xmp_fjrdma_wait_noargs ( )

Wait operation without node-ref and tag.

176 {
178 
179  if(_postreq.num == 0){
180  struct FJMPI_Rdma_cq cq;
181  while(FJMPI_Rdma_poll_cq(_XMP_POSTREQ_RECV_NIC, &cq) != FJMPI_RDMA_HALFWAY_NOTICE);
182  }
183  else
184  _postreq.num--;
185 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _xmp_fjrdma_wait_node()

void _xmp_fjrdma_wait_node ( const int  node)

Wait operation with only node-ref.

Parameters
[in]nodenode number
158 {
160 
161  struct FJMPI_Rdma_cq cq;
162 
163  while(1){
164  bool table_has_postreq = remove_postreq_node(node);
165  if(table_has_postreq) break;
166 
167  if(FJMPI_Rdma_poll_cq(_XMP_POSTREQ_RECV_NIC, &cq) == FJMPI_RDMA_HALFWAY_NOTICE)
168  add_postreq(cq.pid, cq.tag);
169  }
170 }
Here is the call graph for this function:
Here is the caller graph for this function:
_XMP_postreq::num
int num
How many post requests are in table.
Definition: xmp_post_wait_fjrdma.c:19
_XMP_fatal_nomsg
void _XMP_fatal_nomsg()
Definition: xmp_util.c:48
_XMP_postreq::max_size
int max_size
Max size of table.
Definition: xmp_post_wait_fjrdma.c:20
_XMP_fjrdma_sync_memory
void _XMP_fjrdma_sync_memory()
Execute sync_memory.
Definition: xmp_coarray_fjrdma.c:1338
_XMP_alloc
void * _XMP_alloc(size_t size)
Definition: xmp_util.c:21
_XMP_postreq_info
Definition: xmp_post_wait_fjrdma.c:12
_XMP_world_size
int _XMP_world_size
Definition: xmp_world.c:8
_XMP_world_rank
int _XMP_world_rank
Definition: xmp_world.c:9
_XMP_postreq::table
_XMP_postreq_info_t * table
Table for post requests.
Definition: xmp_post_wait_fjrdma.c:18