libxmp/libxmpf in Omni Compiler
1.3.4
|
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <assert.h>
#include <string.h>
#include "mpi.h"
#include "mpi-ext.h"
#include "xmp_internal.h"
|
void | _XMP_fjrdma_sync_memory_put () |
| End these variables are temporral. More...
|
|
void | _XMP_fjrdma_sync_memory_get () |
| Execute sync_memory for get operation. More...
|
|
void | _XMP_add_num_of_puts () |
| Add 1 to _num_of_puts. More...
|
|
void | _XMP_add_num_of_gets () |
| Add 1 to _num_of_gets. More...
|
|
void | _XMP_fjrdma_sync_memory () |
| Execute sync_memory. More...
|
|
void | _XMP_fjrdma_sync_all () |
| Execute sync_all. More...
|
|
void | _XMP_fjrdma_coarray_malloc (_XMP_coarray_t *coarray_desc, void **addr, const size_t coarray_size) |
|
void | _XMP_fjrdma_regmem (_XMP_coarray_t *coarray_desc, void *addr, const size_t coarray_size) |
|
void | _XMP_fjrdma_coarray_lastly_deallocate () |
| Deallocate memory region when calling _XMP_coarray_lastly_deallocate() More...
|
|
void | _XMP_fjrdma_contiguous_put (const int target_rank, const uint64_t dst_offset, const uint64_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_fjrdma_put (const int dst_contiguous, const int src_contiguous, const int target_rank, const int dst_dims, const int src_dims, const _XMP_array_section_t *dst_info, const _XMP_array_section_t *src_info, const _XMP_coarray_t *dst_desc, const _XMP_coarray_t *src_desc, void *src, const size_t dst_elmts, const size_t src_elmts) |
|
void | _XMP_fjrdma_contiguous_get (const int target_rank, const _XMP_coarray_t *dst_desc, const _XMP_coarray_t *src_desc, const uint64_t dst_offset, const uint64_t src_offset, const size_t dst_elmts, const size_t src_elmts, const size_t elmt_size) |
|
void | _XMP_fjrdma_get (const int src_contiguous, const int dst_contiguous, const int target_rank, const int src_dims, const int dst_dims, const _XMP_array_section_t *src_info, const _XMP_array_section_t *dst_info, const _XMP_coarray_t *src_desc, const _XMP_coarray_t *dst_desc, void *dst, const size_t src_elmts, const size_t dst_elmts) |
|
void | _XMP_fjrdma_build_sync_images_table () |
| Build table and Initialize for sync images. More...
|
|
void | _XMP_fjrdma_sync_images (const int num, int *image_set, int *status) |
| Execute sync images. More...
|
|
◆ _XMP_COARRAY_FLAG_NIC_TMP_0
#define _XMP_COARRAY_FLAG_NIC_TMP_0 (FJMPI_RDMA_LOCAL_NIC0 | FJMPI_RDMA_REMOTE_NIC0) |
◆ _XMP_COARRAY_FLAG_NIC_TMP_1
#define _XMP_COARRAY_FLAG_NIC_TMP_1 (FJMPI_RDMA_LOCAL_NIC1 | FJMPI_RDMA_REMOTE_NIC1) |
◆ _XMP_COARRAY_FLAG_NIC_TMP_2
#define _XMP_COARRAY_FLAG_NIC_TMP_2 (FJMPI_RDMA_LOCAL_NIC2 | FJMPI_RDMA_REMOTE_NIC2) |
◆ _XMP_COARRAY_FLAG_NIC_TMP_3
#define _XMP_COARRAY_FLAG_NIC_TMP_3 (FJMPI_RDMA_LOCAL_NIC3 | FJMPI_RDMA_REMOTE_NIC3) |
◆ _XMP_COARRAY_FLAG_NIC_TMP_i0
#define _XMP_COARRAY_FLAG_NIC_TMP_i0 (FJMPI_RDMA_LOCAL_NIC0 | FJMPI_RDMA_REMOTE_NIC0 | FJMPI_RDMA_IMMEDIATE_RETURN) |
◆ _XMP_COARRAY_FLAG_NIC_TMP_i1
#define _XMP_COARRAY_FLAG_NIC_TMP_i1 (FJMPI_RDMA_LOCAL_NIC1 | FJMPI_RDMA_REMOTE_NIC1 | FJMPI_RDMA_IMMEDIATE_RETURN) |
◆ _XMP_COARRAY_FLAG_NIC_TMP_i2
#define _XMP_COARRAY_FLAG_NIC_TMP_i2 (FJMPI_RDMA_LOCAL_NIC2 | FJMPI_RDMA_REMOTE_NIC2 | FJMPI_RDMA_IMMEDIATE_RETURN) |
◆ _XMP_COARRAY_FLAG_NIC_TMP_i3
#define _XMP_COARRAY_FLAG_NIC_TMP_i3 (FJMPI_RDMA_LOCAL_NIC3 | FJMPI_RDMA_REMOTE_NIC3 | FJMPI_RDMA_IMMEDIATE_RETURN) |
◆ _XMP_COARRAY_SEND_NIC_TMP_0
#define _XMP_COARRAY_SEND_NIC_TMP_0 FJMPI_RDMA_LOCAL_NIC0 |
◆ _XMP_COARRAY_SEND_NIC_TMP_1
#define _XMP_COARRAY_SEND_NIC_TMP_1 FJMPI_RDMA_LOCAL_NIC1 |
◆ _XMP_COARRAY_SEND_NIC_TMP_2
#define _XMP_COARRAY_SEND_NIC_TMP_2 FJMPI_RDMA_LOCAL_NIC2 |
◆ _XMP_COARRAY_SEND_NIC_TMP_3
#define _XMP_COARRAY_SEND_NIC_TMP_3 FJMPI_RDMA_LOCAL_NIC3 |
◆ _XMP_FJRDMA_MAX_GET
#define _XMP_FJRDMA_MAX_GET 60 /** This value is trial */ |
◆ _XMP_FJRDMA_MAX_MEMID
#define _XMP_FJRDMA_MAX_MEMID 511 |
◆ _XMP_FJRDMA_MAX_MGET
#define _XMP_FJRDMA_MAX_MGET 100 /** This value is trial */ |
◆ _XMP_FJRDMA_MAX_MPUT
#define _XMP_FJRDMA_MAX_MPUT 1993 |
◆ _XMP_FJRDMA_MAX_PUT
#define _XMP_FJRDMA_MAX_PUT 60 /** This value is trial */ |
◆ _XMP_FJRDMA_MAX_SIZE
#define _XMP_FJRDMA_MAX_SIZE 16777212 |
◆ _XMP_add_num_of_gets()
void _XMP_add_num_of_gets |
( |
| ) |
|
◆ _XMP_add_num_of_puts()
void _XMP_add_num_of_puts |
( |
| ) |
|
◆ _XMP_fjrdma_build_sync_images_table()
void _XMP_fjrdma_build_sync_images_table |
( |
| ) |
|
Build table and Initialize for sync images.
2153 _sync_images_table[i] = 0;
2156 _local_rdma_addr = FJMPI_Rdma_reg_mem(_XMP_SYNC_IMAGES_ID, token,
sizeof(
double));
2160 MPI_Barrier(MPI_COMM_WORLD);
2163 _remote_rdma_addr[partner_rank] = FJMPI_Rdma_get_remote_addr(partner_rank, _XMP_SYNC_IMAGES_ID);
2165 if(ncount > _XMP_INIT_RDMA_INTERVAL){
2166 MPI_Barrier(MPI_COMM_WORLD);
◆ _XMP_fjrdma_coarray_lastly_deallocate()
void _XMP_fjrdma_coarray_lastly_deallocate |
( |
| ) |
|
◆ _XMP_fjrdma_coarray_malloc()
void _XMP_fjrdma_coarray_malloc |
( |
_XMP_coarray_t * |
coarray_desc, |
|
|
void ** |
addr, |
|
|
const size_t |
coarray_size |
|
) |
| |
◆ _XMP_fjrdma_contiguous_get()
void _XMP_fjrdma_contiguous_get |
( |
const int |
target_rank, |
|
|
const _XMP_coarray_t * |
dst_desc, |
|
|
const _XMP_coarray_t * |
src_desc, |
|
|
const uint64_t |
dst_offset, |
|
|
const uint64_t |
src_offset, |
|
|
const size_t |
dst_elmts, |
|
|
const size_t |
src_elmts, |
|
|
const size_t |
elmt_size |
|
) |
| |
1915 size_t transfer_size = dst_elmts * elmt_size;
1916 _check_transfer_size(transfer_size);
1918 uint64_t raddr = (uint64_t)src_desc->
addr[target_rank] + src_offset;
1919 uint64_t laddr = dst_desc->laddr + dst_offset;
1921 if(dst_elmts == src_elmts){
1922 _XMP_FJMPI_Rdma_get(target_rank, raddr, laddr, transfer_size);
1925 else if(src_elmts == 1){
1926 _XMP_FJMPI_Rdma_get(target_rank, raddr, laddr, elmt_size);
1929 char *dst = dst_desc->
real_addr + dst_offset;
1930 for(
size_t i=1;i<dst_elmts;i++)
1931 memcpy(dst+i*elmt_size, dst, elmt_size);
1934 _XMP_fatal(
"Coarray Error ! transfer size is wrong.\n");
◆ _XMP_fjrdma_contiguous_put()
void _XMP_fjrdma_contiguous_put |
( |
const int |
target_rank, |
|
|
const uint64_t |
dst_offset, |
|
|
const uint64_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 |
|
) |
| |
1620 size_t transfer_size = dst_elmts * elmt_size;
1621 _check_transfer_size(transfer_size);
1623 uint64_t raddr = (uint64_t)dst_desc->
addr[target_rank] + dst_offset;
1624 uint64_t laddr = src_desc->laddr + src_offset;
1626 if(dst_elmts == src_elmts){
1627 _XMP_FJMPI_Rdma_put(target_rank, raddr, laddr, transfer_size);
1629 else if(src_elmts == 1){
1630 uint64_t raddrs[dst_elmts], laddrs[dst_elmts];
1631 size_t lengths[dst_elmts];
1632 for(
size_t i=0;i<dst_elmts;i++) raddrs[i] = raddr + i * elmt_size;
1633 for(
size_t i=0;i<dst_elmts;i++) laddrs[i] = laddr;
1634 for(
size_t i=0;i<dst_elmts;i++) lengths[i] = elmt_size;
1635 _fjrdma_scalar_mput_do(target_rank, raddrs, laddrs, lengths, dst_elmts, elmt_size);
1638 _XMP_fatal(
"Coarray Error ! transfer size is wrong.\n");
◆ _XMP_fjrdma_get()
void _XMP_fjrdma_get |
( |
const int |
src_contiguous, |
|
|
const int |
dst_contiguous, |
|
|
const int |
target_rank, |
|
|
const int |
src_dims, |
|
|
const int |
dst_dims, |
|
|
const _XMP_array_section_t * |
src_info, |
|
|
const _XMP_array_section_t * |
dst_info, |
|
|
const _XMP_coarray_t * |
src_desc, |
|
|
const _XMP_coarray_t * |
dst_desc, |
|
|
void * |
dst, |
|
|
const size_t |
src_elmts, |
|
|
const size_t |
dst_elmts |
|
) |
| |
2122 size_t transfer_size = src_desc->
elmt_size * src_elmts;
2124 _check_transfer_size(transfer_size);
2126 if(src_elmts == dst_elmts){
2128 _fjrdma_contiguous_get(target_rank, dst_offset, src_offset, dst, dst_desc, src_desc, transfer_size);
2131 _fjrdma_NON_contiguous_get(target_rank, dst_offset, src_offset, dst_info, src_info,
2132 dst, dst_desc, src_desc, dst_dims, src_dims, src_elmts);
2137 _fjrdma_scalar_mget(target_rank, dst_offset, src_offset, dst_info, dst_dims, dst_desc, src_desc, (
char *)dst, dst_elmts);
◆ _XMP_fjrdma_put()
void _XMP_fjrdma_put |
( |
const int |
dst_contiguous, |
|
|
const int |
src_contiguous, |
|
|
const int |
target_rank, |
|
|
const int |
dst_dims, |
|
|
const int |
src_dims, |
|
|
const _XMP_array_section_t * |
dst_info, |
|
|
const _XMP_array_section_t * |
src_info, |
|
|
const _XMP_coarray_t * |
dst_desc, |
|
|
const _XMP_coarray_t * |
src_desc, |
|
|
void * |
src, |
|
|
const size_t |
dst_elmts, |
|
|
const size_t |
src_elmts |
|
) |
| |
1873 size_t transfer_size = dst_desc->
elmt_size * dst_elmts;
1874 _check_transfer_size(transfer_size);
1876 if(dst_elmts == src_elmts){
1878 _fjrdma_contiguous_put(target_rank, dst_offset, src_offset, dst_desc, src_desc, src, transfer_size);
1881 _fjrdma_NON_contiguous_put(target_rank, dst_offset, src_offset, dst_info, src_info, dst_dims, src_dims,
1882 dst_desc, src_desc, src, dst_elmts);
1887 _fjrdma_scalar_mput(target_rank, dst_offset, src_offset, dst_info, dst_dims, dst_desc, src_desc,
◆ _XMP_fjrdma_regmem()
void _XMP_fjrdma_regmem |
( |
_XMP_coarray_t * |
coarray_desc, |
|
|
void * |
addr, |
|
|
const size_t |
coarray_size |
|
) |
| |
1571 _XMP_fatal(
"Too many coarrays. Number of coarrays is not more than 510.");
1573 coarray_desc->laddr = FJMPI_Rdma_reg_mem(_memid, addr, coarray_size);
1575 MPI_Barrier(MPI_COMM_WORLD);
1578 each_addr[partner_rank] = FJMPI_Rdma_get_remote_addr(partner_rank, _memid);
1579 if(ncount > _XMP_INIT_RDMA_INTERVAL){
1580 MPI_Barrier(MPI_COMM_WORLD);
1586 coarray_desc->
addr = (
void *)each_addr;
◆ _XMP_fjrdma_sync_all()
void _XMP_fjrdma_sync_all |
( |
| ) |
|
Execute sync_all.
1356 MPI_Barrier(MPI_COMM_WORLD);
◆ _XMP_fjrdma_sync_images()
void _XMP_fjrdma_sync_images |
( |
const int |
num, |
|
|
int * |
image_set, |
|
|
int * |
status |
|
) |
| |
Execute sync images.
- Parameters
-
[in] | num | number of nodes |
[in] | *image_set | image set |
[out] | status | status |
2259 fprintf(stderr,
"Invalid value is used in xmp_sync_memory. The first argument is %d\n", num);
2263 _notify_sync_images(num, image_set);
2264 _wait_sync_images(num, image_set);
2267 for(
int i=0;i<num;i++)
2268 _sync_images_table[image_set[i]]--;
◆ _XMP_fjrdma_sync_memory()
void _XMP_fjrdma_sync_memory |
( |
| ) |
|
◆ _XMP_fjrdma_sync_memory_get()
void _XMP_fjrdma_sync_memory_get |
( |
| ) |
|
Execute sync_memory for get operation.
1310 while(_num_of_gets != 0)
1311 if(FJMPI_Rdma_poll_cq(_XMP_COARRAY_SEND_NIC, NULL) == FJMPI_RDMA_NOTICE)
◆ _XMP_fjrdma_sync_memory_put()
void _XMP_fjrdma_sync_memory_put |
( |
| ) |
|
End these variables are temporral.
Execute sync_memory for put operation
1283 if(_num_of_puts == 0)
break;
1287 if(_num_of_puts == 0)
break;
1291 if(_num_of_puts == 0)
break;
1295 if(_num_of_puts == 0)
break;
1299 while(_num_of_puts != 0)
1300 if(FJMPI_Rdma_poll_cq(_XMP_COARRAY_SEND_NIC, NULL) == FJMPI_RDMA_NOTICE)
◆ _XMP_flag_put_nb
These variables are temporral.
◆ _XMP_flag_put_nb_rr
◆ _XMP_flag_put_nb_rr_i
int _XMP_flag_put_nb_rr_i |
void _XMP_fatal_nomsg()
Definition: xmp_util.c:48
void _XMP_fjrdma_sync_memory()
Execute sync_memory.
Definition: xmp_coarray_fjrdma.c:1338
char ** addr
Definition: xmp_data_struct.h:329
void * _XMP_alloc(size_t size)
Definition: xmp_util.c:21
void _XMP_fjrdma_sync_memory_put()
End these variables are temporral.
Definition: xmp_coarray_fjrdma.c:1277
char * real_addr
Definition: xmp_data_struct.h:336
int _XMP_world_size
Definition: xmp_world.c:8
size_t elmt_size
Definition: xmp_data_struct.h:339
void _XMP_fjrdma_sync_memory_get()
Execute sync_memory for get operation.
Definition: xmp_coarray_fjrdma.c:1308
int _XMP_world_rank
Definition: xmp_world.c:9
#define _XMP_COARRAY_SEND_NIC_TMP_3
Definition: xmp_coarray_fjrdma.c:30
#define _XMP_FJRDMA_MAX_PUT
Definition: xmp_coarray_fjrdma.c:13
#define _XMP_COARRAY_SEND_NIC_TMP_2
Definition: xmp_coarray_fjrdma.c:29
#define _XMP_COARRAY_SEND_NIC_TMP_0
Definition: xmp_coarray_fjrdma.c:27
void _XMP_fjrdma_regmem(_XMP_coarray_t *coarray_desc, void *addr, const size_t coarray_size)
Definition: xmp_coarray_fjrdma.c:1567
size_t _XMP_get_offset(const _XMP_array_section_t *array_info, const int dims)
Definition: xmp_coarray_utils.c:22
int _XMP_flag_put_nb
These variables are temporral.
Definition: xmp_onesided.c:5
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42
#define _XMP_COARRAY_SEND_NIC_TMP_1
Definition: xmp_coarray_fjrdma.c:28
#define _XMP_FJRDMA_MAX_MEMID
Definition: xmp_coarray_fjrdma.c:10
#define _XMP_FJRDMA_MAX_GET
Definition: xmp_coarray_fjrdma.c:14
#define _XMP_N_INT_TRUE
Definition: xmp_constant.h:4