Skip to content

Commit 3f934ed

Browse files
authored
Merge pull request #6329 from ggouaillardet/topic/v3.0.x/op
ompi/op: fix support of non predefined datatypes with predefined oper…
2 parents 2d2063a + 10f00ad commit 3f934ed

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ompi/op/op.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
1616
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1717
* reserved.
18+
* Copyright (c) 2019 Research Organization for Information Science
19+
* and Technology (RIST). All rights reserved.
1820
* $COPYRIGHT$
1921
*
2022
* Additional copyrights may follow
@@ -569,9 +571,16 @@ static inline void ompi_op_reduce(ompi_op_t * op, void *source,
569571

570572
/* For intrinsics, we also pass the corresponding op module */
571573
if (0 != (op->o_flags & OMPI_OP_FLAGS_INTRINSIC)) {
572-
op->o_func.intrinsic.fns[ompi_op_ddt_map[dtype->id]](source, target,
573-
&count, &dtype,
574-
op->o_func.intrinsic.modules[ompi_op_ddt_map[dtype->id]]);
574+
int dtype_id;
575+
if (!ompi_datatype_is_predefined(dtype)) {
576+
ompi_datatype_t *dt = ompi_datatype_get_single_predefined_type_from_args(dtype);
577+
dtype_id = ompi_op_ddt_map[dt->id];
578+
} else {
579+
dtype_id = ompi_op_ddt_map[dtype->id];
580+
}
581+
op->o_func.intrinsic.fns[dtype_id](source, target,
582+
&count, &dtype,
583+
op->o_func.intrinsic.modules[dtype_id]);
575584
return;
576585
}
577586

0 commit comments

Comments
 (0)