libxmp/libxmpf in Omni Compiler  1.3.4
xmp.h
Go to the documentation of this file.
1 #ifndef MPI_PORTABLE_PLATFORM_H
2 #define MPI_PORTABLE_PLATFORM_H
3 #endif
4 
5 #ifndef _XMP_USERAPI
6 #define _XMP_USERAPI
7 
8 #define XMP_FAILURE -2000
9 #define XMP_UNDEFINED -2001
10 
11 #define XMP_ENTIRE_NODES 2000
12 #define XMP_EXECUTING_NODES 2001
13 #define XMP_PRIMARY_NODES 2002
14 #define XMP_EQUIVALENCE_NODES 2003
15 
16 #define XMP_NOT_DISTRIBUTED 2100
17 #define XMP_BLOCK 2101
18 #define XMP_CYCLIC 2102
19 #define XMP_GBLOCK 2103
20 
21 #define XMP_DESC_NODES 2200
22 #define XMP_DESC_TEMPLATE 2201
23 #define XMP_DESC_ARRAY 2202
24 
25 #include <stddef.h>
26 #include <mpi.h>
27 
28 // Typedef
29 typedef void* xmp_desc_t;
30 #ifdef _XMP_GASNET
31 #include "xmp_lock.h"
32 #endif
33 
34 // ----- libxmp
35 extern MPI_Comm xmp_get_mpi_comm(void);
36 extern void xmp_init_mpi(int *argc, char ***argv);
37 extern void xmp_finalize_mpi(void);
38 extern void xmp_init(MPI_Comm comm);
39 extern void xmp_finalize();
40 extern int xmp_num_nodes(void);
41 extern int xmp_num_images(void);
42 extern int xmp_desc_kind(xmp_desc_t d, int *kind);
43 extern int xmp_node_num(void);
44 extern int xmpc_node_num(void);
45 extern int xmpc_this_image(void);
46 extern void xmp_barrier(void);
47 extern int xmp_all_num_nodes(void);
48 extern int xmp_all_node_num(void);
49 extern int xmpc_all_node_num(void);
50 extern double xmp_wtime(void);
51 extern double xmp_wtick(void);
52 extern int xmp_array_ndims(xmp_desc_t d, int *ndims);
53 extern int xmp_array_lbound(xmp_desc_t d, int dim, int *lbound);
54 extern int xmp_array_ubound(xmp_desc_t d, int dim, int *ubound);
55 extern size_t xmp_array_type_size(xmp_desc_t d);
56 extern int xmp_array_gsize(xmp_desc_t d, int dim);
57 extern int xmp_array_lsize(xmp_desc_t d, int dim, int *lsize);
58 extern int xmp_array_gcllbound(xmp_desc_t d, int dim);
59 extern int xmp_array_gclubound(xmp_desc_t d, int dim);
60 extern int xmp_array_lcllbound(xmp_desc_t d, int dim);
61 extern int xmp_array_lclubound(xmp_desc_t d, int dim);
62 extern int xmp_array_gcglbound(xmp_desc_t d, int dim);
63 extern int xmp_array_gcgubound(xmp_desc_t d, int dim);
64 extern int xmp_array_laddr(xmp_desc_t d, void **laddr);
65 extern int xmp_array_lshadow(xmp_desc_t d, int dim, int *lshadow);
66 extern int xmp_array_ushadow(xmp_desc_t d, int dim, int *ushadow);
67 extern int xmp_array_owner(xmp_desc_t d, int ndims, int index[], int dim);
68 extern int xmp_array_lead_dim(xmp_desc_t d, int size[]);
69 extern int xmp_array_gtol(xmp_desc_t d, int dim, int g_idx, int *lidx);
70 extern int xmp_align_axis(xmp_desc_t d, int dim, int *axis);
71 extern int xmp_align_offset(xmp_desc_t d, int dim, int *offset);
72 extern int xmp_align_format(xmp_desc_t d, int dim);
73 extern int xmp_align_size(xmp_desc_t d, int dim);
74 extern int xmp_align_replicated(xmp_desc_t d, int dim, int *replicated);
75 extern int xmp_align_template(xmp_desc_t d, xmp_desc_t *dt);
76 extern int xmp_template_fixed(xmp_desc_t d, int *fixed);
77 extern int xmp_template_ndims(xmp_desc_t d, int *ndims);
78 extern int xmp_template_lbound(xmp_desc_t d, int dim, int *lbound);
79 extern int xmp_template_ubound(xmp_desc_t d, int dim, int *ubound);
80 extern int xmp_template_gsize(xmp_desc_t d, int dim);
81 extern int xmp_template_lsize(xmp_desc_t d, int dim);
82 extern int xmp_dist_format(xmp_desc_t d, int dim, int *format);
83 extern int xmp_dist_blocksize(xmp_desc_t d, int dim, int *blocksize);
84 extern int xmp_dist_stride(xmp_desc_t d, int dim);
85 extern int xmp_dist_nodes(xmp_desc_t d, xmp_desc_t *dn);
86 extern int xmp_dist_axis(xmp_desc_t d, int dim, int *axis);
87 extern int xmp_dist_gblockmap(xmp_desc_t d, int dim, int *map);
88 extern int xmp_nodes_ndims(xmp_desc_t d, int *ndims);
89 extern int xmp_nodes_index(xmp_desc_t d, int dim, int *index);
90 extern int xmp_nodes_size(xmp_desc_t d, int dim, int *size);
91 extern int xmp_nodes_rank(xmp_desc_t d, int *rank);
92 extern int xmp_nodes_comm(xmp_desc_t d, void **comm);
93 extern int xmp_nodes_equiv(xmp_desc_t d, xmp_desc_t *dn, int lb[], int ub[], int st[]);
94 extern void xmp_sched_template_index(int* local_start_index, int* local_end_index,
95  const int global_start_index, const int global_end_index, const int step,
96  const xmp_desc_t template, const int template_dim);
97 extern void xmp_sync_memory(const int* status);
98 extern void xmp_sync_all(const int* status);
99 extern void xmp_sync_image(const int image, int* status);
100 extern void xmp_sync_images(const int num, int* image_set, int* status);
101 extern void xmp_sync_images_all(int* status);
102 extern void xmp_sort_up(xmp_desc_t a_desc, xmp_desc_t b_desc);
103 extern void xmp_sort_down(xmp_desc_t a_desc, xmp_desc_t b_desc);
104 extern void *xmp_malloc(xmp_desc_t d, ...);
105 extern void xmp_free(xmp_desc_t d);
106 extern void xmp_exit(int status);
107 extern void xmp_array_lbound_global(xmp_desc_t d, int dim, int *global_i);
108 extern void xmp_array_ubound_global(xmp_desc_t d, int dim, int *global_i);
109 extern void xmp_atomic_define(int, int);
110 extern void xmp_atomic_ref(int*, int);
111 
112 // ----- libxmp_gpu
113 #ifdef _XMP_ENABLE_GPU
114 extern int xmp_get_gpu_count(void);
115 #endif
116 
117 #endif // _XMP_USERAPI
118 
xmp_atomic_ref
void xmp_atomic_ref(int *, int)
xmp_array_lead_dim
int xmp_array_lead_dim(xmp_desc_t d, int size[])
Definition: xmp_lib.c:222
xmp_num_nodes
int xmp_num_nodes(void)
Definition: xmp_lib.c:41
xmp_sync_images_all
void xmp_sync_images_all(int *status)
Execute sync_images_all()
Definition: xmp_coarray.c:1463
xmp_array_type_size
size_t xmp_array_type_size(xmp_desc_t d)
Definition: xmp_lib.c:117
xmp_get_mpi_comm
MPI_Comm xmp_get_mpi_comm(void)
Definition: xmp_lib.c:11
xmp_sort_down
void xmp_sort_down(xmp_desc_t a_desc, xmp_desc_t b_desc)
xmp_dist_axis
int xmp_dist_axis(xmp_desc_t d, int dim, int *axis)
Definition: xmp_lib.c:422
xmp_nodes_equiv
int xmp_nodes_equiv(xmp_desc_t d, xmp_desc_t *dn, int lb[], int ub[], int st[])
Definition: xmp_lib.c:489
xmp_align_size
int xmp_align_size(xmp_desc_t d, int dim)
Definition: xmp_lib.c:262
xmp_sync_image
void xmp_sync_image(const int image, int *status)
Execute sync_image()
Definition: xmp_coarray.c:1455
xmp_template_lbound
int xmp_template_lbound(xmp_desc_t d, int dim, int *lbound)
Definition: xmp_lib.c:344
xmp_align_axis
int xmp_align_axis(xmp_desc_t d, int dim, int *axis)
Definition: xmp_lib.c:242
xmp_exit
void xmp_exit(int status)
Definition: xmp_lib.c:611
xmp_init_mpi
void xmp_init_mpi(int *argc, char ***argv)
Definition: xmp_lib.c:18
xmp_align_offset
int xmp_align_offset(xmp_desc_t d, int dim, int *offset)
Definition: xmp_lib.c:249
xmp_array_lclubound
int xmp_array_lclubound(xmp_desc_t d, int dim)
Definition: xmp_lib.c:155
xmp_sync_images
void xmp_sync_images(const int num, int *image_set, int *status)
Execute sync_images()
Definition: xmp_coarray.c:1439
xmp_template_fixed
int xmp_template_fixed(xmp_desc_t d, int *fixed)
Definition: xmp_lib.c:330
xmp_sort_up
void xmp_sort_up(xmp_desc_t a_desc, xmp_desc_t b_desc)
xmp_nodes_ndims
int xmp_nodes_ndims(xmp_desc_t d, int *ndims)
Definition: xmp_lib.c:454
xmp_atomic_define
void xmp_atomic_define(int, int)
Definition: xmp_atomic.c:1
xmpc_all_node_num
int xmpc_all_node_num(void)
Definition: xmp_lib.c:81
xmp_desc_t
void * xmp_desc_t
Definition: xmp.h:29
xmp_template_ndims
int xmp_template_ndims(xmp_desc_t d, int *ndims)
Definition: xmp_lib.c:337
xmp_array_laddr
int xmp_array_laddr(xmp_desc_t d, void **laddr)
Definition: xmp_lib.c:173
xmp_array_ndims
int xmp_array_ndims(xmp_desc_t d, int *ndims)
Definition: xmp_lib.c:96
xmp_nodes_comm
int xmp_nodes_comm(xmp_desc_t d, void **comm)
Definition: xmp_lib.c:482
xmp_array_ubound_global
void xmp_array_ubound_global(xmp_desc_t d, int dim, int *global_i)
Definition: xmp_lib.c:622
xmp_array_gtol
int xmp_array_gtol(xmp_desc_t d, int dim, int g_idx, int *lidx)
Definition: xmp_lib.c:234
xmp_template_lsize
int xmp_template_lsize(xmp_desc_t d, int dim)
Definition: xmp_lib.c:365
xmp_wtick
double xmp_wtick(void)
Definition: xmp_lib.c:91
xmp_array_gsize
int xmp_array_gsize(xmp_desc_t d, int dim)
Definition: xmp_lib.c:123
xmp_nodes_rank
int xmp_nodes_rank(xmp_desc_t d, int *rank)
Definition: xmp_lib.c:475
xmp_align_format
int xmp_align_format(xmp_desc_t d, int dim)
Definition: xmp_lib.c:256
xmp_node_num
int xmp_node_num(void)
Definition: xmp_lib.c:51
xmp_array_gcglbound
int xmp_array_gcglbound(xmp_desc_t d, int dim)
Definition: xmp_lib.c:161
xmp_nodes_index
int xmp_nodes_index(xmp_desc_t d, int dim, int *index)
Definition: xmp_lib.c:461
xmp_array_lcllbound
int xmp_array_lcllbound(xmp_desc_t d, int dim)
Definition: xmp_lib.c:149
xmpc_node_num
int xmpc_node_num(void)
Definition: xmp_lib.c:56
xmp_get_gpu_count
int xmp_get_gpu_count(void)
Definition: xmp_gpu_lib.c:3
xmp_array_lshadow
int xmp_array_lshadow(xmp_desc_t d, int dim, int *lshadow)
Definition: xmp_lib.c:187
xmp_dist_format
int xmp_dist_format(xmp_desc_t d, int dim, int *format)
Definition: xmp_lib.c:371
xmp_array_lbound_global
void xmp_array_lbound_global(xmp_desc_t d, int dim, int *global_i)
Definition: xmp_lib.c:616
xmp_array_ushadow
int xmp_array_ushadow(xmp_desc_t d, int dim, int *ushadow)
Definition: xmp_lib.c:180
xmp_array_gcgubound
int xmp_array_gcgubound(xmp_desc_t d, int dim)
Definition: xmp_lib.c:167
xmp_array_lbound
int xmp_array_lbound(xmp_desc_t d, int dim, int *lbound)
Definition: xmp_lib.c:103
xmp_free
void xmp_free(xmp_desc_t d)
Definition: xmp_lib.c:605
xmp_barrier
void xmp_barrier(void)
Definition: xmp_lib.c:66
xmp_array_ubound
int xmp_array_ubound(xmp_desc_t d, int dim, int *ubound)
Definition: xmp_lib.c:110
xmp_wtime
double xmp_wtime(void)
Definition: xmp_lib.c:86
xmp_nodes_size
int xmp_nodes_size(xmp_desc_t d, int dim, int *size)
Definition: xmp_lib.c:468
xmp_finalize
void xmp_finalize()
Definition: xmp_lib.c:30
xmp_finalize_mpi
void xmp_finalize_mpi(void)
Definition: xmp_lib.c:19
xmpc_this_image
int xmpc_this_image(void)
Definition: xmp_lib.c:61
xmp_sync_memory
void xmp_sync_memory(const int *status)
Execute sync_memory()
Definition: xmp_coarray.c:1405
xmp_malloc
void * xmp_malloc(xmp_desc_t d,...)
Definition: xmp_lib.c:538
xmp_align_replicated
int xmp_align_replicated(xmp_desc_t d, int dim, int *replicated)
Definition: xmp_lib.c:290
xmp_init
void xmp_init(MPI_Comm comm)
Definition: xmp_lib.c:25
xmp_array_gclubound
int xmp_array_gclubound(xmp_desc_t d, int dim)
Definition: xmp_lib.c:143
xmp_array_lsize
int xmp_array_lsize(xmp_desc_t d, int dim, int *lsize)
Definition: xmp_lib.c:129
xmp_dist_nodes
int xmp_dist_nodes(xmp_desc_t d, xmp_desc_t *dn)
Definition: xmp_lib.c:415
xmp_template_gsize
int xmp_template_gsize(xmp_desc_t d, int dim)
Definition: xmp_lib.c:359
xmp_desc_kind
int xmp_desc_kind(xmp_desc_t d, int *kind)
Definition: xmp_lib.c:35
xmp_dist_gblockmap
int xmp_dist_gblockmap(xmp_desc_t d, int dim, int *map)
Definition: xmp_lib.c:429
xmp_align_template
int xmp_align_template(xmp_desc_t d, xmp_desc_t *dt)
Definition: xmp_lib.c:323
xmp_num_images
int xmp_num_images(void)
Definition: xmp_lib.c:46
xmp_array_owner
int xmp_array_owner(xmp_desc_t d, int ndims, int index[], int dim)
xmp_dist_blocksize
int xmp_dist_blocksize(xmp_desc_t d, int dim, int *blocksize)
Definition: xmp_lib.c:389
xmp_sched_template_index
void xmp_sched_template_index(int *local_start_index, int *local_end_index, const int global_start_index, const int global_end_index, const int step, const xmp_desc_t template, const int template_dim)
Definition: xmp_lib.c:511
xmp_template_ubound
int xmp_template_ubound(xmp_desc_t d, int dim, int *ubound)
Definition: xmp_lib.c:351
xmp_dist_stride
int xmp_dist_stride(xmp_desc_t d, int dim)
Definition: xmp_lib.c:409
xmp_all_num_nodes
int xmp_all_num_nodes(void)
Definition: xmp_lib.c:71
xmp_all_node_num
int xmp_all_node_num(void)
Definition: xmp_lib.c:76
xmp_sync_all
void xmp_sync_all(const int *status)
Execute sync_all()
Definition: xmp_coarray.c:1423
xmp_array_gcllbound
int xmp_array_gcllbound(xmp_desc_t d, int dim)
Definition: xmp_lib.c:137
xmp_lock.h