Skip to content

Commit 3797220

Browse files
committed
Correct MTL operations accessing status fields when it is invalid
Signed-off-by: Aurelien Bouteiller <bouteill@icl.utk.edu>
1 parent 9bcf213 commit 3797220

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

ompi/mca/mtl/ofi/mtl_ofi.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
* Copyright (c) 2018-2020 Amazon.com, Inc. or its affiliates. All rights
88
* reserved.
99
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
10+
* Copyright (c) 2021 The University of Tennessee and The University
11+
* of Tennessee Research Foundation. All rights
12+
* reserved.
1013
* $COPYRIGHT$
1114
*
1215
* Additional copyrights may follow
@@ -1214,7 +1217,7 @@ ompi_mtl_ofi_iprobe_generic(struct mca_mtl_base_module_t *mtl,
12141217
*flag = ofi_req.match_state;
12151218
if (1 == *flag) {
12161219
if (MPI_STATUS_IGNORE != status) {
1217-
*status = ofi_req.status;
1220+
OMPI_COPY_STATUS(status, ofi_req.status, false);
12181221
}
12191222
}
12201223

@@ -1306,7 +1309,7 @@ ompi_mtl_ofi_improbe_generic(struct mca_mtl_base_module_t *mtl,
13061309
*matched = ofi_req->match_state;
13071310
if (1 == *matched) {
13081311
if (MPI_STATUS_IGNORE != status) {
1309-
*status = ofi_req->status;
1312+
OMPI_COPY_STATUS(status, ofi_req->status, false);
13101313
}
13111314

13121315
(*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)