Skip to content

Commit 6697514

Browse files
authored
Merge pull request #2928 from jjhursey/topic/ibm/v2.x/osc-base-dt-abort
osc/base: Detect unsupported data types and abort
2 parents d411593 + cc5747f commit 6697514

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed

ompi/mca/osc/base/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
# University of Stuttgart. All rights reserved.
88
# Copyright (c) 2004-2005 The Regents of the University of California.
99
# All rights reserved.
10+
# Copyright (c) 2017 IBM Corporation. All rights reserved.
1011
# $COPYRIGHT$
1112
#
1213
# Additional copyrights may follow
1314
#
1415
# $HEADER$
1516
#
1617

18+
dist_ompidata_DATA = base/help-mca-osc-base.txt
19+
1720
headers += \
1821
base/base.h \
1922
base/osc_base_obj_convert.h
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- text -*-
2+
#
3+
# Copyright (c) 2017 IBM Corporation. All rights reserved.
4+
# $COPYRIGHT$
5+
#
6+
# Additional copyrights may follow
7+
#
8+
# $HEADER$
9+
#
10+
# This is the US/English help file for Open MPI MCA osc-specific
11+
# error messages.
12+
#
13+
[unsupported-dt]
14+
Unsupported datatype and op combination used in a one-sided operation.
15+
16+
Datatype : %s
17+
Operation: %s
18+
Rank : %d

ompi/mca/osc/base/osc_base_obj_convert.c

Lines changed: 20 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,24 @@ 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 support is added.
82+
* See the following issue for the current state:
83+
* https://github.com/open-mpi/ompi/issues/1666
84+
*/
85+
if(MPI_MINLOC == op || MPI_MAXLOC == op) {
86+
if(MPI_SHORT_INT == datatype ||
87+
MPI_DOUBLE_INT == datatype ||
88+
MPI_LONG_INT == datatype ||
89+
MPI_LONG_DOUBLE_INT == datatype) {
90+
ompi_communicator_t *comm = &ompi_mpi_comm_world.comm;
91+
opal_show_help("help-mca-osc-base.txt", "unsupported-dt", true,
92+
datatype->name,
93+
op->o_name,
94+
comm->c_my_rank);
95+
ompi_mpi_abort(comm, -1);
96+
}
97+
}
98+
7999
if (ompi_datatype_is_predefined(datatype)) {
80100
ompi_op_reduce(op, inbuf, outbuf, count, datatype);
81101
} else {

ompi/mca/osc/rdma/osc_rdma_accumulate.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* reserved.
55
* Copyright (c) 2016 Research Organization for Information Science
66
* and Technology (RIST). All rights reserved.
7+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
78
* $COPYRIGHT$
89
*
910
* Additional copyrights may follow
@@ -14,6 +15,7 @@
1415
#include "osc_rdma_accumulate.h"
1516
#include "osc_rdma_request.h"
1617
#include "osc_rdma_comm.h"
18+
#include "opal/util/show_help.h"
1719

1820
#include "ompi/mca/osc/base/osc_base_obj_convert.h"
1921

@@ -1026,6 +1028,46 @@ int ompi_osc_rdma_rget_accumulate_internal (ompi_osc_rdma_sync_t *sync, const vo
10261028
return OMPI_SUCCESS;
10271029
}
10281030

1031+
/* TODO: Remove the following check when support is added.
1032+
* See the following issue for the current state:
1033+
* https://github.com/open-mpi/ompi/issues/1666
1034+
*/
1035+
if(MPI_MINLOC == op || MPI_MAXLOC == op) {
1036+
if(MPI_SHORT_INT == origin_datatype ||
1037+
MPI_DOUBLE_INT == origin_datatype ||
1038+
MPI_LONG_INT == origin_datatype ||
1039+
MPI_LONG_DOUBLE_INT == origin_datatype) {
1040+
ompi_communicator_t *comm = &ompi_mpi_comm_world.comm;
1041+
opal_show_help("help-mca-osc-base.txt", "unsupported-dt", true,
1042+
origin_datatype->name,
1043+
op->o_name,
1044+
comm->c_my_rank);
1045+
ompi_mpi_abort(comm, -1);
1046+
}
1047+
if(MPI_SHORT_INT == result_datatype ||
1048+
MPI_DOUBLE_INT == result_datatype ||
1049+
MPI_LONG_INT == result_datatype ||
1050+
MPI_LONG_DOUBLE_INT == result_datatype) {
1051+
ompi_communicator_t *comm = &ompi_mpi_comm_world.comm;
1052+
opal_show_help("help-mca-osc-base.txt", "unsupported-dt", true,
1053+
result_datatype->name,
1054+
op->o_name,
1055+
comm->c_my_rank);
1056+
ompi_mpi_abort(comm, -1);
1057+
}
1058+
if(MPI_SHORT_INT == target_datatype ||
1059+
MPI_DOUBLE_INT == target_datatype ||
1060+
MPI_LONG_INT == target_datatype ||
1061+
MPI_LONG_DOUBLE_INT == target_datatype) {
1062+
ompi_communicator_t *comm = &ompi_mpi_comm_world.comm;
1063+
opal_show_help("help-mca-osc-base.txt", "unsupported-dt", true,
1064+
target_datatype->name,
1065+
op->o_name,
1066+
comm->c_my_rank);
1067+
ompi_mpi_abort(comm, -1);
1068+
}
1069+
}
1070+
10291071
(void) ompi_datatype_get_extent (origin_datatype, &lb, &extent);
10301072

10311073
ret = osc_rdma_get_remote_segment (module, peer, target_disp, extent * target_count, &target_address, &target_handle);

0 commit comments

Comments
 (0)