From a776d78f2d77c17958a1e851a57f1c345fe0baa1 Mon Sep 17 00:00:00 2001 From: Joshua Hursey Date: Thu, 2 Jun 2016 14:48:38 -0400 Subject: [PATCH] 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. --- ompi/op/op.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ompi/op/op.c b/ompi/op/op.c index 31cd01f9ed..b115e5c60a 100644 --- a/ompi/op/op.c +++ b/ompi/op/op.c @@ -443,6 +443,10 @@ static void ompi_op_construct(ompi_op_t *new_op) { int i; + /* Provide a default of a high value. Useful for non-predefined ops. */ + new_op->op_type = OMPI_OP_NUM_OF_TYPES; + new_op->o_flags = 0; + /* assign entry in fortran <-> c translation array */ new_op->o_f_to_c_index =