Skip to content

Commit 8499dd4

Browse files
committed
Correct MTL operations accessing status fields when it is invalid
Signed-off-by: Aurelien Bouteiller <[email protected]> (cherry picked from commit 3797220)
1 parent 9cddb09 commit 8499dd4

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

ompi/mca/mtl/ofi/mtl_ofi.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
* reserved.
77
* Copyright (c) 2018-2020 Amazon.com, Inc. or its affiliates. All rights
88
* reserved.
9-
*
9+
* Copyright (c) 2021 The University of Tennessee and The University
10+
* of Tennessee Research Foundation. All rights
11+
* reserved.
1012
* $COPYRIGHT$
1113
*
1214
* Additional copyrights may follow
@@ -1086,7 +1088,7 @@ ompi_mtl_ofi_iprobe_generic(struct mca_mtl_base_module_t *mtl,
10861088
*flag = ofi_req.match_state;
10871089
if (1 == *flag) {
10881090
if (MPI_STATUS_IGNORE != status) {
1089-
*status = ofi_req.status;
1091+
OMPI_COPY_STATUS(status, ofi_req.status, false);
10901092
}
10911093
}
10921094

@@ -1178,7 +1180,7 @@ ompi_mtl_ofi_improbe_generic(struct mca_mtl_base_module_t *mtl,
11781180
*matched = ofi_req->match_state;
11791181
if (1 == *matched) {
11801182
if (MPI_STATUS_IGNORE != status) {
1181-
*status = ofi_req->status;
1183+
OMPI_COPY_STATUS(status, ofi_req->status, false);
11821184
}
11831185

11841186
(*message) = ompi_message_alloc();

ompi/mca/mtl/portals4/mtl_portals4_probe.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
33
* University Research and Technology
44
* Corporation. All rights reserved.
5-
* Copyright (c) 2004-2010 The University of Tennessee and The University
5+
* Copyright (c) 2004-2021 The University of Tennessee and The University
66
* of Tennessee Research Foundation. All rights
77
* reserved.
88
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -120,7 +120,9 @@ ompi_mtl_portals4_iprobe(struct mca_mtl_base_module_t* mtl,
120120

121121
*flag = request.found_match;
122122
if (1 == *flag) {
123-
*status = request.status;
123+
if (MPI_STATUS_IGNORE != status) {
124+
OMPI_COPY_STATUS(status, request.status, false);
125+
}
124126
}
125127

126128
return OMPI_SUCCESS;
@@ -198,7 +200,9 @@ ompi_mtl_portals4_improbe(struct mca_mtl_base_module_t *mtl,
198200

199201
*matched = request.found_match;
200202
if (1 == *matched) {
201-
*status = request.status;
203+
if (MPI_STATUS_IGNORE != status) {
204+
OMPI_COPY_STATUS(status, request.status, false);
205+
}
202206

203207
(*message) = ompi_message_alloc();
204208
if (NULL == (*message)) {

0 commit comments

Comments
 (0)