16
16
* reserved.
17
17
* Copyright (c) 2015 Research Organization for Information Science
18
18
* and Technology (RIST). All rights reserved.
19
+ * Copyright (c) 2017 IBM Corporation. All rights reserved.
19
20
* $COPYRIGHT$
20
21
*
21
22
* Additional copyrights may follow
@@ -45,6 +46,7 @@ static const char FUNC_NAME[] = "MPI_Type_create_f90_complex";
45
46
int MPI_Type_create_f90_complex (int p , int r , MPI_Datatype * newtype )
46
47
{
47
48
uint64_t key ;
49
+ int p_key , r_key ;
48
50
49
51
OPAL_CR_NOOP_PROGRESS ();
50
52
@@ -64,8 +66,10 @@ int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype)
64
66
/* if the user does not care about p or r set them to 0 so the
65
67
* test associate with them will always succeed.
66
68
*/
67
- if ( MPI_UNDEFINED == p ) p = 0 ;
68
- if ( MPI_UNDEFINED == r ) r = 0 ;
69
+ p_key = p ;
70
+ r_key = r ;
71
+ if ( MPI_UNDEFINED == p ) p_key = 0 ;
72
+ if ( MPI_UNDEFINED == r ) r_key = 0 ;
69
73
70
74
/**
71
75
* With respect to the MPI standard, MPI-2.0 Sect. 10.2.5, MPI_TYPE_CREATE_F90_xxxx,
@@ -86,7 +90,7 @@ int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype)
86
90
const int * a_i [2 ];
87
91
int rc ;
88
92
89
- key = (((uint64_t )p ) << 32 ) | ((uint64_t )r );
93
+ key = (((uint64_t )p_key ) << 32 ) | ((uint64_t )r_key );
90
94
if ( OPAL_SUCCESS == opal_hash_table_get_value_uint64 ( & ompi_mpi_f90_complex_hashtable ,
91
95
key , (void * * )newtype ) ) {
92
96
return MPI_SUCCESS ;
@@ -106,8 +110,8 @@ int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype)
106
110
snprintf (datatype -> name , MPI_MAX_OBJECT_NAME , "COMBINER %s" ,
107
111
(* newtype )-> name );
108
112
109
- a_i [0 ] = & r ;
110
- a_i [1 ] = & p ;
113
+ a_i [0 ] = & p ;
114
+ a_i [1 ] = & r ;
111
115
ompi_datatype_set_args ( datatype , 2 , a_i , 0 , NULL , 0 , NULL , MPI_COMBINER_F90_COMPLEX );
112
116
113
117
rc = opal_hash_table_set_value_uint64 ( & ompi_mpi_f90_complex_hashtable , key , datatype );
0 commit comments