@@ -41,6 +41,8 @@ static const char FUNC_NAME[] = "MPI_Type_dup";
41
41
int MPI_Type_dup (MPI_Datatype type ,
42
42
MPI_Datatype * newtype )
43
43
{
44
+ int ret ;
45
+
44
46
MEMCHECKER (
45
47
memchecker_datatype (type );
46
48
);
@@ -54,10 +56,9 @@ int MPI_Type_dup (MPI_Datatype type,
54
56
}
55
57
}
56
58
57
- if (OMPI_SUCCESS != ompi_datatype_duplicate ( type , newtype )) {
59
+ if (OMPI_SUCCESS != ( ret = ompi_datatype_duplicate ( type , newtype ) )) {
58
60
ompi_datatype_destroy ( newtype );
59
- OMPI_ERRHANDLER_RETURN (MPI_ERR_INTERN , MPI_COMM_WORLD ,
60
- MPI_ERR_INTERN , FUNC_NAME );
61
+ OMPI_ERRHANDLER_NOHANDLE_RETURN ( ret , ret , FUNC_NAME );
61
62
}
62
63
63
64
ompi_datatype_set_args ( * newtype , 0 , NULL , 0 , NULL , 1 , & type , MPI_COMBINER_DUP );
@@ -69,13 +70,12 @@ int MPI_Type_dup (MPI_Datatype type,
69
70
copy attributes. Really. */
70
71
if (NULL != type -> d_keyhash ) {
71
72
ompi_attr_hash_init (& (* newtype )-> d_keyhash );
72
- if (OMPI_SUCCESS != ompi_attr_copy_all (TYPE_ATTR ,
73
- type , * newtype ,
74
- type -> d_keyhash ,
75
- (* newtype )-> d_keyhash )) {
73
+ if (OMPI_SUCCESS != ( ret = ompi_attr_copy_all (TYPE_ATTR ,
74
+ type , * newtype ,
75
+ type -> d_keyhash ,
76
+ (* newtype )-> d_keyhash ) )) {
76
77
ompi_datatype_destroy (newtype );
77
- OMPI_ERRHANDLER_NOHANDLE_RETURN ( MPI_ERR_INTERN ,
78
- MPI_ERR_INTERN , FUNC_NAME );
78
+ OMPI_ERRHANDLER_NOHANDLE_RETURN ( ret , ret , FUNC_NAME );
79
79
}
80
80
}
81
81
0 commit comments