Skip to content

Commit 47ebfaa

Browse files
Merge pull request #3451 from mkurnosov/reduce-allreduce-rebenseifner
coll: Add Rabenseifner's algorithm for Reduce and Allreduce
2 parents 10b103a + f6e2d4a commit 47ebfaa

File tree

6 files changed

+1086
-0
lines changed

6 files changed

+1086
-0
lines changed

ompi/mca/coll/spacc/Makefile.am

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# $COPYRIGHT$
3+
#
4+
# Additional copyrights may follow
5+
#
6+
# $HEADER$
7+
#
8+
9+
sources = \
10+
coll_spacc.h \
11+
coll_spacc_component.c \
12+
coll_spacc_module.c \
13+
coll_spacc_allreduce.c \
14+
coll_spacc_reduce.c
15+
16+
# Make the output library in this directory, and name it either
17+
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
18+
# (for static builds).
19+
20+
if MCA_BUILD_ompi_coll_spacc_DSO
21+
component_noinst =
22+
component_install = mca_coll_spacc.la
23+
else
24+
component_noinst = libmca_coll_spacc.la
25+
component_install =
26+
endif
27+
28+
mcacomponentdir = $(ompilibdir)
29+
mcacomponent_LTLIBRARIES = $(component_install)
30+
mca_coll_spacc_la_SOURCES = $(sources)
31+
mca_coll_spacc_la_LDFLAGS = -module -avoid-version
32+
33+
noinst_LTLIBRARIES = $(component_noinst)
34+
libmca_coll_spacc_la_SOURCES =$(sources)
35+
libmca_coll_spacc_la_LDFLAGS = -module -avoid-version

ompi/mca/coll/spacc/coll_spacc.h

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* $COPYRIGHT$
3+
*
4+
* Additional copyrights may follow
5+
*
6+
* $HEADER$
7+
*/
8+
9+
#ifndef MCA_COLL_SPACC_EXPORT_H
10+
#define MCA_COLL_SPACC_EXPORT_H
11+
12+
#include "ompi_config.h"
13+
14+
#include "mpi.h"
15+
#include "ompi/mca/coll/coll.h"
16+
17+
BEGIN_C_DECLS
18+
19+
/* Globally exported variables */
20+
extern int ompi_coll_spacc_stream;
21+
extern int ompi_coll_spacc_priority;
22+
23+
/* API functions */
24+
25+
int mca_coll_spacc_init_query(bool enable_progress_threads,
26+
bool enable_mpi_threads);
27+
mca_coll_base_module_t
28+
*mca_coll_spacc_comm_query(struct ompi_communicator_t *comm, int *priority);
29+
30+
int mca_coll_spacc_module_enable(mca_coll_base_module_t *module,
31+
struct ompi_communicator_t *comm);
32+
33+
int mca_coll_spacc_allreduce_intra_redscat_allgather(
34+
const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype,
35+
struct ompi_op_t *op, struct ompi_communicator_t *comm,
36+
mca_coll_base_module_t *module);
37+
38+
int mca_coll_spacc_reduce_intra_redscat_gather(
39+
const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype,
40+
struct ompi_op_t *op, int root, struct ompi_communicator_t *comm,
41+
mca_coll_base_module_t *module);
42+
43+
/*
44+
* coll API functions
45+
*/
46+
47+
/* API functions */
48+
49+
int ompi_coll_spacc_init_query(bool enable_progress_threads,
50+
bool enable_mpi_threads);
51+
52+
mca_coll_base_module_t *
53+
ompi_coll_spacc_comm_query(struct ompi_communicator_t *comm, int *priority);
54+
55+
struct mca_coll_spacc_component_t {
56+
/* Base coll component */
57+
mca_coll_base_component_2_0_0_t super;
58+
59+
/* MCA parameter: priority of this component */
60+
int spacc_priority;
61+
62+
/* global stuff that I need the component to store */
63+
64+
/* MCA parameters first */
65+
};
66+
67+
/*
68+
* Convenience typedef
69+
*/
70+
typedef struct mca_coll_spacc_component_t mca_coll_spacc_component_t;
71+
72+
/*
73+
* Global component instance
74+
*/
75+
OMPI_MODULE_DECLSPEC extern mca_coll_spacc_component_t mca_coll_spacc_component;
76+
77+
struct mca_coll_spacc_module_t {
78+
mca_coll_base_module_t super;
79+
};
80+
typedef struct mca_coll_spacc_module_t mca_coll_spacc_module_t;
81+
OBJ_CLASS_DECLARATION(mca_coll_spacc_module_t);
82+
83+
#endif /* MCA_COLL_SPACC_EXPORT_H */

0 commit comments

Comments
 (0)