HYD_status HYDT_topo_init(char *user_topolib, char *user_binding, char *user_mapping, char *user_membind) { const char *topolib = NULL, *binding = NULL, *mapping = NULL, *membind = NULL; HYD_status status = HYD_SUCCESS; HYDU_FUNC_ENTER(); if (user_topolib) HYDT_topo_info.topolib = MPL_strdup(user_topolib); else if (MPL_env2str("HYDRA_TOPOLIB", &topolib)) HYDT_topo_info.topolib = MPL_strdup(topolib); else if (HYDRA_DEFAULT_TOPOLIB) HYDT_topo_info.topolib = MPL_strdup(HYDRA_DEFAULT_TOPOLIB); else HYDT_topo_info.topolib = NULL; if (user_binding) binding = user_binding; else if (MPL_env2str("HYDRA_BINDING", &binding) == 0) binding = NULL; if (user_mapping) mapping = user_mapping; else if (MPL_env2str("HYDRA_MAPPING", &mapping) == 0) mapping = NULL; if (user_membind) membind = user_membind; else if (MPL_env2str("HYDRA_MEMBIND", &membind) == 0) membind = NULL; if (MPL_env2bool("HYDRA_TOPO_DEBUG", &HYDT_topo_info.debug) == 0) HYDT_topo_info.debug = 0; if (!binding || !strcmp(binding, "none")) { ignore_binding = 1; goto fn_exit; } /* Initialize the topology library requested by the user */ #if defined HAVE_HWLOC if (!strcmp(HYDT_topo_info.topolib, "hwloc")) { status = HYDT_topo_hwloc_init(binding, mapping, membind); HYDU_ERR_POP(status, "unable to initialize hwloc\n"); } #endif /* HAVE_HWLOC */ fn_exit: HYDU_FUNC_EXIT(); return status; fn_fail: goto fn_exit; }
HYD_status HYDT_bsci_launcher_ssh_init(void) { int rc; HYDT_bsci_fns.query_env_inherit = HYDT_bscd_ssh_query_env_inherit; HYDT_bsci_fns.launch_procs = HYDT_bscd_common_launch_procs; HYDT_bsci_fns.launcher_finalize = HYDT_bscd_ssh_launcher_finalize; rc = MPL_env2int("HYDRA_LAUNCHER_SSH_LIMIT", &HYDT_bscd_ssh_limit); if (rc == 0) HYDT_bscd_ssh_limit = HYDRA_LAUNCHER_SSH_DEFAULT_LIMIT; rc = MPL_env2int("HYDRA_LAUNCHER_SSH_LIMIT_TIME", &HYDT_bscd_ssh_limit_time); if (rc == 0) HYDT_bscd_ssh_limit_time = HYDRA_LAUNCHER_SSH_DEFAULT_LIMIT_TIME; rc = MPL_env2bool("HYDRA_LAUNCHER_SSH_ENABLE_WARNINGS", &HYDT_bscd_ssh_warnings); if (rc == 0) HYDT_bscd_ssh_warnings = 1; return HYD_SUCCESS; }
/*@ MPI_Init_thread - Initialize the MPI execution environment Input Parameters: + argc - Pointer to the number of arguments . argv - Pointer to the argument vector - required - Level of desired thread support Output Parameter: . provided - Level of provided thread support Command line arguments: MPI specifies no command-line arguments but does allow an MPI implementation to make use of them. See 'MPI_INIT' for a description of the command line arguments supported by 'MPI_INIT' and 'MPI_INIT_THREAD'. Notes: The valid values for the level of thread support are\: + MPI_THREAD_SINGLE - Only one thread will execute. . MPI_THREAD_FUNNELED - The process may be multi-threaded, but only the main thread will make MPI calls (all MPI calls are funneled to the main thread). . MPI_THREAD_SERIALIZED - The process may be multi-threaded, and multiple threads may make MPI calls, but only one at a time: MPI calls are not made concurrently from two distinct threads (all MPI calls are serialized). - MPI_THREAD_MULTIPLE - Multiple threads may call MPI, with no restrictions. Notes for Fortran: Note that the Fortran binding for this routine does not have the 'argc' and 'argv' arguments. ('MPI_INIT_THREAD(required, provided, ierror)') .N Errors .N MPI_SUCCESS .N MPI_ERR_OTHER .seealso: MPI_Init, MPI_Finalize @*/ int MPI_Init_thread( int *argc, char ***argv, int required, int *provided ) { int mpi_errno = MPI_SUCCESS; int rc, reqd = required; MPID_MPI_INIT_STATE_DECL(MPID_STATE_MPI_INIT_THREAD); rc = MPID_Wtime_init(); #ifdef USE_DBG_LOGGING MPIU_DBG_PreInit( argc, argv, rc ); #endif MPID_MPI_INIT_FUNC_ENTER(MPID_STATE_MPI_INIT_THREAD); #if defined(_OSU_MVAPICH_) || defined(_OSU_PSM_) MV2_Read_env_vars(); #endif /* defined(_OSU_MVAPICH_) || defined(_OSU_PSM_) */ # ifdef HAVE_ERROR_CHECKING { MPID_BEGIN_ERROR_CHECKS; { if (MPIR_Process.initialized != MPICH_PRE_INIT) { mpi_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, "MPI_Init_thread", __LINE__, MPI_ERR_OTHER, "**inittwice", 0 ); } if (mpi_errno != MPI_SUCCESS) goto fn_fail; } MPID_END_ERROR_CHECKS; } # endif /* HAVE_ERROR_CHECKING */ /* ... body of routine ... */ /* If the user requested for asynchronous progress, request for * THREAD_MULTIPLE. */ rc = 0; MPL_env2bool("MPICH_ASYNC_PROGRESS", &rc); if (rc) reqd = MPI_THREAD_MULTIPLE; mpi_errno = MPIR_Init_thread( argc, argv, reqd, provided ); if (mpi_errno != MPI_SUCCESS) goto fn_fail; if (rc && *provided == MPI_THREAD_MULTIPLE) { mpi_errno = MPIR_Init_async_thread(); if (mpi_errno) goto fn_fail; MPIR_async_thread_initialized = 1; } /* ... end of body of routine ... */ MPID_MPI_INIT_FUNC_EXIT(MPID_STATE_MPI_INIT_THREAD); return mpi_errno; fn_fail: /* --BEGIN ERROR HANDLING-- */ # ifdef HAVE_ERROR_REPORTING { mpi_errno = MPIR_Err_create_code( mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpi_init_thread", "**mpi_init_thread %p %p %d %p", argc, argv, required, provided); } # endif mpi_errno = MPIR_Err_return_comm( 0, FCNAME, mpi_errno ); MPID_MPI_INIT_FUNC_EXIT(MPID_STATE_MPI_INIT_THREAD); MPIU_THREAD_CS_EXIT(INIT,*provided); return mpi_errno; /* --END ERROR HANDLING-- */ }
int MPIR_Param_init_params(void) { int mpi_errno = MPI_SUCCESS; int rc; rc = MPL_env2int("MPICH_ALLTOALL_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLTOALL_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLTOALL_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLTOALL_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLTOALL_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLTOALL_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLTOALL_MEDIUM_MSG_SIZE", &(MPIR_PARAM_ALLTOALL_MEDIUM_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLTOALL_MEDIUM_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLTOALL_MEDIUM_MSG_SIZE", &(MPIR_PARAM_ALLTOALL_MEDIUM_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLTOALL_MEDIUM_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLTOALL_THROTTLE", &(MPIR_PARAM_ALLTOALL_THROTTLE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLTOALL_THROTTLE"); rc = MPL_env2int("MPIR_PARAM_ALLTOALL_THROTTLE", &(MPIR_PARAM_ALLTOALL_THROTTLE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLTOALL_THROTTLE"); rc = MPL_env2int("MPICH_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE", &(MPIR_PARAM_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE", &(MPIR_PARAM_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE"); rc = MPL_env2int("MPICH_BCAST_MIN_PROCS", &(MPIR_PARAM_BCAST_MIN_PROCS)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_BCAST_MIN_PROCS"); rc = MPL_env2int("MPIR_PARAM_BCAST_MIN_PROCS", &(MPIR_PARAM_BCAST_MIN_PROCS)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_BCAST_MIN_PROCS"); rc = MPL_env2int("MPICH_BCAST_SHORT_MSG_SIZE", &(MPIR_PARAM_BCAST_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_BCAST_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_BCAST_SHORT_MSG_SIZE", &(MPIR_PARAM_BCAST_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_BCAST_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_BCAST_LONG_MSG_SIZE", &(MPIR_PARAM_BCAST_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_BCAST_LONG_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_BCAST_LONG_MSG_SIZE", &(MPIR_PARAM_BCAST_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_BCAST_LONG_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLGATHER_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLGATHER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLGATHER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLGATHER_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLGATHER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLGATHER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLGATHER_LONG_MSG_SIZE", &(MPIR_PARAM_ALLGATHER_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLGATHER_LONG_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLGATHER_LONG_MSG_SIZE", &(MPIR_PARAM_ALLGATHER_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLGATHER_LONG_MSG_SIZE"); rc = MPL_env2int("MPICH_REDUCE_SHORT_MSG_SIZE", &(MPIR_PARAM_REDUCE_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_REDUCE_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_REDUCE_SHORT_MSG_SIZE", &(MPIR_PARAM_REDUCE_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_REDUCE_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLREDUCE_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLREDUCE_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLREDUCE_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLREDUCE_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLREDUCE_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLREDUCE_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_GATHER_VSMALL_MSG_SIZE", &(MPIR_PARAM_GATHER_VSMALL_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_GATHER_VSMALL_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_GATHER_VSMALL_MSG_SIZE", &(MPIR_PARAM_GATHER_VSMALL_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_GATHER_VSMALL_MSG_SIZE"); rc = MPL_env2int("MPICH_GATHER_INTER_SHORT_MSG_SIZE", &(MPIR_PARAM_GATHER_INTER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_GATHER_INTER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_GATHER_INTER_SHORT_MSG_SIZE", &(MPIR_PARAM_GATHER_INTER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_GATHER_INTER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH2_GATHERV_MIN_PROCS", &(MPIR_PARAM_GATHERV_INTER_SSEND_MIN_PROCS)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH2_GATHERV_MIN_PROCS"); rc = MPL_env2int("MPICH_GATHERV_INTER_SSEND_MIN_PROCS", &(MPIR_PARAM_GATHERV_INTER_SSEND_MIN_PROCS)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_GATHERV_INTER_SSEND_MIN_PROCS"); rc = MPL_env2int("MPIR_PARAM_GATHERV_INTER_SSEND_MIN_PROCS", &(MPIR_PARAM_GATHERV_INTER_SSEND_MIN_PROCS)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_GATHERV_INTER_SSEND_MIN_PROCS"); rc = MPL_env2int("MPICH_SCATTER_INTER_SHORT_MSG_SIZE", &(MPIR_PARAM_SCATTER_INTER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_SCATTER_INTER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_SCATTER_INTER_SHORT_MSG_SIZE", &(MPIR_PARAM_SCATTER_INTER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_SCATTER_INTER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLGATHERV_PIPELINE_MSG_SIZE", &(MPIR_PARAM_ALLGATHERV_PIPELINE_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLGATHERV_PIPELINE_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLGATHERV_PIPELINE_MSG_SIZE", &(MPIR_PARAM_ALLGATHERV_PIPELINE_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLGATHERV_PIPELINE_MSG_SIZE"); rc = MPL_env2bool("MPICH_COMM_SPLIT_USE_QSORT", &(MPIR_PARAM_COMM_SPLIT_USE_QSORT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_COMM_SPLIT_USE_QSORT"); rc = MPL_env2bool("MPIR_PARAM_COMM_SPLIT_USE_QSORT", &(MPIR_PARAM_COMM_SPLIT_USE_QSORT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_COMM_SPLIT_USE_QSORT"); rc = MPL_env2bool("MPICH_NO_LOCAL", &(MPIR_PARAM_NOLOCAL)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_NO_LOCAL"); rc = MPL_env2bool("MPIR_PARAM_NO_LOCAL", &(MPIR_PARAM_NOLOCAL)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_NO_LOCAL"); rc = MPL_env2bool("MPICH_NOLOCAL", &(MPIR_PARAM_NOLOCAL)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_NOLOCAL"); rc = MPL_env2bool("MPIR_PARAM_NOLOCAL", &(MPIR_PARAM_NOLOCAL)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_NOLOCAL"); rc = MPL_env2bool("MPICH_EVEN_ODD_CLIQUES", &(MPIR_PARAM_ODD_EVEN_CLIQUES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_EVEN_ODD_CLIQUES"); rc = MPL_env2bool("MPIR_PARAM_EVEN_ODD_CLIQUES", &(MPIR_PARAM_ODD_EVEN_CLIQUES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_EVEN_ODD_CLIQUES"); rc = MPL_env2bool("MPICH_ODD_EVEN_CLIQUES", &(MPIR_PARAM_ODD_EVEN_CLIQUES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ODD_EVEN_CLIQUES"); rc = MPL_env2bool("MPIR_PARAM_ODD_EVEN_CLIQUES", &(MPIR_PARAM_ODD_EVEN_CLIQUES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ODD_EVEN_CLIQUES"); rc = MPL_env2bool("MPICH_MEMDUMP", &(MPIR_PARAM_MEMDUMP)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_MEMDUMP"); rc = MPL_env2bool("MPIR_PARAM_MEMDUMP", &(MPIR_PARAM_MEMDUMP)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_MEMDUMP"); rc = MPL_env2int("MPICH_PROCTABLE_SIZE", &(MPIR_PARAM_PROCTABLE_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_PROCTABLE_SIZE"); rc = MPL_env2int("MPIR_PARAM_PROCTABLE_SIZE", &(MPIR_PARAM_PROCTABLE_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_PROCTABLE_SIZE"); rc = MPL_env2bool("MPICH_PROCTABLE_PRINT", &(MPIR_PARAM_PROCTABLE_PRINT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_PROCTABLE_PRINT"); rc = MPL_env2bool("MPIR_PARAM_PROCTABLE_PRINT", &(MPIR_PARAM_PROCTABLE_PRINT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_PROCTABLE_PRINT"); rc = MPL_env2bool("MPICH_PRINT_ERROR_STACK", &(MPIR_PARAM_PRINT_ERROR_STACK)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_PRINT_ERROR_STACK"); rc = MPL_env2bool("MPIR_PARAM_PRINT_ERROR_STACK", &(MPIR_PARAM_PRINT_ERROR_STACK)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_PRINT_ERROR_STACK"); rc = MPL_env2int("MPICH_CHOP_ERROR_STACK", &(MPIR_PARAM_CHOP_ERROR_STACK)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_CHOP_ERROR_STACK"); rc = MPL_env2int("MPIR_PARAM_CHOP_ERROR_STACK", &(MPIR_PARAM_CHOP_ERROR_STACK)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_CHOP_ERROR_STACK"); rc = MPL_env2int("MPICH_NEM_LMT_DMA_THRESHOLD", &(MPIR_PARAM_NEM_LMT_DMA_THRESHOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_NEM_LMT_DMA_THRESHOLD"); rc = MPL_env2int("MPIR_PARAM_NEM_LMT_DMA_THRESHOLD", &(MPIR_PARAM_NEM_LMT_DMA_THRESHOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_NEM_LMT_DMA_THRESHOLD"); rc = MPL_env2str("MPICH_NEMESIS_NETMOD", &(MPIR_PARAM_NEMESIS_NETMOD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_NEMESIS_NETMOD"); rc = MPL_env2str("MPIR_PARAM_NEMESIS_NETMOD", &(MPIR_PARAM_NEMESIS_NETMOD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_NEMESIS_NETMOD"); rc = MPL_env2bool("MPICH_DEBUG_HOLD", &(MPIR_PARAM_DEBUG_HOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_DEBUG_HOLD"); rc = MPL_env2bool("MPIR_PARAM_DEBUG_HOLD", &(MPIR_PARAM_DEBUG_HOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_DEBUG_HOLD"); rc = MPL_env2bool("MPICH_ENABLE_CKPOINT", &(MPIR_PARAM_ENABLE_CKPOINT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ENABLE_CKPOINT"); rc = MPL_env2bool("MPIR_PARAM_ENABLE_CKPOINT", &(MPIR_PARAM_ENABLE_CKPOINT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ENABLE_CKPOINT"); rc = MPL_env2bool("MPICH_ENABLE_COLL_FT_RET", &(MPIR_PARAM_ENABLE_COLL_FT_RET)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ENABLE_COLL_FT_RET"); rc = MPL_env2bool("MPIR_PARAM_ENABLE_COLL_FT_RET", &(MPIR_PARAM_ENABLE_COLL_FT_RET)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ENABLE_COLL_FT_RET"); rc = MPL_env2bool("MPICH_ABORT_ON_LEAKED_HANDLES", &(MPIR_PARAM_ABORT_ON_LEAKED_HANDLES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ABORT_ON_LEAKED_HANDLES"); rc = MPL_env2bool("MPIR_PARAM_ABORT_ON_LEAKED_HANDLES", &(MPIR_PARAM_ABORT_ON_LEAKED_HANDLES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ABORT_ON_LEAKED_HANDLES"); rc = MPL_env2range("MPICH_PORTRANGE", &(MPIR_PARAM_PORT_RANGE.low), &(MPIR_PARAM_PORT_RANGE.high)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_PORTRANGE"); rc = MPL_env2range("MPIR_PARAM_PORTRANGE", &(MPIR_PARAM_PORT_RANGE.low), &(MPIR_PARAM_PORT_RANGE.high)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_PORTRANGE"); rc = MPL_env2range("MPICH_PORT_RANGE", &(MPIR_PARAM_PORT_RANGE.low), &(MPIR_PARAM_PORT_RANGE.high)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_PORT_RANGE"); rc = MPL_env2range("MPIR_PARAM_PORT_RANGE", &(MPIR_PARAM_PORT_RANGE.low), &(MPIR_PARAM_PORT_RANGE.high)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_PORT_RANGE"); fn_fail: return mpi_errno; }
int MPIDU_CH3U_GetSockInterfaceAddr( int myRank, char *ifname, int maxIfname, MPIDU_Sock_ifaddr_t *ifaddr ) { char *ifname_string; int mpi_errno = MPI_SUCCESS; int ifaddrFound = 0; if (dbg_ifname < 0) { int rc; rc = MPL_env2bool( "MPICH_DBG_IFNAME", &dbg_ifname ); if (rc != 1) dbg_ifname = 0; } /* Set "not found" for ifaddr */ ifaddr->len = 0; /* Check for the name supplied through an environment variable */ ifname_string = getenv("MPICH_INTERFACE_HOSTNAME"); if (!ifname_string) { /* See if there is a per-process name for the interfaces (e.g., the process manager only delievers the same values for the environment to each process */ char namebuf[1024]; MPL_snprintf( namebuf, sizeof(namebuf), "MPICH_INTERFACE_HOSTNAME_R%d", myRank ); ifname_string = getenv( namebuf ); if (dbg_ifname && ifname_string) { fprintf( stdout, "Found interface name %s from %s\n", ifname_string, namebuf ); fflush( stdout ); } } else if (dbg_ifname) { fprintf( stdout, "Found interface name %s from MPICH_INTERFACE_HOSTNAME\n", ifname_string ); fflush( stdout ); } if (!ifname_string) { int len; /* If we have nothing, then use the host name */ mpi_errno = MPID_Get_processor_name(ifname, maxIfname, &len ); if (mpi_errno) MPIR_ERR_POP(mpi_errno); ifname_string = ifname; /* If we didn't find a specific name, then try to get an IP address directly from the available interfaces, if that is supported on this platform. Otherwise, we'll drop into the next step that uses the ifname */ mpi_errno = MPIDI_CH3U_GetIPInterface( ifaddr, &ifaddrFound ); if (mpi_errno) MPIR_ERR_POP(mpi_errno); } else { /* Copy this name into the output name */ MPIU_Strncpy( ifname, ifname_string, maxIfname ); } /* If we don't have an IP address, try to get it from the name */ if (!ifaddrFound) { struct hostent *info; /* printf( "Name to check is %s\n", ifname_string ); fflush(stdout); */ info = gethostbyname( ifname_string ); if (info && info->h_addr_list) { /* Use the primary address */ ifaddr->len = info->h_length; ifaddr->type = info->h_addrtype; if (ifaddr->len > sizeof(ifaddr->ifaddr)) { /* If the address won't fit in the field, reset to no address */ ifaddr->len = 0; ifaddr->type = -1; } else { MPIU_Memcpy( ifaddr->ifaddr, info->h_addr_list[0], ifaddr->len ); } } } fn_exit: return mpi_errno; fn_fail: goto fn_exit; }
static int MPIDI_CH3U_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found ) { char *buf_ptr, *ptr; int buf_len, buf_len_prev; int fd; MPIDU_Sock_ifaddr_t myifaddr; int nfound = 0, foundLocalhost = 0; /* We predefine the LSB and MSB localhost addresses */ unsigned int localhost = 0x0100007f; #ifdef WORDS_BIGENDIAN unsigned int MSBlocalhost = 0x7f000001; #endif if (dbg_ifname < 0) { int rc; rc = MPL_env2bool( "MPICH_DBG_IFNAME", &dbg_ifname ); if (rc != 1) dbg_ifname = 0; } fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd < 0) { fprintf( stderr, "Unable to open an AF_INET socket\n" ); return 1; } /* Use MSB localhost if necessary */ #ifdef WORDS_BIGENDIAN localhost = MSBlocalhost; #endif /* * Obtain the interface information from the operating system * * Note: much of this code is borrowed from W. Richard Stevens' book * entitled "UNIX Network Programming", Volume 1, Second Edition. See * section 16.6 for details. */ buf_len = NUM_IFREQS * sizeof(struct ifreq); buf_len_prev = 0; for(;;) { struct ifconf ifconf; int rc; buf_ptr = (char *) MPIU_Malloc(buf_len); if (buf_ptr == NULL) { fprintf( stderr, "Unable to allocate %d bytes\n", buf_len ); return 1; } ifconf.ifc_buf = buf_ptr; ifconf.ifc_len = buf_len; rc = ioctl(fd, SIOCGIFCONF, &ifconf); if (rc < 0) { if (errno != EINVAL || buf_len_prev != 0) { fprintf( stderr, "Error from ioctl = %d\n", errno ); perror(" Error is: "); return 1; } } else { if (ifconf.ifc_len == buf_len_prev) { buf_len = ifconf.ifc_len; break; } buf_len_prev = ifconf.ifc_len; } MPIU_Free(buf_ptr); buf_len += NUM_IFREQS * sizeof(struct ifreq); } /* * Now that we've got the interface information, we need to run through * the interfaces and check out the ip addresses. If we find a * unique, non-lcoal host (127.0.0.1) address, return that, otherwise * return nothing. */ ptr = buf_ptr; while(ptr < buf_ptr + buf_len) { struct ifreq * ifreq; ifreq = (struct ifreq *) ptr; if (dbg_ifname) { fprintf( stdout, "%10s\t", ifreq->ifr_name ); fflush(stdout); } if (ifreq->ifr_addr.sa_family == AF_INET) { struct in_addr addr; addr = ((struct sockaddr_in *) &(ifreq->ifr_addr))->sin_addr; if (dbg_ifname) { fprintf( stdout, "IPv4 address = %08x (%s)\n", addr.s_addr, inet_ntoa( addr ) ); } if (addr.s_addr == localhost && dbg_ifname) { fprintf( stdout, "Found local host\n" ); } /* Save localhost if we find it. Let any new interface overwrite localhost. However, if we find more than one non-localhost interface, then we'll choose none for the interfaces */ if (addr.s_addr == localhost) { foundLocalhost = 1; if (nfound == 0) { myifaddr.type = AF_INET; myifaddr.len = 4; MPIU_Memcpy( myifaddr.ifaddr, &addr.s_addr, 4 ); } } else { nfound++; myifaddr.type = AF_INET; myifaddr.len = 4; MPIU_Memcpy( myifaddr.ifaddr, &addr.s_addr, 4 ); } } else { if (dbg_ifname) { fprintf( stdout, "\n" ); } } /* * Increment pointer to the next ifreq; some adjustment may be * required if the address is an IPv6 address */ /* This is needed for MAX OSX */ #ifdef _SIZEOF_ADDR_IFREQ ptr += _SIZEOF_ADDR_IFREQ(*ifreq); #else ptr += sizeof(struct ifreq); # if defined(AF_INET6) { if (ifreq->ifr_addr.sa_family == AF_INET6) { ptr += sizeof(struct sockaddr_in6) - sizeof(struct sockaddr); } } # endif #endif } MPIU_Free(buf_ptr); close(fd); /* If we found a unique address, use that */ if (nfound == 1 || (nfound == 0 && foundLocalhost == 1)) { *ifaddr = myifaddr; *found = 1; } else { *found = 0; } return 0; }
/*@ MPI_Init - Initialize the MPI execution environment Input Parameters: + argc - Pointer to the number of arguments - argv - Pointer to the argument vector Thread and Signal Safety: This routine must be called by one thread only. That thread is called the `main thread` and must be the thread that calls 'MPI_Finalize'. Notes: The MPI standard does not say what a program can do before an 'MPI_INIT' or after an 'MPI_FINALIZE'. In the MPICH implementation, you should do as little as possible. In particular, avoid anything that changes the external state of the program, such as opening files, reading standard input or writing to standard output. Notes for Fortran: The Fortran binding for 'MPI_Init' has only the error return .vb subroutine MPI_INIT( ierr ) integer ierr .ve .N Errors .N MPI_SUCCESS .N MPI_ERR_INIT .seealso: MPI_Init_thread, MPI_Finalize @*/ int MPI_Init( int *argc, char ***argv ) { static const char FCNAME[] = "MPI_Init"; int mpi_errno = MPI_SUCCESS; int rc; int threadLevel, provided; MPID_MPI_INIT_STATE_DECL(MPID_STATE_MPI_INIT); rc = MPID_Wtime_init(); #ifdef USE_DBG_LOGGING MPIU_DBG_PreInit( argc, argv, rc ); #endif MPID_MPI_INIT_FUNC_ENTER(MPID_STATE_MPI_INIT); # ifdef HAVE_ERROR_CHECKING { MPID_BEGIN_ERROR_CHECKS; { if (MPIR_Process.initialized != MPICH_PRE_INIT) { mpi_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**inittwice", NULL ); } if (mpi_errno) goto fn_fail; } MPID_END_ERROR_CHECKS; } # endif /* HAVE_ERROR_CHECKING */ /* ... body of routine ... */ #if (MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE) /* If we support all thread levels, allow the use of an environment variable to set the default thread level */ { const char *str = 0; threadLevel = MPI_THREAD_SINGLE; if (MPL_env2str( "MPICH_THREADLEVEL_DEFAULT", &str )) { if (strcmp(str,"MULTIPLE") == 0 || strcmp(str,"multiple") == 0) { threadLevel = MPI_THREAD_MULTIPLE; } else if (strcmp(str,"SERIALIZED") == 0 || strcmp(str,"serialized") == 0) { threadLevel = MPI_THREAD_SERIALIZED; } else if (strcmp(str,"FUNNELED") == 0 || strcmp(str,"funneled") == 0) { threadLevel = MPI_THREAD_FUNNELED; } else if (strcmp(str,"SINGLE") == 0 || strcmp(str,"single") == 0) { threadLevel = MPI_THREAD_SINGLE; } else { MPIU_Error_printf( "Unrecognized thread level %s\n", str ); exit(1); } } } #else threadLevel = MPI_THREAD_SINGLE; #endif /* If the user requested for asynchronous progress, request for * THREAD_MULTIPLE. */ rc = 0; MPL_env2bool("MPICH_ASYNC_PROGRESS", &rc); if (rc) threadLevel = MPI_THREAD_MULTIPLE; mpi_errno = MPIR_Init_thread( argc, argv, threadLevel, &provided ); if (mpi_errno != MPI_SUCCESS) goto fn_fail; if (rc && provided == MPI_THREAD_MULTIPLE) { mpi_errno = MPIR_Init_async_thread(); if (mpi_errno) goto fn_fail; MPIR_async_thread_initialized = 1; } /* ... end of body of routine ... */ MPID_MPI_INIT_FUNC_EXIT(MPID_STATE_MPI_INIT); return mpi_errno; fn_fail: /* --BEGIN ERROR HANDLING-- */ # ifdef HAVE_ERROR_REPORTING { mpi_errno = MPIR_Err_create_code( mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpi_init", "**mpi_init %p %p", argc, argv); } # endif mpi_errno = MPIR_Err_return_comm( 0, FCNAME, mpi_errno ); return mpi_errno; /* --END ERROR HANDLING-- */ }
int MPIR_Param_init_params(void) { int mpi_errno = MPI_SUCCESS; int rc; const char *tmp_str; static int initialized = FALSE; /* FIXME any MT issues here? */ if (initialized) return MPI_SUCCESS; initialized = TRUE; rc = MPL_env2int("MPICH_ALLTOALL_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLTOALL_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLTOALL_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLTOALL_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLTOALL_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLTOALL_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLTOALL_MEDIUM_MSG_SIZE", &(MPIR_PARAM_ALLTOALL_MEDIUM_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLTOALL_MEDIUM_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLTOALL_MEDIUM_MSG_SIZE", &(MPIR_PARAM_ALLTOALL_MEDIUM_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLTOALL_MEDIUM_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLTOALL_THROTTLE", &(MPIR_PARAM_ALLTOALL_THROTTLE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLTOALL_THROTTLE"); rc = MPL_env2int("MPIR_PARAM_ALLTOALL_THROTTLE", &(MPIR_PARAM_ALLTOALL_THROTTLE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLTOALL_THROTTLE"); rc = MPL_env2int("MPICH_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE", &(MPIR_PARAM_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE", &(MPIR_PARAM_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_REDSCAT_COMMUTATIVE_LONG_MSG_SIZE"); rc = MPL_env2int("MPICH_BCAST_MIN_PROCS", &(MPIR_PARAM_BCAST_MIN_PROCS)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_BCAST_MIN_PROCS"); rc = MPL_env2int("MPIR_PARAM_BCAST_MIN_PROCS", &(MPIR_PARAM_BCAST_MIN_PROCS)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_BCAST_MIN_PROCS"); rc = MPL_env2int("MPICH_BCAST_SHORT_MSG_SIZE", &(MPIR_PARAM_BCAST_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_BCAST_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_BCAST_SHORT_MSG_SIZE", &(MPIR_PARAM_BCAST_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_BCAST_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_BCAST_LONG_MSG_SIZE", &(MPIR_PARAM_BCAST_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_BCAST_LONG_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_BCAST_LONG_MSG_SIZE", &(MPIR_PARAM_BCAST_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_BCAST_LONG_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLGATHER_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLGATHER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLGATHER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLGATHER_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLGATHER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLGATHER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLGATHER_LONG_MSG_SIZE", &(MPIR_PARAM_ALLGATHER_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLGATHER_LONG_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLGATHER_LONG_MSG_SIZE", &(MPIR_PARAM_ALLGATHER_LONG_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLGATHER_LONG_MSG_SIZE"); rc = MPL_env2int("MPICH_REDUCE_SHORT_MSG_SIZE", &(MPIR_PARAM_REDUCE_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_REDUCE_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_REDUCE_SHORT_MSG_SIZE", &(MPIR_PARAM_REDUCE_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_REDUCE_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLREDUCE_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLREDUCE_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLREDUCE_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLREDUCE_SHORT_MSG_SIZE", &(MPIR_PARAM_ALLREDUCE_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLREDUCE_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_GATHER_VSMALL_MSG_SIZE", &(MPIR_PARAM_GATHER_VSMALL_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_GATHER_VSMALL_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_GATHER_VSMALL_MSG_SIZE", &(MPIR_PARAM_GATHER_VSMALL_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_GATHER_VSMALL_MSG_SIZE"); rc = MPL_env2int("MPICH_GATHER_INTER_SHORT_MSG_SIZE", &(MPIR_PARAM_GATHER_INTER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_GATHER_INTER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_GATHER_INTER_SHORT_MSG_SIZE", &(MPIR_PARAM_GATHER_INTER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_GATHER_INTER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_GATHERV_MIN_PROCS", &(MPIR_PARAM_GATHERV_INTER_SSEND_MIN_PROCS)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_GATHERV_MIN_PROCS"); rc = MPL_env2int("MPICH_GATHERV_INTER_SSEND_MIN_PROCS", &(MPIR_PARAM_GATHERV_INTER_SSEND_MIN_PROCS)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_GATHERV_INTER_SSEND_MIN_PROCS"); rc = MPL_env2int("MPIR_PARAM_GATHERV_INTER_SSEND_MIN_PROCS", &(MPIR_PARAM_GATHERV_INTER_SSEND_MIN_PROCS)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_GATHERV_INTER_SSEND_MIN_PROCS"); rc = MPL_env2int("MPICH_SCATTER_INTER_SHORT_MSG_SIZE", &(MPIR_PARAM_SCATTER_INTER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_SCATTER_INTER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_SCATTER_INTER_SHORT_MSG_SIZE", &(MPIR_PARAM_SCATTER_INTER_SHORT_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_SCATTER_INTER_SHORT_MSG_SIZE"); rc = MPL_env2int("MPICH_ALLGATHERV_PIPELINE_MSG_SIZE", &(MPIR_PARAM_ALLGATHERV_PIPELINE_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ALLGATHERV_PIPELINE_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_ALLGATHERV_PIPELINE_MSG_SIZE", &(MPIR_PARAM_ALLGATHERV_PIPELINE_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ALLGATHERV_PIPELINE_MSG_SIZE"); rc = MPL_env2bool("MPICH_COMM_SPLIT_USE_QSORT", &(MPIR_PARAM_COMM_SPLIT_USE_QSORT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_COMM_SPLIT_USE_QSORT"); rc = MPL_env2bool("MPIR_PARAM_COMM_SPLIT_USE_QSORT", &(MPIR_PARAM_COMM_SPLIT_USE_QSORT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_COMM_SPLIT_USE_QSORT"); rc = MPL_env2bool("MPICH_RMA_ACC_IMMED", &(MPIR_PARAM_RMA_ACC_IMMED)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_RMA_ACC_IMMED"); rc = MPL_env2bool("MPIR_PARAM_RMA_ACC_IMMED", &(MPIR_PARAM_RMA_ACC_IMMED)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_RMA_ACC_IMMED"); rc = MPL_env2int("MPICH_RMA_NREQUEST_THRESHOLD", &(MPIR_PARAM_RMA_NREQUEST_THRESHOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_RMA_NREQUEST_THRESHOLD"); rc = MPL_env2int("MPIR_PARAM_RMA_NREQUEST_THRESHOLD", &(MPIR_PARAM_RMA_NREQUEST_THRESHOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_RMA_NREQUEST_THRESHOLD"); rc = MPL_env2int("MPICH_RMA_NREQUEST_NEW_THRESHOLD", &(MPIR_PARAM_RMA_NREQUEST_NEW_THRESHOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_RMA_NREQUEST_NEW_THRESHOLD"); rc = MPL_env2int("MPIR_PARAM_RMA_NREQUEST_NEW_THRESHOLD", &(MPIR_PARAM_RMA_NREQUEST_NEW_THRESHOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_RMA_NREQUEST_NEW_THRESHOLD"); rc = MPL_env2bool("MPICH_RMA_LOCK_IMMED", &(MPIR_PARAM_RMA_LOCK_IMMED)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_RMA_LOCK_IMMED"); rc = MPL_env2bool("MPIR_PARAM_RMA_LOCK_IMMED", &(MPIR_PARAM_RMA_LOCK_IMMED)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_RMA_LOCK_IMMED"); rc = MPL_env2bool("MPICH_RMA_MERGE_LOCK_OP_UNLOCK", &(MPIR_PARAM_RMA_MERGE_LOCK_OP_UNLOCK)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_RMA_MERGE_LOCK_OP_UNLOCK"); rc = MPL_env2bool("MPIR_PARAM_RMA_MERGE_LOCK_OP_UNLOCK", &(MPIR_PARAM_RMA_MERGE_LOCK_OP_UNLOCK)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_RMA_MERGE_LOCK_OP_UNLOCK"); rc = MPL_env2bool("MPICH_NO_LOCAL", &(MPIR_PARAM_NOLOCAL)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_NO_LOCAL"); rc = MPL_env2bool("MPIR_PARAM_NO_LOCAL", &(MPIR_PARAM_NOLOCAL)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_NO_LOCAL"); rc = MPL_env2bool("MPICH_NOLOCAL", &(MPIR_PARAM_NOLOCAL)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_NOLOCAL"); rc = MPL_env2bool("MPIR_PARAM_NOLOCAL", &(MPIR_PARAM_NOLOCAL)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_NOLOCAL"); rc = MPL_env2bool("MPICH_EVEN_ODD_CLIQUES", &(MPIR_PARAM_ODD_EVEN_CLIQUES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_EVEN_ODD_CLIQUES"); rc = MPL_env2bool("MPIR_PARAM_EVEN_ODD_CLIQUES", &(MPIR_PARAM_ODD_EVEN_CLIQUES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_EVEN_ODD_CLIQUES"); rc = MPL_env2bool("MPICH_ODD_EVEN_CLIQUES", &(MPIR_PARAM_ODD_EVEN_CLIQUES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ODD_EVEN_CLIQUES"); rc = MPL_env2bool("MPIR_PARAM_ODD_EVEN_CLIQUES", &(MPIR_PARAM_ODD_EVEN_CLIQUES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ODD_EVEN_CLIQUES"); rc = MPL_env2int("MPICH_POLLS_BEFORE_YIELD", &(MPIR_PARAM_POLLS_BEFORE_YIELD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_POLLS_BEFORE_YIELD"); rc = MPL_env2int("MPIR_PARAM_POLLS_BEFORE_YIELD", &(MPIR_PARAM_POLLS_BEFORE_YIELD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_POLLS_BEFORE_YIELD"); rc = MPL_env2bool("MPICH_MEMDUMP", &(MPIR_PARAM_MEMDUMP)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_MEMDUMP"); rc = MPL_env2bool("MPIR_PARAM_MEMDUMP", &(MPIR_PARAM_MEMDUMP)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_MEMDUMP"); rc = MPL_env2int("MPICH_PROCTABLE_SIZE", &(MPIR_PARAM_PROCTABLE_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_PROCTABLE_SIZE"); rc = MPL_env2int("MPIR_PARAM_PROCTABLE_SIZE", &(MPIR_PARAM_PROCTABLE_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_PROCTABLE_SIZE"); rc = MPL_env2bool("MPICH_PROCTABLE_PRINT", &(MPIR_PARAM_PROCTABLE_PRINT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_PROCTABLE_PRINT"); rc = MPL_env2bool("MPIR_PARAM_PROCTABLE_PRINT", &(MPIR_PARAM_PROCTABLE_PRINT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_PROCTABLE_PRINT"); rc = MPL_env2bool("MPICH_ERROR_CHECKING", &(MPIR_PARAM_ERROR_CHECKING)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ERROR_CHECKING"); rc = MPL_env2bool("MPIR_PARAM_ERROR_CHECKING", &(MPIR_PARAM_ERROR_CHECKING)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ERROR_CHECKING"); rc = MPL_env2bool("MPICH_PRINT_ERROR_STACK", &(MPIR_PARAM_PRINT_ERROR_STACK)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_PRINT_ERROR_STACK"); rc = MPL_env2bool("MPIR_PARAM_PRINT_ERROR_STACK", &(MPIR_PARAM_PRINT_ERROR_STACK)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_PRINT_ERROR_STACK"); rc = MPL_env2int("MPICH_CHOP_ERROR_STACK", &(MPIR_PARAM_CHOP_ERROR_STACK)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_CHOP_ERROR_STACK"); rc = MPL_env2int("MPIR_PARAM_CHOP_ERROR_STACK", &(MPIR_PARAM_CHOP_ERROR_STACK)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_CHOP_ERROR_STACK"); rc = MPL_env2int("MPICH_NEM_LMT_DMA_THRESHOLD", &(MPIR_PARAM_NEM_LMT_DMA_THRESHOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_NEM_LMT_DMA_THRESHOLD"); rc = MPL_env2int("MPIR_PARAM_NEM_LMT_DMA_THRESHOLD", &(MPIR_PARAM_NEM_LMT_DMA_THRESHOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_NEM_LMT_DMA_THRESHOLD"); MPIR_PARAM_GET_DEFAULT_STRING(NEMESIS_NETMOD, &tmp_str); rc = MPL_env2str("MPICH_NEMESIS_NETMOD", &tmp_str); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_NEMESIS_NETMOD"); rc = MPL_env2str("MPIR_PARAM_NEMESIS_NETMOD", &tmp_str); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_NEMESIS_NETMOD"); if (tmp_str != NULL) { MPIR_PARAM_NEMESIS_NETMOD = MPIU_Strdup(tmp_str); MPIR_Param_assert(MPIR_PARAM_NEMESIS_NETMOD); if (MPIR_PARAM_NEMESIS_NETMOD == NULL) { MPIU_CHKMEM_SETERR(mpi_errno, strlen(tmp_str), "dup of string for MPIR_PARAM_NEMESIS_NETMOD"); goto fn_fail; } } else { MPIR_PARAM_NEMESIS_NETMOD = NULL; } MPIR_PARAM_GET_DEFAULT_STRING(INTERFACE_HOSTNAME, &tmp_str); rc = MPL_env2str("MPICH_INTERFACE_HOSTNAME", &tmp_str); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_INTERFACE_HOSTNAME"); rc = MPL_env2str("MPIR_PARAM_INTERFACE_HOSTNAME", &tmp_str); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_INTERFACE_HOSTNAME"); if (tmp_str != NULL) { MPIR_PARAM_INTERFACE_HOSTNAME = MPIU_Strdup(tmp_str); MPIR_Param_assert(MPIR_PARAM_INTERFACE_HOSTNAME); if (MPIR_PARAM_INTERFACE_HOSTNAME == NULL) { MPIU_CHKMEM_SETERR(mpi_errno, strlen(tmp_str), "dup of string for MPIR_PARAM_INTERFACE_HOSTNAME"); goto fn_fail; } } else { MPIR_PARAM_INTERFACE_HOSTNAME = NULL; } MPIR_PARAM_GET_DEFAULT_STRING(NETWORK_IFACE, &tmp_str); rc = MPL_env2str("MPICH_NETWORK_IFACE", &tmp_str); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_NETWORK_IFACE"); rc = MPL_env2str("MPIR_PARAM_NETWORK_IFACE", &tmp_str); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_NETWORK_IFACE"); if (tmp_str != NULL) { MPIR_PARAM_NETWORK_IFACE = MPIU_Strdup(tmp_str); MPIR_Param_assert(MPIR_PARAM_NETWORK_IFACE); if (MPIR_PARAM_NETWORK_IFACE == NULL) { MPIU_CHKMEM_SETERR(mpi_errno, strlen(tmp_str), "dup of string for MPIR_PARAM_NETWORK_IFACE"); goto fn_fail; } } else { MPIR_PARAM_NETWORK_IFACE = NULL; } rc = MPL_env2int("MPICH_HOST_LOOKUP_RETRIES", &(MPIR_PARAM_HOST_LOOKUP_RETRIES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_HOST_LOOKUP_RETRIES"); rc = MPL_env2int("MPIR_PARAM_HOST_LOOKUP_RETRIES", &(MPIR_PARAM_HOST_LOOKUP_RETRIES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_HOST_LOOKUP_RETRIES"); rc = MPL_env2int("MPICH_SHM_EAGER_MAX_SZ", &(MPIR_PARAM_SHM_EAGER_MAX_SZ)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_SHM_EAGER_MAX_SZ"); rc = MPL_env2int("MPIR_PARAM_SHM_EAGER_MAX_SZ", &(MPIR_PARAM_SHM_EAGER_MAX_SZ)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_SHM_EAGER_MAX_SZ"); rc = MPL_env2int("MPICH_SHM_READY_EAGER_MAX_SZ", &(MPIR_PARAM_SHM_READY_EAGER_MAX_SZ)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_SHM_READY_EAGER_MAX_SZ"); rc = MPL_env2int("MPIR_PARAM_SHM_READY_EAGER_MAX_SZ", &(MPIR_PARAM_SHM_READY_EAGER_MAX_SZ)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_SHM_READY_EAGER_MAX_SZ"); rc = MPL_env2bool("MPICH_COMM_OVERRIDES", &(MPIR_PARAM_COMM_OVERRIDES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_COMM_OVERRIDES"); rc = MPL_env2bool("MPIR_PARAM_COMM_OVERRIDES", &(MPIR_PARAM_COMM_OVERRIDES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_COMM_OVERRIDES"); rc = MPL_env2int("MPICH_CH3_EAGER_MAX_MSG_SIZE", &(MPIR_PARAM_CH3_EAGER_MAX_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_CH3_EAGER_MAX_MSG_SIZE"); rc = MPL_env2int("MPIR_PARAM_CH3_EAGER_MAX_MSG_SIZE", &(MPIR_PARAM_CH3_EAGER_MAX_MSG_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_CH3_EAGER_MAX_MSG_SIZE"); rc = MPL_env2bool("MPICH_DEBUG_HOLD", &(MPIR_PARAM_DEBUG_HOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_DEBUG_HOLD"); rc = MPL_env2bool("MPIR_PARAM_DEBUG_HOLD", &(MPIR_PARAM_DEBUG_HOLD)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_DEBUG_HOLD"); rc = MPL_env2bool("MPICH_ENABLE_CKPOINT", &(MPIR_PARAM_ENABLE_CKPOINT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ENABLE_CKPOINT"); rc = MPL_env2bool("MPIR_PARAM_ENABLE_CKPOINT", &(MPIR_PARAM_ENABLE_CKPOINT)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ENABLE_CKPOINT"); rc = MPL_env2bool("MPICH_ENABLE_COLL_FT_RET", &(MPIR_PARAM_ENABLE_COLL_FT_RET)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ENABLE_COLL_FT_RET"); rc = MPL_env2bool("MPIR_PARAM_ENABLE_COLL_FT_RET", &(MPIR_PARAM_ENABLE_COLL_FT_RET)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ENABLE_COLL_FT_RET"); rc = MPL_env2bool("MPICH_ABORT_ON_LEAKED_HANDLES", &(MPIR_PARAM_ABORT_ON_LEAKED_HANDLES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_ABORT_ON_LEAKED_HANDLES"); rc = MPL_env2bool("MPIR_PARAM_ABORT_ON_LEAKED_HANDLES", &(MPIR_PARAM_ABORT_ON_LEAKED_HANDLES)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_ABORT_ON_LEAKED_HANDLES"); rc = MPL_env2range("MPICH_PORTRANGE", &(MPIR_PARAM_PORT_RANGE.low), &(MPIR_PARAM_PORT_RANGE.high)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_PORTRANGE"); rc = MPL_env2range("MPIR_PARAM_PORTRANGE", &(MPIR_PARAM_PORT_RANGE.low), &(MPIR_PARAM_PORT_RANGE.high)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_PORTRANGE"); rc = MPL_env2range("MPICH_PORT_RANGE", &(MPIR_PARAM_PORT_RANGE.low), &(MPIR_PARAM_PORT_RANGE.high)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_PORT_RANGE"); rc = MPL_env2range("MPIR_PARAM_PORT_RANGE", &(MPIR_PARAM_PORT_RANGE.low), &(MPIR_PARAM_PORT_RANGE.high)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_PORT_RANGE"); rc = MPL_env2int("MPICH_CTXID_EAGER_SIZE", &(MPIR_PARAM_CTXID_EAGER_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPICH_CTXID_EAGER_SIZE"); rc = MPL_env2int("MPIR_PARAM_CTXID_EAGER_SIZE", &(MPIR_PARAM_CTXID_EAGER_SIZE)); MPIU_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","MPIR_PARAM_CTXID_EAGER_SIZE"); fn_fail: return mpi_errno; }
int MPIDI_Win_create(void *base, MPI_Aint size, int disp_unit, MPID_Info *info, MPID_Comm *comm_ptr, MPID_Win **win_ptr ) { int mpi_errno=MPI_SUCCESS, i, k, comm_size, rank; MPI_Aint *tmp_buf; MPID_Comm *win_comm_ptr; int errflag = FALSE; MPIU_CHKPMEM_DECL(4); MPIU_CHKLMEM_DECL(1); MPIDI_STATE_DECL(MPID_STATE_MPIDI_WIN_CREATE); MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_WIN_CREATE); /* FIXME: There should be no unreferenced args */ MPIU_UNREFERENCED_ARG(info); if(initRMAoptions) { int rc; MPIU_THREADSAFE_INIT_BLOCK_BEGIN(initRMAoptions); /* Default is to enable the use of the immediate accumulate feature */ if (!MPL_env2bool( "MPICH_RMA_ACC_IMMED", &rc )) rc = 1; MPIDI_CH3_RMA_SetAccImmed(rc); #ifdef USE_MPIU_INSTR /* Define all instrumentation handle used in the CH3 RMA here*/ MPIU_INSTR_DURATION_INIT(wincreate_allgather,0,"WIN_CREATE:Allgather"); MPIU_INSTR_DURATION_INIT(winfree_rs,0,"WIN_FREE:ReduceScatterBlock"); MPIU_INSTR_DURATION_INIT(winfree_complete,0,"WIN_FREE:Complete"); MPIU_INSTR_DURATION_INIT(rmaqueue_alloc,0,"Allocate RMA Queue element"); MPIDI_CH3_RMA_InitInstr(); #endif MPIU_THREADSAFE_INIT_CLEAR(initRMAoptions); MPIU_THREADSAFE_INIT_BLOCK_END(initRMAoptions); } comm_size = comm_ptr->local_size; rank = comm_ptr->rank; *win_ptr = (MPID_Win *)MPIU_Handle_obj_alloc( &MPID_Win_mem ); MPIU_ERR_CHKANDJUMP1(!(*win_ptr),mpi_errno,MPI_ERR_OTHER,"**nomem", "**nomem %s","MPID_Win_mem"); MPIU_Object_set_ref(*win_ptr, 1); (*win_ptr)->fence_cnt = 0; (*win_ptr)->base = base; (*win_ptr)->size = size; (*win_ptr)->disp_unit = disp_unit; (*win_ptr)->start_group_ptr = NULL; (*win_ptr)->start_assert = 0; (*win_ptr)->attributes = NULL; (*win_ptr)->rma_ops_list_head = NULL; (*win_ptr)->rma_ops_list_tail = NULL; (*win_ptr)->lock_granted = 0; (*win_ptr)->current_lock_type = MPID_LOCK_NONE; (*win_ptr)->shared_lock_ref_cnt = 0; (*win_ptr)->lock_queue = NULL; (*win_ptr)->my_counter = 0; (*win_ptr)->my_pt_rma_puts_accs = 0; mpi_errno = MPIR_Comm_dup_impl(comm_ptr, &win_comm_ptr); if (mpi_errno) MPIU_ERR_POP(mpi_errno); (*win_ptr)->comm_ptr = win_comm_ptr; (*win_ptr)->myrank = rank; MPIU_INSTR_DURATION_START(wincreate_allgather); /* allocate memory for the base addresses, disp_units, and completion counters of all processes */ MPIU_CHKPMEM_MALLOC((*win_ptr)->base_addrs, void **, comm_size*sizeof(void *), mpi_errno, "(*win_ptr)->base_addrs"); MPIU_CHKPMEM_MALLOC((*win_ptr)->disp_units, int *, comm_size*sizeof(int), mpi_errno, "(*win_ptr)->disp_units"); MPIU_CHKPMEM_MALLOC((*win_ptr)->all_win_handles, MPI_Win *, comm_size*sizeof(MPI_Win), mpi_errno, "(*win_ptr)->all_win_handles"); MPIU_CHKPMEM_MALLOC((*win_ptr)->pt_rma_puts_accs, int *, comm_size*sizeof(int), mpi_errno, "(*win_ptr)->pt_rma_puts_accs"); for (i=0; i<comm_size; i++) (*win_ptr)->pt_rma_puts_accs[i] = 0; /* get the addresses of the windows, window objects, and completion counters of all processes. allocate temp. buffer for communication */ MPIU_CHKLMEM_MALLOC(tmp_buf, MPI_Aint *, 3*comm_size*sizeof(MPI_Aint), mpi_errno, "tmp_buf"); /* FIXME: This needs to be fixed for heterogeneous systems */ tmp_buf[3*rank] = MPIU_PtrToAint(base); tmp_buf[3*rank+1] = (MPI_Aint) disp_unit; tmp_buf[3*rank+2] = (MPI_Aint) (*win_ptr)->handle; mpi_errno = MPIR_Allgather_impl(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, tmp_buf, 3 * sizeof(MPI_Aint), MPI_BYTE, comm_ptr, &errflag); MPIU_INSTR_DURATION_END(wincreate_allgather); if (mpi_errno) { MPIU_ERR_POP(mpi_errno); } MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail"); k = 0; for (i=0; i<comm_size; i++) { (*win_ptr)->base_addrs[i] = MPIU_AintToPtr(tmp_buf[k++]); (*win_ptr)->disp_units[i] = (int) tmp_buf[k++]; (*win_ptr)->all_win_handles[i] = (MPI_Win) tmp_buf[k++]; } fn_exit: MPIU_CHKLMEM_FREEALL(); MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_CREATE); return mpi_errno; /* --BEGIN ERROR HANDLING-- */ fn_fail: MPIU_CHKPMEM_REAP(); goto fn_exit; /* --END ERROR HANDLING-- */ }