Author: buntinas Date: 2012-12-15 15:49:05 -0600 (Sat, 15 Dec 2012) New Revision: 10769 Modified: mpich2/trunk/src/include/mpi.h.in mpich2/trunk/src/include/mpiimpl.h mpich2/trunk/src/mpi/info/infoutil.c mpich2/trunk/src/mpi/init/finalize.c mpich2/trunk/src/mpi/init/initthread.c Log: Fixed definition of builtin info object MPI_INFO_ENV to be consistent with other builtin objects. Fixes #1762. Reviewd by Balaji Modified: mpich2/trunk/src/include/mpi.h.in =================================================================== --- mpich2/trunk/src/include/mpi.h.in 2012-12-13 17:01:36 UTC (rev 10768) +++ mpich2/trunk/src/include/mpi.h.in 2012-12-15 21:49:05 UTC (rev 10769) @@ -484,11 +484,10 @@ /* for info */ typedef int MPI_Info; #define MPI_INFO_NULL ((MPI_Info)0x1c000000) +#define MPI_INFO_ENV ((MPI_Info)0x5c000001) #define MPI_MAX_INFO_KEY 255 #define MPI_MAX_INFO_VAL 1024 -extern MPI_Info MPI_INFO_ENV; - /* for subarray and darray constructors */ #define MPI_ORDER_C 56 #define MPI_ORDER_FORTRAN 57 Modified: mpich2/trunk/src/include/mpiimpl.h =================================================================== --- mpich2/trunk/src/include/mpiimpl.h 2012-12-13 17:01:36 UTC (rev 10768) +++ mpich2/trunk/src/include/mpiimpl.h 2012-12-15 21:49:05 UTC (rev 10769) @@ -417,7 +417,7 @@ #define MPID_File_get_ptr(a,ptr) MPID_Get_ptr(File,a,ptr) #define MPID_Errhandler_get_ptr(a,ptr) MPID_Getb_ptr(Errhandler,a,0x3,ptr) #define MPID_Op_get_ptr(a,ptr) MPID_Getb_ptr(Op,a,0x000000ff,ptr) -#define MPID_Info_get_ptr(a,ptr) MPID_Get_ptr(Info,a,ptr) +#define MPID_Info_get_ptr(a,ptr) MPID_Getb_ptr(Info,a,0x03ffffff,ptr) #define MPID_Win_get_ptr(a,ptr) MPID_Get_ptr(Win,a,ptr) #define MPID_Request_get_ptr(a,ptr) MPID_Get_ptr(Request,a,ptr) #define MPID_Grequest_class_get_ptr(a,ptr) MPID_Get_ptr(Grequest_class,a,ptr) @@ -584,6 +584,8 @@ } MPID_Info; extern MPIU_Object_alloc_t MPID_Info_mem; /* Preallocated info objects */ +#define MPID_INFO_N_BUILTIN 2 +extern MPID_Info MPID_Info_builtin[MPID_INFO_N_BUILTIN]; extern MPID_Info MPID_Info_direct[]; /* ------------------------------------------------------------------------- */ Modified: mpich2/trunk/src/mpi/info/infoutil.c =================================================================== --- mpich2/trunk/src/mpi/info/infoutil.c 2012-12-13 17:01:36 UTC (rev 10768) +++ mpich2/trunk/src/mpi/info/infoutil.c 2012-12-15 21:49:05 UTC (rev 10769) @@ -15,6 +15,7 @@ #endif /* Preallocated info objects */ +MPID_Info MPID_Info_builtin[MPID_INFO_N_BUILTIN] = { { 0 } }; MPID_Info MPID_Info_direct[MPID_INFO_PREALLOC] = { { 0 } }; MPIU_Object_alloc_t MPID_Info_mem = { 0, 0, 0, 0, MPID_INFO, sizeof(MPID_Info), MPID_Info_direct, Modified: mpich2/trunk/src/mpi/init/finalize.c =================================================================== --- mpich2/trunk/src/mpi/init/finalize.c 2012-12-13 17:01:36 UTC (rev 10768) +++ mpich2/trunk/src/mpi/init/finalize.c 2012-12-15 21:49:05 UTC (rev 10769) @@ -6,7 +6,6 @@ /* style: allow:fprintf:1 sig:0 */ #include "mpiimpl.h" -#include "mpiinfo.h" #include "mpi_init.h" /* -- Begin Profiling Symbol Block for routine MPI_Finalize */ @@ -116,7 +115,6 @@ { static const char FCNAME[] = "MPI_Finalize"; int mpi_errno = MPI_SUCCESS; - MPID_Info *info_ptr; #if defined(HAVE_USLEEP) && defined(USE_COVERAGE) int rank=0; #endif @@ -215,10 +213,6 @@ MPIU_ERR_POP(mpi_errno); } - MPID_Info_get_ptr(MPI_INFO_ENV, info_ptr); - MPIU_Info_free(info_ptr); - MPI_INFO_ENV = MPI_INFO_NULL; - /* Call the low-priority (post Finalize) callbacks */ MPIR_Call_finalize_callbacks( 0, MPIR_FINALIZE_CALLBACK_PRIO-1 ); Modified: mpich2/trunk/src/mpi/init/initthread.c =================================================================== --- mpich2/trunk/src/mpi/init/initthread.c 2012-12-13 17:01:36 UTC (rev 10768) +++ mpich2/trunk/src/mpi/init/initthread.c 2012-12-15 21:49:05 UTC (rev 10769) @@ -58,8 +58,6 @@ how MPICH was configured. */ extern const char MPIR_Version_device[]; -MPI_Info MPI_INFO_ENV = MPI_INFO_NULL; - /* Make sure the Fortran symbols are initialized unless it will cause problems for C programs linked with the C compilers (i.e., not using the compilation scripts). These provide the declarations for the initialization @@ -419,12 +417,17 @@ MPIU_THREAD_CS_ENTER(INIT,required); exit_init_cs_on_failure = 1; - mpi_errno = MPIU_Info_alloc(&info_ptr); - if (mpi_errno) - goto fn_fail; - - MPI_INFO_ENV = info_ptr->handle; - + /* create MPI_INFO_NULL object */ + /* FIXME: Currently this info object is empty, we need to add data to this + as defined by the standard. */ + info_ptr = MPID_Info_builtin + 1; + info_ptr->handle = MPI_INFO_ENV; + MPIU_Object_set_ref(info_ptr, 1); + MPIU_THREAD_MPI_OBJ_INIT(info_ptr); + info_ptr->next = NULL; + info_ptr->key = NULL; + info_ptr->value = NULL; + mpi_errno = MPID_Init(argc, argv, required, &thread_provided, &has_args, &has_env); if (mpi_errno) MPIU_ERR_POP(mpi_errno);
participants (1)
-
buntinas@mcs.anl.gov