Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 4465687

Browse files
bosilcajsquyres
authored andcommitted
Fix issue identified by Lisandro Dalcin regarding the lack
of support for NULL value in MPI_Type_set_attr. Provides a fix for issue open-ompi/ompi#1359. (cherry picked from commit open-mpi/ompi@56425a5)
1 parent b763687 commit 4465687

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

ompi/mpi/c/type_set_attr.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
33
* University Research and Technology
44
* Corporation. All rights reserved.
5-
* Copyright (c) 2004-2005 The University of Tennessee and The University
5+
* Copyright (c) 2004-2016 The University of Tennessee and The University
66
* of Tennessee Research Foundation. All rights
77
* reserved.
88
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
@@ -48,14 +48,12 @@ int MPI_Type_set_attr (MPI_Datatype type,
4848
memchecker_datatype(type);
4949
);
5050

51-
if (MPI_PARAM_CHECK) {
52-
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
53-
if (NULL == type || MPI_DATATYPE_NULL == type) {
54-
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME);
55-
} else if (NULL == attribute_val) {
56-
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
51+
if (MPI_PARAM_CHECK) {
52+
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
53+
if (NULL == type || MPI_DATATYPE_NULL == type) {
54+
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME);
55+
}
5756
}
58-
}
5957

6058
ret = ompi_attr_set_c(TYPE_ATTR, type, &type->d_keyhash,
6159
type_keyval, attribute_val, false);

0 commit comments

Comments
 (0)