libxmp/libxmpf in Omni Compiler
1.3.4
|
#include <stdarg.h>
#include <string.h>
#include "mpi.h"
#include "xmp_internal.h"
#include "xmp_math_function.h"
|
void | _XMP_create_shadow_comm (_XMP_array_t *array, int array_index) |
|
void | _XMP_init_reflect_sched (_XMP_reflect_sched_t *sched) |
|
void | _XMP_finalize_reflect_sched (_XMP_reflect_sched_t *sched, _Bool free_buf) |
|
void | _XMP_init_shadow (_XMP_array_t *array,...) |
|
void | _XMP_init_shadow_dim (_XMP_array_t *array, int i, int type, int lo, int hi) |
|
void | _XMP_init_shadow_noalloc (_XMP_array_t *a,...) |
|
void | _XMP_pack_shadow_NORMAL (void **lo_buffer, void **hi_buffer, void *array_addr, _XMP_array_t *array_desc, int array_index) |
|
void | _XMP_unpack_shadow_NORMAL (void *lo_buffer, void *hi_buffer, void *array_addr, _XMP_array_t *array_desc, int array_index) |
|
void | _XMP_exchange_shadow_NORMAL (void **lo_recv_buffer, void **hi_recv_buffer, void *lo_send_buffer, void *hi_send_buffer, _XMP_array_t *array_desc, int array_index) |
|
void | _XMP_reflect_shadow_FULL (void *array_addr, _XMP_array_t *array_desc, int array_index) |
|
◆ MPI_PORTABLE_PLATFORM_H
#define MPI_PORTABLE_PLATFORM_H |
◆ _XMP_create_shadow_comm()
void _XMP_create_shadow_comm |
( |
_XMP_array_t * |
array, |
|
|
int |
array_index |
|
) |
| |
32 int acc_nodes_size = 1;
33 int nodes_dim = onto_nodes->
dim;
34 for (
int i = 0; i < nodes_dim; i++) {
36 int size = onto_nodes_info->
size;
37 int rank = onto_nodes_info->
rank;
39 if (i != onto_nodes_index) {
40 color += (acc_nodes_size * rank);
43 acc_nodes_size *= size;
◆ _XMP_exchange_shadow_NORMAL()
void _XMP_exchange_shadow_NORMAL |
( |
void ** |
lo_recv_buffer, |
|
|
void ** |
hi_recv_buffer, |
|
|
void * |
lo_send_buffer, |
|
|
void * |
hi_send_buffer, |
|
|
_XMP_array_t * |
array_desc, |
|
|
int |
array_index |
|
) |
| |
664 MPI_Datatype mpi_datatype;
665 MPI_Type_contiguous(array_desc->
type_size, MPI_BYTE, &mpi_datatype);
666 MPI_Type_commit(&mpi_datatype);
669 MPI_Request send_req[2];
670 MPI_Request recv_req[2];
679 if (rank != (size - 1)) {
686 if (rank != (size - 1)) {
703 MPI_Wait(&(recv_req[0]), &stat);
706 if (rank != (size - 1)) {
707 MPI_Wait(&(send_req[0]), &stat);
713 if (rank != (size - 1)) {
714 MPI_Wait(&(recv_req[1]), &stat);
718 MPI_Wait(&(send_req[1]), &stat);
723 MPI_Type_free(&mpi_datatype);
◆ _XMP_finalize_reflect_sched()
243 for (
int j = 0; j < 4; j++){
244 if (sched->
req[j] != MPI_REQUEST_NULL){
245 MPI_Request_free(&sched->
req[j]);
247 if (sched->
req_reduce[j] != MPI_REQUEST_NULL){
◆ _XMP_init_reflect_sched()
225 for (
int j = 0; j < 4; j++){
226 sched->
req[j] = MPI_REQUEST_NULL;
◆ _XMP_init_shadow()
262 int dim = array->
dim;
264 va_start(args, array);
265 for (
int i = 0; i < dim; i++) {
268 int type = va_arg(args,
int);
277 int lo = va_arg(args,
int);
279 _XMP_fatal(
"<shadow-width> should be a nonnegative integer");
282 int hi = va_arg(args,
int);
284 _XMP_fatal(
"<shadow-width> should be a nonnegative integer");
287 if ((lo == 0) && (hi == 0)) {
◆ _XMP_init_shadow_dim()
void _XMP_init_shadow_dim |
( |
_XMP_array_t * |
array, |
|
|
int |
i, |
|
|
int |
type, |
|
|
int |
lo, |
|
|
int |
hi |
|
) |
| |
360 _XMP_fatal(
"<shadow-width> should be a nonnegative integer");
364 _XMP_fatal(
"<shadow-width> should be a nonnegative integer");
367 if ((lo == 0) && (hi == 0)) {
◆ _XMP_init_shadow_noalloc()
447 for (
int i = 0; i < dim; i++) {
◆ _XMP_pack_shadow_NORMAL()
void _XMP_pack_shadow_NORMAL |
( |
void ** |
lo_buffer, |
|
|
void ** |
hi_buffer, |
|
|
void * |
array_addr, |
|
|
_XMP_array_t * |
array_desc, |
|
|
int |
array_index |
|
) |
| |
477 int array_type = array_desc->
type;
478 int array_dim = array_desc->
dim;
480 int lower[array_dim], upper[array_dim], stride[array_dim];
481 unsigned long long dim_acc[array_dim];
484 if (rank != (size - 1)) {
495 for (
int i = 0; i < array_dim; i++) {
496 if (i == array_index) {
511 (*_xmp_pack_array)(*lo_buffer, array_addr, array_type, array_desc->
type_size,
512 array_dim, lower, upper, stride, dim_acc);
528 for (
int i = 0; i < array_dim; i++) {
529 if (i == array_index) {
544 (*_xmp_pack_array)(*hi_buffer, array_addr, array_type, array_desc->
type_size,
545 array_dim, lower, upper, stride, dim_acc);
◆ _XMP_reflect_shadow_FULL()
void _XMP_reflect_shadow_FULL |
( |
void * |
array_addr, |
|
|
_XMP_array_t * |
array_desc, |
|
|
int |
array_index |
|
) |
| |
738 int array_dim = array_desc->
dim;
742 _XMP_reflect_shadow_FULL_ALLGATHER(array_addr, array_desc, array_index);
745 _XMP_reflect_shadow_FULL_BCAST(array_addr, array_desc, array_index);
◆ _XMP_unpack_shadow_NORMAL()
void _XMP_unpack_shadow_NORMAL |
( |
void * |
lo_buffer, |
|
|
void * |
hi_buffer, |
|
|
void * |
array_addr, |
|
|
_XMP_array_t * |
array_desc, |
|
|
int |
array_index |
|
) |
| |
568 int array_type = array_desc->
type;
569 int array_dim = array_desc->
dim;
571 int lower[array_dim], upper[array_dim], stride[array_dim];
572 unsigned long long dim_acc[array_dim];
583 for (
int i = 0; i < array_dim; i++) {
584 if (i == array_index) {
599 (*_xmp_unpack_array)(array_addr, lo_buffer, array_type, array_desc->
type_size,
600 array_dim, lower, upper, stride, dim_acc);
608 if (rank != (size - 1)) {
616 for (
int i = 0; i < array_dim; i++) {
617 if (i == array_index) {
632 (*_xmp_unpack_array)(array_addr, hi_buffer, array_type, array_desc->
type_size,
633 array_dim, lower, upper, stride, dim_acc);
int size
Definition: xmp_data_struct.h:32
_XMP_nodes_info_t info[1]
Definition: xmp_data_struct.h:60
Definition: xmp_data_struct.h:31
int align_template_index
Definition: xmp_data_struct.h:260
int shadow_comm_rank
Definition: xmp_data_struct.h:257
int is_member
Definition: xmp_data_struct.h:46
void * _XMP_alloc(size_t size)
Definition: xmp_util.c:21
MPI_Datatype datatype_hi
Definition: xmp_data_struct.h:129
Definition: xmp_data_struct.h:194
_XMP_reflect_sched_t * reflect_acc_sched
Definition: xmp_data_struct.h:253
_XMP_template_chunk_t * chunk
Definition: xmp_data_struct.h:112
int ser_upper
Definition: xmp_data_struct.h:200
int shadow_comm_size
Definition: xmp_data_struct.h:256
void * lo_recv_buf
Definition: xmp_data_struct.h:134
int shadow_type
Definition: xmp_data_struct.h:248
int ser_size
Definition: xmp_data_struct.h:201
Definition: xmp_data_struct.h:119
void _XMP_init_reflect_sched_acc(_XMP_reflect_sched_t *sched)
Definition: xmp_reflect_acc.c:74
MPI_Request req[4]
Definition: xmp_data_struct.h:131
void _XMP_finalize_comm(void *comm)
_Bool is_regular_chunk
Definition: xmp_data_struct.h:196
int reflect_is_initialized
Definition: xmp_data_struct.h:121
unsigned long long dim_elmts
Definition: xmp_data_struct.h:243
int _XMP_world_rank
Definition: xmp_world.c:9
void * hi_send_buf
Definition: xmp_data_struct.h:135
MPI_Datatype datatype_lo
Definition: xmp_data_struct.h:128
int par_upper
Definition: xmp_data_struct.h:205
int local_stride
Definition: xmp_data_struct.h:211
int temp0_v
Definition: xmp_data_struct.h:240
int shadow_size_lo
Definition: xmp_data_struct.h:249
_XMP_template_t * align_template
Definition: xmp_data_struct.h:312
void _XMP_create_shadow_comm(_XMP_array_t *array, int array_index)
Definition: xmp_shadow.c:16
int align_manner
Definition: xmp_data_struct.h:197
Definition: xmp_data_struct.h:98
#define _XMP_N_SHADOW_FULL
Definition: xmp_constant.h:66
int ser_lower
Definition: xmp_data_struct.h:199
Definition: xmp_data_struct.h:78
int onto_nodes_index
Definition: xmp_data_struct.h:92
int local_lower
Definition: xmp_data_struct.h:209
#define _XMP_N_DIST_DUPLICATION
Definition: xmp_constant.h:28
#define _XMP_N_MPI_TAG_REFLECT_HI
Definition: xmp_constant.h:12
int shadow_size_hi
Definition: xmp_data_struct.h:250
int rank
Definition: xmp_data_struct.h:35
int dist_manner
Definition: xmp_data_struct.h:87
size_t type_size
Definition: xmp_data_struct.h:274
int alloc_size
Definition: xmp_data_struct.h:212
#define _XMP_N_ALIGN_BLOCK
Definition: xmp_constant.h:37
#define _XMP_N_ALIGN_DUPLICATION
Definition: xmp_constant.h:36
_XMP_array_info_t info[1]
Definition: xmp_data_struct.h:313
MPI_Request req_reduce[4]
Definition: xmp_data_struct.h:132
void _XMP_free(void *p)
Definition: xmp_util.c:37
#define _XMP_ASSERT(_flag)
Definition: xmp_internal.h:34
#define _XMP_N_ALIGN_NOT_ALIGNED
Definition: xmp_constant.h:35
int par_stride
Definition: xmp_data_struct.h:206
int dim
Definition: xmp_data_struct.h:272
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42
int prev_pcopy_sched_type
Definition: xmp_data_struct.h:123
unsigned long long dim_acc
Definition: xmp_data_struct.h:242
int par_size
Definition: xmp_data_struct.h:207
_XMP_reflect_sched_t * reflect_sched
Definition: xmp_data_struct.h:252
#define _XMP_N_MPI_TAG_REFLECT_LO
Definition: xmp_constant.h:11
int reduce_is_initialized
Definition: xmp_data_struct.h:122
int dim
Definition: xmp_data_struct.h:47
Definition: xmp_data_struct.h:40
int * temp0
Definition: xmp_data_struct.h:239
#define _XMP_RETURN_IF_SINGLE
Definition: xmp_internal.h:37
void * lo_send_buf
Definition: xmp_data_struct.h:134
void * hi_recv_buf
Definition: xmp_data_struct.h:135
#define _XMP_N_SHADOW_NORMAL
Definition: xmp_constant.h:65
#define _XMP_N_SHADOW_NONE
Definition: xmp_constant.h:64
int type
Definition: xmp_data_struct.h:273
_Bool is_allocated
Definition: xmp_data_struct.h:270
_XMP_comm_t * shadow_comm
Definition: xmp_data_struct.h:255
void * _XMP_get_execution_nodes(void)
Definition: xmp_nodes_stack.c:46
int par_lower
Definition: xmp_data_struct.h:204
void _XMP_init_reflect_sched(_XMP_reflect_sched_t *sched)
Definition: xmp_shadow.c:218
_Bool is_shadow_comm_member
Definition: xmp_data_struct.h:195
int local_upper
Definition: xmp_data_struct.h:210