libxmp/libxmpf in Omni Compiler
1.3.4
|
#include <stdlib.h>
#include <string.h>
#include "xmp_internal.h"
|
void | dbg_printf (char *fmt,...) |
|
void | xmp_sort_up (_XMP_array_t *a_desc, _XMP_array_t *b_desc) |
|
void | xmp_sort_down (_XMP_array_t *a_desc, _XMP_array_t *b_desc) |
|
void | _XMP_sort (_XMP_array_t *a_desc, _XMP_array_t *b_desc, int is_up) |
|
void | xmpc_gmv_g_alloc (_XMP_gmv_desc_t **gmv_desc, _XMP_array_t *ap) |
|
void | xmpc_gmv_g_dim_info (_XMP_gmv_desc_t *gp, int i, int kind, int lb, int len, int st) |
|
void | xmpc_gmv_dealloc (_XMP_gmv_desc_t *gp) |
|
void | xmpc_gmv_do (_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int mode) |
|
◆ COMPARE_DOWN
#define COMPARE_DOWN |
( |
|
_type | ) |
|
Value:(const void *a, const void *b){ \
if (*(_type *)a > *(_type *)b){ \
return -1; \
} \
else if(*(_type *)a == *(_type *)b){ \
return 0; \
} \
return 1; \
}
◆ COMPARE_UP
#define COMPARE_UP |
( |
|
_type | ) |
|
Value:(const void *a, const void *b){ \
if (*(_type *)a < *(_type *)b){ \
return -1; \
} \
else if(*(_type *)a == *(_type *)b){ \
return 0; \
} \
return 1; \
}
◆ PIVOT
Value:(void *p, const void *a, const int an, \
const void *b, const int bn){ \
_type am = 0, bm = 0; \
if (an > 0){ \
if (an % 2 == 0) \
am = (((_type *)a)[an / 2] + ((_type *)a)[an / 2 - 1]) / 2; \
else \
am = ((_type *)a)[an / 2]; \
} \
if (bn > 0){ \
if (bn % 2 == 0) \
bm = (((_type *)b)[bn / 2] + ((_type *)b)[bn / 2 - 1]) / 2; \
else \
bm = ((_type *)b)[bn / 2]; \
} \
_type tmp; \
if (an > 0 && bn > 0) tmp = (am + bm) / 2; \
else if (an > 0 && bn == 0) tmp = am; \
else if (an == 0 && bn > 0) tmp = bm; \
}
◆ THRESHOLD_2WAY
#define THRESHOLD_2WAY 32 |
◆ THRESHOLD_BSEARCH
#define THRESHOLD_BSEARCH 8 |
◆ THRESHOLD_KWAY
◆ _XMP_sort()
98 int a_ndims = a_desc->
dim;
99 int a_type = a_desc->
type;
102 int b_ndims = b_desc->
dim;
103 int b_type = b_desc->
type;
105 if (a_size != b_size)
_XMP_fatal(
"xmp_sort: different size for array arguments");
106 if (a_ndims != 1 || b_ndims != 1)
_XMP_fatal(
"xmp_sort: array arguments must be one-dimensional");
107 if (a_type != b_type)
_XMP_fatal(
"xmp_sort: different type for array arguments");
115 set_funcs(a_desc, is_up);
118 do_sort((
char *)a_adr + a_lshadow *
datasize, lsize, b_desc);
◆ dbg_printf()
void dbg_printf |
( |
char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ xmp_sort_down()
◆ xmp_sort_up()
◆ xmpc_gmv_dealloc()
◆ xmpc_gmv_do()
174 if (gmv_desc_rightp->
ndims == 0){
179 _XMPC_larray_alloc(&a, gmv_desc_rightp,
186 if (gmv_desc_leftp->
ndims == 0){
196 _XMPC_larray_alloc(&a, gmv_desc_leftp,
◆ xmpc_gmv_g_alloc()
36 if (!gp || !gp->
kind || !gp->
lb || !gp->
st)
37 _XMP_fatal(
"gmv_g_alloc: cannot alloc memory");
◆ xmpc_gmv_g_dim_info()
void xmpc_gmv_g_dim_info |
( |
_XMP_gmv_desc_t * |
gp, |
|
|
int |
i, |
|
|
int |
kind, |
|
|
int |
lb, |
|
|
int |
len, |
|
|
int |
st |
|
) |
| |
66 gp->
ub[i] = lb + st * (len - 1);
◆ compare_func
int(* compare_func) (const void *a, const void *b) |
◆ datasize
◆ get_rotate_pivot
void(* get_rotate_pivot) (void *p, const void *a, const int an, const void *b, const int bn) |
◆ mpi_type
_XMP_nodes_t * array_nodes
Definition: xmp_data_struct.h:306
int comm_size
Definition: xmp_data_struct.h:48
void _XMP_finalize_array_desc(void *array)
void * _XMP_alloc(size_t size)
Definition: xmp_util.c:21
int * lb
Definition: xmp_data_struct.h:398
int * st
Definition: xmp_data_struct.h:400
void _XMP_gmove_garray_larray(_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int mode)
Definition: xmp_gmove.c:4851
int ser_upper
Definition: xmp_data_struct.h:200
int * ub
Definition: xmp_data_struct.h:399
#define XMP_N_GMOVE_INDEX
Definition: xmp_constant.h:128
Definition: xmp_data_struct.h:386
size_t datasize
Definition: xmp_sort.c:68
int ser_size
Definition: xmp_data_struct.h:201
int * a_ub
Definition: xmp_data_struct.h:395
int comm_rank
Definition: xmp_data_struct.h:52
void _XMP_gmove_garray_garray(_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int mode)
Definition: xmp_gmove.c:4769
int shadow_size_lo
Definition: xmp_data_struct.h:249
_XMP_template_t * align_template
Definition: xmp_data_struct.h:312
int * kind
Definition: xmp_data_struct.h:397
void _XMP_sort(_XMP_array_t *a_desc, _XMP_array_t *b_desc, int is_up)
Definition: xmp_sort.c:92
int ser_lower
Definition: xmp_data_struct.h:199
void * local_data
Definition: xmp_data_struct.h:393
#define XMP_N_GMOVE_ALL
Definition: xmp_constant.h:127
Definition: xmp_data_struct.h:266
int ndims
Definition: xmp_data_struct.h:389
size_t type_size
Definition: xmp_data_struct.h:274
_XMP_array_info_t info[1]
Definition: xmp_data_struct.h:313
void _XMP_free(void *p)
Definition: xmp_util.c:37
#define _XMP_ASSERT(_flag)
Definition: xmp_internal.h:34
_Bool is_global
Definition: xmp_data_struct.h:388
void(* _XMP_unpack_comm_set)(void *recvbuf, int recvbuf_size, _XMP_array_t *a, _XMP_comm_set_t *comm_set[][_XMP_N_MAX_DIM])
Definition: xmp_gmove.c:25
void(* _XMP_pack_comm_set)(void *sendbuf, int sendbuf_size, _XMP_array_t *a, _XMP_comm_set_t *comm_set[][_XMP_N_MAX_DIM])
Definition: xmp_gmove.c:23
void * array_addr_p
Definition: xmp_data_struct.h:279
_XMP_comm_t * comm
Definition: xmp_data_struct.h:53
int dim
Definition: xmp_data_struct.h:272
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42
#define XMP_N_GMOVE_RANGE
Definition: xmp_constant.h:129
_XMP_array_t * a_desc
Definition: xmp_data_struct.h:391
int par_size
Definition: xmp_data_struct.h:207
void _XMP_gmove_garray_scalar(_XMP_gmv_desc_t *gmv_desc_leftp, void *scalar, int mode)
Definition: xmp_gmove.c:4732
void _XMP_gmove_scalar_garray(void *scalar, _XMP_gmv_desc_t *gmv_desc_rightp, int mode)
Definition: xmp_gmove.c:4704
int type
Definition: xmp_data_struct.h:273
void _XMP_gmove_larray_garray(_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int mode)
Definition: xmp_gmove.c:5003
int * a_lb
Definition: xmp_data_struct.h:394