/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int orcm_scd_base_open(mca_base_open_flag_t flags) { int rc; /* setup the base objects */ OBJ_CONSTRUCT(&orcm_scd_base.states, opal_list_t); OBJ_CONSTRUCT(&orcm_scd_base.rmstates, opal_list_t); OBJ_CONSTRUCT(&orcm_scd_base.queues, opal_list_t); OBJ_CONSTRUCT(&orcm_scd_base.nodes, opal_pointer_array_t); opal_pointer_array_init(&orcm_scd_base.nodes, 8, INT_MAX, 8); OBJ_CONSTRUCT(&orcm_scd_base.topologies, opal_pointer_array_t); opal_pointer_array_init(&orcm_scd_base.topologies, 1, INT_MAX, 1); OBJ_CONSTRUCT(&orcm_scd_base.tracking, opal_list_t); if (OPAL_SUCCESS != (rc = mca_base_framework_components_open(&orcm_scd_base_framework, flags))) { return rc; } /* create the event base */ if (NULL == (orcm_scd_base.ev_base = opal_progress_thread_init("scd"))) { return ORCM_ERR_OUT_OF_RESOURCE; } return rc; }
static int mca_bml_base_open(mca_base_open_flag_t flags) { int ret; if(OMPI_SUCCESS != (ret = mca_base_framework_components_open(&ompi_bml_base_framework, flags))) { return ret; } #if OPAL_ENABLE_DEBUG_RELIABILITY /* seed random number generator */ struct timeval tv; gettimeofday(&tv, NULL); opal_srand(&mca_bml_base_rand_buff,(uint32_t)(getpid() * tv.tv_usec)); /* initialize count */ if(mca_bml_base_error_rate_ceiling > 0 && mca_bml_base_error_rate_floor <= mca_bml_base_error_rate_ceiling) { mca_bml_base_error_count = (int) (((double) mca_bml_base_error_rate_ceiling * opal_rand(&mca_bml_base_rand_buff))/(UINT32_MAX+1.0)); } #endif return mca_base_framework_open(&ompi_btl_base_framework, 0); }
static int opal_if_base_open (mca_base_open_flag_t flags) { /* setup the global list */ OBJ_CONSTRUCT(&opal_if_list, opal_list_t); return mca_base_framework_components_open (&opal_if_base_framework, flags); }
/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int orte_rtc_base_open(mca_base_open_flag_t flags) { /* init the globals */ OBJ_CONSTRUCT(&orte_rtc_base.actives, opal_list_t); /* Open up all available components */ return mca_base_framework_components_open(&orte_rtc_base_framework, flags); }
static int opal_dstore_base_frame_open(mca_base_open_flag_t flags) { OBJ_CONSTRUCT(&opal_dstore_base.handles, opal_pointer_array_t); opal_pointer_array_init(&opal_dstore_base.handles, 3, INT_MAX, 1); /* Open up all available components */ return mca_base_framework_components_open(&opal_dstore_base_framework, flags); }
/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int mca_spml_base_open(mca_base_open_flag_t flags) { /** * Construct the send and receive request queues. There are 2 reasons to do it * here. First, as they are globals it's better to construct them in one common * place. Second, in order to be able to allow the external debuggers to show * their content, they should get constructed as soon as possible once the MPI * process is started. */ OBJ_CONSTRUCT(&mca_spml_base_put_requests, ompi_free_list_t); OBJ_CONSTRUCT(&mca_spml_base_get_requests, ompi_free_list_t); OBJ_CONSTRUCT(&mca_spml_base_spml, opal_pointer_array_t); /* Open up all available components */ if (OPAL_SUCCESS != mca_base_framework_components_open(&oshmem_spml_base_framework, flags)) { return OSHMEM_ERROR; } /* Set a sentinel in case we don't select any components (e.g., ompi_info) */ mca_spml_base_selected_component.spmlm_finalize = NULL; /** * Right now our selection of BTLs is completely broken. If we have * multiple SPMLs that use BTLs than we will open all BTLs several times, leading to * undefined behaviors. The simplest solution, at least until we * figure out the correct way to do it, is to force a default SPML that * uses BTLs and any other SPMLs that do not in the mca_spml_base_spml array. */ #if MCA_ompi_pml_DIRECT_CALL opal_pointer_array_add(&mca_spml_base_spml, strdup(stringify(MCA_oshmem_spml_DIRECT_CALL_COMPONENT))); #else { const char **default_spml = NULL; int var_id; var_id = mca_base_var_find("oshmem", "spml", NULL, NULL); mca_base_var_get_value(var_id, &default_spml, NULL, NULL); if( (NULL == default_spml || NULL == default_spml[0] || 0 == strlen(default_spml[0])) || (default_spml[0][0] == '^') ) { #ifdef OSHMEM_HAS_IKRIT opal_pointer_array_add(&mca_spml_base_spml, strdup("ikrit")); #endif opal_pointer_array_add(&mca_spml_base_spml, strdup("yoda")); } else { opal_pointer_array_add(&mca_spml_base_spml, strdup(default_spml[0])); } } #endif return OSHMEM_SUCCESS; }
static int orte_rml_base_open(mca_base_open_flag_t flags) { /* Initialize globals */ OBJ_CONSTRUCT(&orte_rml_base.posted_recvs, opal_list_t); OBJ_CONSTRUCT(&orte_rml_base.unmatched_msgs, opal_list_t); /* Open up all available components */ return mca_base_framework_components_open(&orte_rml_base_framework, flags); }
static int mca_scoll_base_open(mca_base_open_flag_t flags) { /* Open up all available components */ if (OPAL_SUCCESS != mca_base_framework_components_open(&oshmem_scoll_base_framework, flags)) { return OSHMEM_ERROR; } return OSHMEM_SUCCESS; }
static int opal_pmix_base_frame_open(mca_base_open_flag_t flags) { int rc; /* Open up all available components */ rc = mca_base_framework_components_open(&opal_pmix_base_framework, flags); /* ensure the function pointers are NULL */ memset(&opal_pmix, 0, sizeof(opal_pmix)); return rc; }
/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int mca_rcache_base_open(mca_base_open_flag_t flags) { /* Initialize the list so that in mca_rcache_base_close(), we can iterate over it (even if it's empty, as in the case of the opal_info-tool) */ OBJ_CONSTRUCT(&mca_rcache_base_modules, opal_list_t); /* Open up all available components */ return mca_base_framework_components_open(&opal_rcache_base_framework, flags); }
/** * Function for finding and opening either all MCA components, * or the one that was specifically requested via a MCA parameter. */ static int orte_oob_base_open(mca_base_open_flag_t flags) { /* setup globals */ orte_oob_base.max_uri_length = -1; OBJ_CONSTRUCT(&orte_oob_base.peers, opal_hash_table_t); opal_hash_table_init(&orte_oob_base.peers, 128); OBJ_CONSTRUCT(&orte_oob_base.actives, opal_list_t); /* Open up all available components */ return mca_base_framework_components_open(&orte_oob_base_framework, flags); }
/** * * Function for finding and opening either all MCA components, or the one * * that was specifically requested via a MCA parameter. * */ static int orte_errmgr_base_open(mca_base_open_flag_t flags) { /* load the default fns */ orte_errmgr = orte_errmgr_default_fns; /* initialize the error callback list */ OBJ_CONSTRUCT(&orte_errmgr_base.error_cbacks, opal_list_t); /* Open up all available components */ return mca_base_framework_components_open(&orte_errmgr_base_framework, flags); }
static int mca_io_base_open(mca_base_open_flag_t flags) { int ret; if (OPAL_SUCCESS != (ret = mca_base_framework_components_open(&ompi_io_base_framework, flags))) { return ret; } return mca_io_base_find_available(OPAL_ENABLE_PROGRESS_THREADS, OMPI_ENABLE_THREAD_MULTIPLE); }
/** * Function for finding and opening either all MCA components, * or the one that was specifically requested via a MCA parameter. */ static int orte_plm_base_open(mca_base_open_flag_t flags) { /* init the next jobid */ orte_plm_globals.next_jobid = 1; /* default to assigning daemons to nodes at launch */ orte_plm_globals.daemon_nodes_assigned_at_launch = true; /* Open up all available components */ return mca_base_framework_components_open(&orte_plm_base_framework, flags); }
static int opal_if_base_open (mca_base_open_flag_t flags) { if (frameopen) { return OPAL_SUCCESS; } frameopen = true; /* setup the global list */ OBJ_CONSTRUCT(&opal_if_list, opal_list_t); return mca_base_framework_components_open(&opal_if_base_framework, flags); }
static int opal_pmix_base_frame_open(mca_base_open_flag_t flags) { int rc; /* Open up all available components */ rc = mca_base_framework_components_open(&opal_pmix_base_framework, flags); /* ensure the function pointers are NULL */ memset(&opal_pmix, 0, sizeof(opal_pmix)); /* pass across the verbosity */ opal_pmix_verbose_output = opal_pmix_base_framework.framework_output; return rc; }
/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int orte_schizo_base_open(mca_base_open_flag_t flags) { int rc; /* init the globals */ OBJ_CONSTRUCT(&orte_schizo_base.active_modules, opal_list_t); /* Open up all available components */ rc = mca_base_framework_components_open(&orte_schizo_base_framework, flags); /* All done */ return rc; }
int mca_base_components_open (const char *type_name, int output_id, const mca_base_component_t **static_components, opal_list_t *components_available, bool open_dso_components) { /* create a dummy framework -- this leaks -- i know -- but it is temporary */ mca_base_register_flag_t register_flags; mca_base_framework_t *dummy_framework; opal_list_item_t *item; int ret; dummy_framework = calloc (1, sizeof(*dummy_framework)); dummy_framework->framework_static_components = static_components; dummy_framework->framework_output = output_id; dummy_framework->framework_name = strdup(type_name); if (open_dso_components) { register_flags = MCA_BASE_REGISTER_STATIC_ONLY; } else { register_flags = MCA_BASE_REGISTER_DEFAULT; } ret = mca_base_framework_components_register (dummy_framework, register_flags); if (OPAL_SUCCESS != ret) { free (dummy_framework); return ret; } ret = mca_base_framework_components_open (dummy_framework, 0); if (OPAL_SUCCESS != ret) { (void) mca_base_framework_components_close (dummy_framework, NULL); free (dummy_framework); return ret; } OBJ_CONSTRUCT(components_available, opal_list_t); while (NULL != (item = opal_list_remove_first(&dummy_framework->framework_components))) { opal_list_append(components_available, item); } OBJ_DESTRUCT(&dummy_framework->framework_components); return OPAL_SUCCESS; }
/** * Function for finding and opening either all MCA components, * or the one that was specifically requested via a MCA parameter. */ static int orte_sstore_base_open(mca_base_open_flag_t flags) { int rc; orte_sstore_handle_current = ORTE_SSTORE_HANDLE_INVALID; orte_sstore_handle_last_stable = ORTE_SSTORE_HANDLE_INVALID; orte_sstore_base_local_metadata_filename = strdup("snapshot_meta.data"); orte_sstore_base_global_metadata_filename = strdup("global_snapshot_meta.data"); orte_sstore_base_local_snapshot_fmt = strdup("opal_snapshot_%d.ckpt"); /* * Setup the prelaunch variable to point to the first possible snapshot * location */ if( NULL != orte_sstore_base_global_snapshot_ref ) { asprintf(&orte_sstore_base_prelaunch_location, "%s/%s/%d", orte_sstore_base_global_snapshot_dir, orte_sstore_base_global_snapshot_ref, 0); } /* Open up all available components */ if (ORTE_SUCCESS != (rc = mca_base_framework_components_open(&orte_sstore_base_framework, flags))) { return rc; } opal_output_verbose(10, orte_sstore_base_framework.framework_output, "sstore:base: open()"); opal_output_verbose(10, orte_sstore_base_framework.framework_output, "sstore:base: open: Global snapshot directory = %s", orte_sstore_base_global_snapshot_dir); opal_output_verbose(10, orte_sstore_base_framework.framework_output, "sstore:base: open: Global snapshot reference = %s", (NULL == orte_sstore_base_global_snapshot_ref ? "Default" : orte_sstore_base_global_snapshot_ref)); opal_output_verbose(10, orte_sstore_base_framework.framework_output, "sstore:base: open: Prelaunch location = %s", (NULL == orte_sstore_base_prelaunch_location ? "Undefined" : orte_sstore_base_prelaunch_location)); orte_sstore_context = ORTE_SSTORE_UNASSIGN_TYPE; orte_sstore_base_determine_context(); return ORTE_SUCCESS; }
/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int orcm_evgen_base_open(mca_base_open_flag_t flags) { int rc; /* construct the array of active modules */ OBJ_CONSTRUCT(&orcm_evgen_base.actives, opal_list_t); /* start the progress thread */ if (NULL == (orcm_evgen_evbase = opal_progress_thread_init("evgen"))) { return ORCM_ERROR; } /* Open up all available components */ rc = mca_base_framework_components_open(&orcm_evgen_base_framework, flags); orcm_evgen_base_output = orcm_evgen_base_framework.framework_output; return rc; }
/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int orte_sensor_base_open(mca_base_open_flag_t flags) { /* initialize pointers */ orte_sensor_base.my_proc = NULL; orte_sensor_base.my_node = NULL; orte_sensor_base.active = false; /* construct the array of modules */ OBJ_CONSTRUCT(&orte_sensor_base.modules, opal_pointer_array_t); opal_pointer_array_init(&orte_sensor_base.modules, 3, INT_MAX, 1); /* get the sample rate */ orte_sensor_base.rate.tv_sec = orte_sensor_base_sample_rate; orte_sensor_base.rate.tv_usec = 0; /* Open up all available components */ return mca_base_framework_components_open(&orte_sensor_base_framework, flags); }
/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int orte_grpcomm_base_open(mca_base_open_flag_t flags) { /* init globals */ OBJ_CONSTRUCT(&orte_grpcomm_base.active_colls, opal_list_t); orte_grpcomm_base.coll_id = 0; OBJ_CONSTRUCT(&orte_grpcomm_base.modex_requests, opal_list_t); orte_grpcomm_base.modex_ready = false; #if OPAL_HAVE_HWLOC orte_grpcomm_base.working_cpuset = NULL; #endif /* register the modex processing event */ if (ORTE_PROC_IS_APP) { orte_state.add_proc_state(ORTE_PROC_STATE_MODEX_READY, orte_grpcomm_base_process_modex, ORTE_MSG_PRI); } return mca_base_framework_components_open(&orte_grpcomm_base_framework, flags); }
static int mca_memheap_base_open(mca_base_open_flag_t flags) { mca_memheap_base_already_opened = mca_memheap_base_already_opened + 1; if (mca_memheap_base_already_opened > 1) { return OSHMEM_SUCCESS; } memset(&mca_memheap_base_map, 0, sizeof(mca_memheap_base_map)); mca_memheap_base_map.n_segments = 0; mca_memheap_base_map.num_transports = 0; /* Open up all available components */ if (OPAL_SUCCESS != mca_base_framework_components_open(&oshmem_memheap_base_framework, flags)) { return OSHMEM_ERROR; } return OSHMEM_SUCCESS; }
/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int orte_iof_base_open(mca_base_open_flag_t flags) { int xmlfd; /* daemons do not need to do this as they do not write out stdout/err */ if (!ORTE_PROC_IS_DAEMON) { if (orte_xml_output) { if (NULL != orte_xml_fp) { /* user wants all xml-formatted output sent to file */ xmlfd = fileno(orte_xml_fp); } else { xmlfd = 1; } /* setup the stdout event */ ORTE_IOF_SINK_DEFINE(&orte_iof_base.iof_write_stdout, ORTE_PROC_MY_NAME, xmlfd, ORTE_IOF_STDOUT, orte_iof_base_write_handler); /* don't create a stderr event - all output will go to * the stdout channel */ } else { /* setup the stdout event */ ORTE_IOF_SINK_DEFINE(&orte_iof_base.iof_write_stdout, ORTE_PROC_MY_NAME, 1, ORTE_IOF_STDOUT, orte_iof_base_write_handler); /* setup the stderr event */ ORTE_IOF_SINK_DEFINE(&orte_iof_base.iof_write_stderr, ORTE_PROC_MY_NAME, 2, ORTE_IOF_STDERR, orte_iof_base_write_handler); } /* do NOT set these file descriptors to non-blocking. If we do so, * we set the file descriptor to non-blocking for everyone that has * that file descriptor, which includes everyone else in our shell * pipeline chain. (See * http://lists.freebsd.org/pipermail/freebsd-hackers/2005-January/009742.html). * This causes things like "mpirun -np 1 big_app | cat" to lose * output, because cat's stdout is then ALSO non-blocking and cat * isn't built to deal with that case (same with almost all other * unix text utils). */ } /* Open up all available components */ return mca_base_framework_components_open(&orte_iof_base_framework, flags); }
int mca_base_framework_open (struct mca_base_framework_t *framework, mca_base_open_flag_t flags) { int ret; assert (NULL != framework); /* check if this framework is already open */ if (framework->framework_refcnt++) { return OPAL_SUCCESS; } /* register this framework before opening it */ ret = mca_base_framework_register (framework, MCA_BASE_REGISTER_DEFAULT); if (OPAL_SUCCESS != ret) { return ret; } if (MCA_BASE_FRAMEWORK_FLAG_NOREGISTER & framework->framework_flags) { flags |= MCA_BASE_OPEN_FIND_COMPONENTS; } /* lock all of this frameworks's variables */ ret = mca_base_var_group_find (framework->framework_project, framework->framework_name, NULL); mca_base_var_group_set_var_flag (ret, MCA_BASE_VAR_FLAG_SETTABLE, false); /* check the verbosity level and open (or close) the output */ framework_open_output (framework); if (NULL != framework->framework_open) { ret = framework->framework_open (flags); } else { ret = mca_base_framework_components_open (framework, flags); } if (OPAL_SUCCESS != ret) { framework->framework_refcnt = 0; } return ret; }
/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int orcm_pvsn_base_open(mca_base_open_flag_t flags) { int rc; /* setup the base objects */ orcm_pvsn_base.ev_active = false; if (OPAL_SUCCESS != (rc = mca_base_framework_components_open(&orcm_pvsn_base_framework, flags))) { return rc; } /* create the event base */ orcm_pvsn_base.ev_active = true; if (NULL == (orcm_pvsn_base.ev_base = opal_progress_thread_init("pvsn"))) { orcm_pvsn_base.ev_active = false; return ORCM_ERR_OUT_OF_RESOURCE; } return rc; }
/* * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int orcm_analytics_base_open(mca_base_open_flag_t flags) { int rc; /* setup the base objects */ OBJ_CONSTRUCT(&orcm_analytics_base.workflows, opal_list_t); if (OPAL_SUCCESS != (rc = mca_base_framework_components_open(&orcm_analytics_base_framework, flags))) { return rc; } /* start the receive */ if (ORCM_SUCCESS != (rc = orcm_analytics_base_comm_start())) { ORTE_ERROR_LOG(rc); return rc; } return rc; }
static int orte_routed_base_open(mca_base_open_flag_t flags) { orte_routed_jobfam_t *jfam; orte_routed_base_wait_sync = false; /* Initialize storage of remote hnp uris */ OBJ_CONSTRUCT(&orte_routed_jobfams, opal_pointer_array_t); opal_pointer_array_init(&orte_routed_jobfams, 8, INT_MAX, 8); /* prime it with our HNP uri */ jfam = OBJ_NEW(orte_routed_jobfam_t); jfam->route.jobid = ORTE_PROC_MY_HNP->jobid; jfam->route.vpid = ORTE_PROC_MY_HNP->vpid; jfam->job_family = ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid); if (NULL != orte_process_info.my_hnp_uri) { jfam->hnp_uri = strdup(orte_process_info.my_hnp_uri); } opal_pointer_array_add(&orte_routed_jobfams, jfam); /* Open up all available components */ return mca_base_framework_components_open(&orte_routed_base_framework, flags); }
/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int mca_mpool_base_open(mca_base_open_flag_t flags) { /* Open up all available components - and populate the opal_mpool_base_framework.framework_components list */ if (OPAL_SUCCESS != mca_base_framework_components_open(&opal_mpool_base_framework, flags)) { return OPAL_ERROR; } if (mca_mpool_base_default_hints) { mca_mpool_base_default_module = mca_mpool_base_module_lookup (mca_mpool_base_default_hints); } /* Initialize the list so that in mca_mpool_base_close(), we can iterate over it (even if it's empty, as in the case of opal_info) */ OBJ_CONSTRUCT(&mca_mpool_base_modules, opal_list_t); /* setup tree for tracking MPI_Alloc_mem */ mca_mpool_base_tree_init(); return OPAL_SUCCESS; }
/** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ static int mca_mpool_base_open(mca_base_open_flag_t flags) { /* Open up all available components - and populate the ompi_mpool_base_framework.framework_components list */ if (OMPI_SUCCESS != mca_base_framework_components_open(&ompi_mpool_base_framework, flags)) { return OMPI_ERROR; } /* Initialize the list so that in mca_mpool_base_close(), we can iterate over it (even if it's empty, as in the case of ompi_info) */ OBJ_CONSTRUCT(&mca_mpool_base_modules, opal_list_t); /* get the page size for this architecture*/ mca_mpool_base_page_size = sysconf(_SC_PAGESIZE); mca_mpool_base_page_size_log = my_log2(mca_mpool_base_page_size); /* setup tree for tracking MPI_Alloc_mem */ mca_mpool_base_tree_init(); return OMPI_SUCCESS; }