Skip to content

Commit 3ca18e9

Browse files
committed
coll/spacc: fix module initialization in v3.1.x
Prepare the placeholder for the array of requests. The call of coll/spacc/MPI_Allreduce with count < comm_size or with non-commutative binary operation produces the segmentation fault (only in v3.1.x). The problem is that spacc/MPI_Allreduce in this case switched to the `ompi_coll_base_allreduce_intra_basic_linear`. But a lot of base collectives require prepared placeholder for the array of requests. Signed-off-by: Mikhail Kurnosov <mkurnosov@gmail.com>
1 parent 45fb684 commit 3ca18e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ompi/mca/coll/spacc/coll_spacc_module.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "mpi.h"
1212
#include "ompi/communicator/communicator.h"
1313
#include "ompi/mca/coll/base/base.h"
14+
#include "ompi/mca/coll/base/coll_base_functions.h"
1415
#include "ompi/mca/coll/coll.h"
1516
#include "coll_spacc.h"
1617

@@ -87,6 +88,11 @@ static int spacc_module_enable(mca_coll_base_module_t *module,
8788
struct ompi_communicator_t *comm)
8889
{
8990
opal_output_verbose(30, mca_coll_spacc_stream, "coll:spacc:module_enable called");
91+
/* prepare the placeholder for the array of request* */
92+
module->base_data = OBJ_NEW(mca_coll_base_comm_t);
93+
if (NULL == module->base_data) {
94+
return OMPI_ERROR;
95+
}
9096
return OMPI_SUCCESS;
9197
}
9298

0 commit comments

Comments
 (0)