Skip to content

Commit 4917e44

Browse files
authored
Merge pull request #2832 from jjhursey/topic/ibm/osc-base-dt-abort
osc/base: Detect unsupported data types and abort
2 parents f4ad119 + 94f92f6 commit 4917e44

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ompi/mca/osc/base/osc_base_obj_convert.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* and Technology (RIST). All rights reserved.
1616
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
1717
* Copyright (c) 2015 Intel, Inc. All rights reserved.
18+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
1819
* $COPYRIGHT$
1920
*
2021
* Additional copyrights may follow
@@ -31,6 +32,7 @@
3132
#include "opal/datatype/opal_convertor.h"
3233
#include "opal/datatype/opal_convertor_internal.h"
3334
#include "opal/datatype/opal_datatype_prototypes.h"
35+
#include "opal/util/show_help.h"
3436

3537
#include "ompi/op/op.h"
3638
#include "ompi/datatype/ompi_datatype.h"
@@ -76,6 +78,25 @@ int ompi_osc_base_process_op (void *outbuf, void *inbuf, size_t inbuflen,
7678
return OMPI_ERR_NOT_SUPPORTED;
7779
}
7880

81+
/* TODO: Remove the following check when ompi adds support */
82+
if(MPI_MINLOC == op || MPI_MAXLOC == op) {
83+
if(MPI_SHORT_INT == datatype ||
84+
MPI_DOUBLE_INT == datatype ||
85+
MPI_LONG_INT == datatype ||
86+
MPI_LONG_DOUBLE_INT == datatype) {
87+
ompi_communicator_t *comm = &ompi_mpi_comm_world.comm;
88+
opal_output(0, "Error: %s datatype is currently "
89+
"unsupported for MPI_MINLOC/MPI_MAXLOC "
90+
"operation\n", datatype->name);
91+
opal_show_help("help-mpi-api.txt", "mpi-abort", true,
92+
comm->c_my_rank,
93+
('\0' != comm->c_name[0]) ? comm->c_name : "<Unknown>",
94+
-1);
95+
96+
ompi_mpi_abort(comm, -1);
97+
}
98+
}
99+
79100
if (ompi_datatype_is_predefined(datatype)) {
80101
ompi_op_reduce(op, inbuf, outbuf, count, datatype);
81102
} else {

0 commit comments

Comments
 (0)