Skip to content

Commit f9338da

Browse files
authored
Merge pull request #6312 from ggouaillardet/topic/op
ompi/op: fix support of non predefined datatypes with predefined oper…
2 parents 23da9fa + bc1cab5 commit f9338da

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
@@ -16,6 +16,8 @@
1616
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1717
* reserved.
1818
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
19+
* Copyright (c) 2019 Research Organization for Information Science
20+
* and Technology (RIST). All rights reserved.
1921
* $COPYRIGHT$
2022
*
2123
* Additional copyrights may follow
@@ -571,9 +573,16 @@ static inline void ompi_op_reduce(ompi_op_t * op, void *source,
571573

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

0 commit comments

Comments
 (0)