10 #include "ompi_config.h"
15 #define OMPI_FCA_VERSION 12
17 #define OMPI_FCA_VERSION FCA_API
25 #define OMPI_FCA_BARRIER 1
26 #define OMPI_FCA_BCAST 1
27 #define OMPI_FCA_REDUCE 1
28 #define OMPI_FCA_ALLREDUCE 1
30 #define OMPI_FCA_REDUCE_SCATTER 0
31 #define OMPI_FCA_GATHER 0
32 #define OMPI_FCA_GATHERV 0
33 #define OMPI_FCA_ALLTOALL 0
34 #define OMPI_FCA_ALLTOALLV 0
35 #define OMPI_FCA_ALLTOALLW 0
38 #if OMPI_FCA_VERSION == 12
40 #define OMPI_FCA_ALLGATHER 0
42 #define FCA_API_ABI_MAJOR 1
43 #define FCA_API_ABI_MINOR 2
44 #define FCA_MAJOR_BIT 24ul
45 #define FCA_MINOR_BIT 16ul
52 int (*init)(fca_init_spec_t *spec, fca_t **context);
53 void (*cleanup)(fca_t *context);
56 int (*comm_new)(fca_t *context, fca_comm_new_spec_t *spec, fca_comm_desc_t *comm_desc);
57 int (*comm_end)(fca_t *context,
int comm_id);
58 void* (*get_rank_info)(fca_t *context,
int *size);
59 void (*free_rank_info)(
void *rank_info);
62 int (*comm_init)(fca_t *context,
int proc_idx,
int num_procs,
int comm_size,
63 fca_comm_desc_t *comm_desc, fca_comm_t** fca_comm);
64 void (*comm_destroy)(fca_comm_t *comm);
65 int (*comm_get_caps)(fca_comm_t *comm, fca_comm_caps_t *caps);
68 int (*do_reduce)(fca_comm_t *comm, fca_reduce_spec_t *spec);
69 int (*do_all_reduce)(fca_comm_t *comm, fca_reduce_spec_t *spec);
70 int (*do_bcast)(fca_comm_t *comm, fca_bcast_spec_t *spec);
71 int (*do_barrier)(fca_comm_t *comm);
74 unsigned long (*get_version)(void);
75 char * (*get_version_string)(void);
76 fca_init_spec_t *(*parse_spec_file)(
char* spec_ini_file);
77 void (*free_init_spec)(fca_init_spec_t *fca_init_spec);
78 int (*translate_mpi_op)(
char *mpi_op);
79 int (*translate_mpi_dtype)(
char *mpi_dtype);
80 int (*get_dtype_size)(
int dtype);
81 const char* (*strerror)(
int code);
86 fca_t *fca_context,
int rank,
int comm_size,
87 int local_proc_idx,
int num_local_procs,
88 fca_comm_desc_t *comm_desc,
89 fca_comm_t **fca_comm)
91 return fca_ops->comm_init(fca_context, local_proc_idx, num_local_procs,
92 comm_size, comm_desc, fca_comm);
95 static inline void mca_coll_fca_get_bcast_root(
int root_rank,
int *local_ranks,
97 fca_bcast_spec_t *spec)
101 for (i = 0; i < num_local_ranks; ++i) {
102 if (local_ranks[i] == root_rank) {
107 spec->root_indx = -1;
110 static inline void mca_coll_fca_get_reduce_root(
int root_rank,
int my_rank,
111 fca_reduce_spec_t *spec)
113 spec->is_root = root_rank == my_rank;
116 #elif OMPI_FCA_VERSION == 20 || OMPI_FCA_VERSION == 21 || OMPI_FCA_VERSION == 22
118 #define OMPI_FCA_ALLGATHER 1
119 #define OMPI_FCA_ALLGATHERV 1
120 #define OMPI_FCA_PROGRESS 1
125 int (*init)(fca_init_spec_t *spec, fca_t **context);
126 void (*cleanup)(fca_t *context);
127 void (*progress)(fca_t *context);
130 int (*comm_new)(fca_t *context, fca_comm_new_spec_t *spec, fca_comm_desc_t *comm_desc);
131 int (*comm_end)(fca_t *context,
int comm_id);
132 void* (*get_rank_info)(fca_t *context,
int *size);
133 void (*free_rank_info)(
void *rank_info);
136 int (*comm_init)(fca_t *context, fca_comm_init_spec_t *spec, fca_comm_t** fca_comm);
137 void (*comm_destroy)(fca_comm_t *comm);
138 int (*comm_get_caps)(fca_comm_t *comm, fca_comm_caps_t *caps);
141 int (*do_reduce)(fca_comm_t *comm, fca_reduce_spec_t *spec);
142 int (*do_all_reduce)(fca_comm_t *comm, fca_reduce_spec_t *spec);
143 int (*do_bcast)(fca_comm_t *comm, fca_bcast_spec_t *spec);
144 int (*do_barrier)(fca_comm_t *comm);
145 int (*do_allgather)(fca_comm_t *comm, fca_gather_spec_t *spec);
146 int (*do_allgatherv)(fca_comm_t *comm, fca_gatherv_spec_t *spec);
149 unsigned long (*get_version)(void);
150 char * (*get_version_string)(void);
151 fca_init_spec_t *(*parse_spec_file)(
char* spec_ini_file);
152 void (*free_init_spec)(fca_init_spec_t *fca_init_spec);
153 int (*translate_mpi_op)(
char *mpi_op);
154 int (*translate_mpi_dtype)(
char *mpi_dtype);
155 int (*get_dtype_size)(
int dtype);
156 const char* (*strerror)(
int code);
161 fca_t *fca_context,
int rank,
int comm_size,
162 int local_proc_idx,
int num_local_procs,
163 fca_comm_desc_t *comm_desc,
164 fca_comm_t **fca_comm)
166 fca_comm_init_spec_t spec;
169 spec.size = comm_size;
170 spec.desc = *comm_desc;
171 spec.proc_idx = local_proc_idx;
172 spec.num_procs = num_local_procs;
173 return fca_ops->comm_init(fca_context, &spec, fca_comm);
176 static inline void mca_coll_fca_get_bcast_root(
int root_rank,
int *local_ranks,
178 fca_bcast_spec_t *spec)
180 spec->root = root_rank;
183 static inline void mca_coll_fca_get_reduce_root(
int root_rank,
int my_rank,
184 fca_reduce_spec_t *spec)
186 spec->root = root_rank;
191 #error "FCA API version is unsupported"
Definition: coll_fca_api.h:49