From 0671e45de07f0112a479817b9a7b1b28ec67061d Mon Sep 17 00:00:00 2001 From: Joshua Hursey Date: Wed, 8 Jun 2016 12:48:33 -0400 Subject: [PATCH] op: Add a default value for MPI_OP o_name --- ompi/op/op.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ompi/op/op.c b/ompi/op/op.c index b115e5c60a..f1f4bf6f26 100644 --- a/ompi/op/op.c +++ b/ompi/op/op.c @@ -356,6 +356,9 @@ ompi_op_t *ompi_op_create_user(bool commute, new_op->o_flags |= OMPI_OP_FLAGS_COMMUTE; } + strncpy(new_op->o_name, "USER OP", sizeof(new_op->o_name) - 1); + new_op->o_name[sizeof(new_op->o_name) - 1] = '\0'; + /* Set the user-defined callback function. The "fort_fn" member is part of a union, so it doesn't matter if this is a C or Fortan callback; we'll call the right flavor (per o_flags) at @@ -446,6 +449,7 @@ static void ompi_op_construct(ompi_op_t *new_op) /* 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; + new_op->o_name[0] = '\0'; /* assign entry in fortran <-> c translation array */