1616 * reserved.
1717 * Copyright (c) 2015 Research Organization for Information Science
1818 * and Technology (RIST). All rights reserved.
19+ * Copyright (c) 2017 IBM Corporation. All rights reserved.
1920 * $COPYRIGHT$
2021 *
2122 * Additional copyrights may follow
@@ -45,6 +46,7 @@ static const char FUNC_NAME[] = "MPI_Type_create_f90_complex";
4546int MPI_Type_create_f90_complex (int p , int r , MPI_Datatype * newtype )
4647{
4748 uint64_t key ;
49+ int p_key , r_key ;
4850
4951 OPAL_CR_NOOP_PROGRESS ();
5052
@@ -64,8 +66,10 @@ int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype)
6466 /* if the user does not care about p or r set them to 0 so the
6567 * test associate with them will always succeed.
6668 */
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 ;
6973
7074 /**
7175 * 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)
8690 const int * a_i [2 ];
8791 int rc ;
8892
89- key = (((uint64_t )p ) << 32 ) | ((uint64_t )r );
93+ key = (((uint64_t )p_key ) << 32 ) | ((uint64_t )r_key );
9094 if ( OPAL_SUCCESS == opal_hash_table_get_value_uint64 ( & ompi_mpi_f90_complex_hashtable ,
9195 key , (void * * )newtype ) ) {
9296 return MPI_SUCCESS ;
@@ -106,8 +110,8 @@ int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype)
106110 snprintf (datatype -> name , MPI_MAX_OBJECT_NAME , "COMBINER %s" ,
107111 (* newtype )-> name );
108112
109- a_i [0 ] = & r ;
110- a_i [1 ] = & p ;
113+ a_i [0 ] = & p ;
114+ a_i [1 ] = & r ;
111115 ompi_datatype_set_args ( datatype , 2 , a_i , 0 , NULL , 0 , NULL , MPI_COMBINER_F90_COMPLEX );
112116
113117 rc = opal_hash_table_set_value_uint64 ( & ompi_mpi_f90_complex_hashtable , key , datatype );
0 commit comments