From 94f92f6b49212545355123d711abc91af9647d8e Mon Sep 17 00:00:00 2001 From: "Nysal Jan K.A" Date: Mon, 4 Jul 2016 06:09:57 -0400 Subject: [PATCH] osc/base: Detect unsupported data types and abort Using MPI_MINLOC or MPI_MAXLOC with the following data types leads to data corruption: * MPI_DOUBLE_INT * MPI_LONG_INT * MPI_SHORT_INT * MPI_LONG_DOUBLE_INT Detect this print a error message and abort. This workaround should be removed once the following issue is resolved: * https://github.com/open-mpi/ompi/issues/1666 Signed-off-by: Joshua Hursey --- ompi/mca/osc/base/osc_base_obj_convert.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ompi/mca/osc/base/osc_base_obj_convert.c b/ompi/mca/osc/base/osc_base_obj_convert.c index b90873f6ed..d91d4d3080 100644 --- a/ompi/mca/osc/base/osc_base_obj_convert.c +++ b/ompi/mca/osc/base/osc_base_obj_convert.c @@ -15,6 +15,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Intel, Inc. All rights reserved. + * Copyright (c) 2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,6 +32,7 @@ #include "opal/datatype/opal_convertor.h" #include "opal/datatype/opal_convertor_internal.h" #include "opal/datatype/opal_datatype_prototypes.h" +#include "opal/util/show_help.h" #include "ompi/op/op.h" #include "ompi/datatype/ompi_datatype.h" @@ -76,6 +78,25 @@ int ompi_osc_base_process_op (void *outbuf, void *inbuf, size_t inbuflen, return OMPI_ERR_NOT_SUPPORTED; } + /* TODO: Remove the following check when ompi adds support */ + if(MPI_MINLOC == op || MPI_MAXLOC == op) { + if(MPI_SHORT_INT == datatype || + MPI_DOUBLE_INT == datatype || + MPI_LONG_INT == datatype || + MPI_LONG_DOUBLE_INT == datatype) { + ompi_communicator_t *comm = &ompi_mpi_comm_world.comm; + opal_output(0, "Error: %s datatype is currently " + "unsupported for MPI_MINLOC/MPI_MAXLOC " + "operation\n", datatype->name); + opal_show_help("help-mpi-api.txt", "mpi-abort", true, + comm->c_my_rank, + ('\0' != comm->c_name[0]) ? comm->c_name : "", + -1); + + ompi_mpi_abort(comm, -1); + } + } + if (ompi_datatype_is_predefined(datatype)) { ompi_op_reduce(op, inbuf, outbuf, count, datatype); } else {