Skip to content

Commit a776d78

Browse files
committed
ompi/op: Provide a default value for type/flags
* User defined ops leave the op_type unset which can confuse logic in a collective component that is trying to convert the op to the approprate local function.
1 parent d577e12 commit a776d78

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ompi/op/op.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,10 @@ static void ompi_op_construct(ompi_op_t *new_op)
443443
{
444444
int i;
445445

446+
/* Provide a default of a high value. Useful for non-predefined ops. */
447+
new_op->op_type = OMPI_OP_NUM_OF_TYPES;
448+
new_op->o_flags = 0;
449+
446450
/* assign entry in fortran <-> c translation array */
447451

448452
new_op->o_f_to_c_index =

0 commit comments

Comments
 (0)