diff --git a/ompi/mpi/c/type_create_f90_complex.c b/ompi/mpi/c/type_create_f90_complex.c index 133e783711f..91a1d08f33d 100644 --- a/ompi/mpi/c/type_create_f90_complex.c +++ b/ompi/mpi/c/type_create_f90_complex.c @@ -16,6 +16,7 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,6 +46,7 @@ static const char FUNC_NAME[] = "MPI_Type_create_f90_complex"; int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype) { uint64_t key; + int p_key, r_key; OPAL_CR_NOOP_PROGRESS(); @@ -64,8 +66,10 @@ int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype) /* if the user does not care about p or r set them to 0 so the * test associate with them will always succeed. */ - if( MPI_UNDEFINED == p ) p = 0; - if( MPI_UNDEFINED == r ) r = 0; + p_key = p; + r_key = r; + if( MPI_UNDEFINED == p ) p_key = 0; + if( MPI_UNDEFINED == r ) r_key = 0; /** * 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) const int* a_i[2]; int rc; - key = (((uint64_t)p) << 32) | ((uint64_t)r); + key = (((uint64_t)p_key) << 32) | ((uint64_t)r_key); if( OPAL_SUCCESS == opal_hash_table_get_value_uint64( &ompi_mpi_f90_complex_hashtable, key, (void**)newtype ) ) { return MPI_SUCCESS; @@ -106,8 +110,8 @@ int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype) snprintf(datatype->name, MPI_MAX_OBJECT_NAME, "COMBINER %s", (*newtype)->name); - a_i[0] = &r; - a_i[1] = &p; + a_i[0] = &p; + a_i[1] = &r; ompi_datatype_set_args( datatype, 2, a_i, 0, NULL, 0, NULL, MPI_COMBINER_F90_COMPLEX ); rc = opal_hash_table_set_value_uint64( &ompi_mpi_f90_complex_hashtable, key, datatype ); diff --git a/ompi/mpi/c/type_create_f90_real.c b/ompi/mpi/c/type_create_f90_real.c index a2144a619a2..1825f625abd 100644 --- a/ompi/mpi/c/type_create_f90_real.c +++ b/ompi/mpi/c/type_create_f90_real.c @@ -16,6 +16,7 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,6 +46,7 @@ static const char FUNC_NAME[] = "MPI_Type_create_f90_real"; int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype) { uint64_t key; + int p_key, r_key; OPAL_CR_NOOP_PROGRESS(); @@ -64,8 +66,10 @@ int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype) /* if the user does not care about p or r set them to 0 so the * test associate with them will always succeed. */ - if( MPI_UNDEFINED == p ) p = 0; - if( MPI_UNDEFINED == r ) r = 0; + p_key = p; + r_key = r; + if( MPI_UNDEFINED == p ) p_key = 0; + if( MPI_UNDEFINED == r ) r_key = 0; /** * With respect to the MPI standard, MPI-2.0 Sect. 10.2.5, MPI_TYPE_CREATE_F90_xxxx, @@ -83,10 +87,10 @@ int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype) if( *newtype != &ompi_mpi_datatype_null.dt ) { ompi_datatype_t* datatype; - const int* a_i[2] = {&r, &p}; + const int* a_i[2] = {&p, &r}; int rc; - key = (((uint64_t)p) << 32) | ((uint64_t)r); + key = (((uint64_t)p_key) << 32) | ((uint64_t)r_key); if( OPAL_SUCCESS == opal_hash_table_get_value_uint64( &ompi_mpi_f90_real_hashtable, key, (void**)newtype ) ) { return MPI_SUCCESS;