src/mca/oob/base/oob_base_stubs.c
/**
 * Obtain a uri for initial connection purposes
 *
 * During initial wireup, we can only transfer contact info on the daemon
 * command line. This limits what we can send to a string representation of
 * the actual contact info, which gets sent in a uri-like form. Not every
 * oob module can support this transaction, so this function will loop
 * across all oob components/modules, letting each add to the uri string if
 * it supports bootstrap operations. An error will be returned in the cbfunc
 * if NO component can successfully provide a contact.
 *
 * Note: since there is a limit to what an OS will allow on a cmd line, we
 * impose a limit on the length of the resulting uri via an MCA param. The
 * default value of -1 implies unlimited - however, users with large numbers
 * of interfaces on their nodes may wish to restrict the size.
 */
Obtain a uri for initial connection purposes
During initial wireup, we can only transfer contact info on the daemon
command line. This limits what we can send to a string representation of
the actual contact info, which gets sent in a uri-like form. Not every
oob module can support this transaction, so this function will loop
across all oob components/modules, letting each add to the uri string if
it supports bootstrap operations. An error will be returned in the cbfunc
if NO component can successfully provide a contact.

since there is a limit to what an OS will allow on a cmd line, we
impose a limit on the length of the resulting uri via an MCA param. The
default value of -1 implies unlimited - however, users with large numbers
of interfaces on their nodes may wish to restrict the size.
Obtain a uri for initial connection purposes During initial wireup we can only transfer contact info on the daemon command line . This limits what we can send to a string representation of the actual contact info which gets sent in a uri - like form . Not every oob module can support this transaction so this function will loop across all oob components / modules letting each add to the uri string if it supports bootstrap operations . An error will be returned in the cbfunc if NO component can successfully provide a contact . since there is a limit to what an OS will allow on a cmd line we impose a limit on the length of the resulting uri via an MCA param . The default value of - 1 implies unlimited - however users with large numbers of interfaces on their nodes may wish to restrict the size .
void prte_oob_base_get_addr(char **uri)
{
    char *turi, *final = NULL, *tmp;
    size_t len = 0;
    bool one_added = false;
    prte_mca_base_component_list_item_t *cli;
    prte_oob_base_component_t *component;
    pmix_value_t val;
    pmix_status_t rc;
    if (PRTE_SUCCESS
        != (rc = prte_util_convert_process_name_to_string(&final, PRTE_PROC_MY_NAME))) {
        PRTE_ERROR_LOG(rc);
        *uri = NULL;
        return;
    }
    len = strlen(final);
    PRTE_LIST_FOREACH(cli, &prte_oob_base.actives, prte_mca_base_component_list_item_t)
    {
        component = (prte_oob_base_component_t *) cli->cli_component;
        if (NULL == component->get_addr) {
            continue;
        }
        turi = component->get_addr();
        if (NULL != turi) {
            if (0 < prte_oob_base.max_uri_length
                && prte_oob_base.max_uri_length < (int) (len + strlen(turi))) {
                continue;
            }
            prte_asprintf(&tmp, "%s;%s", final, turi);
            free(turi);
            free(final);
            final = tmp;
            len = strlen(final);
            one_added = true;
        }
    }
    if (!one_added) {
        if (NULL != final) {
            free(final);
            final = NULL;
        }
    }
    *uri = final;
    PMIX_VALUE_LOAD(&val, final, PMIX_STRING);
    if (PMIX_SUCCESS
        != (rc = PMIx_Store_internal(&prte_process_info.myproc, PMIX_PROC_URI, &val))) {
        PMIX_ERROR_LOG(rc);
    }
    PMIX_VALUE_DESTRUCT(&val);
}
void prte_oob_base_get_addr ( char * * uri ) { char * turi , * final = NULL , * tmp ; size_t len = 0 ; bool one_added = false ; prte_mca_base_component_list_item_t * cli ; prte_oob_base_component_t * component ; pmix_value_t val ; pmix_status_t rc ; if ( PRTE_SUCCESS != ( rc = prte_util_convert_process_name_to_string ( & final , PRTE_PROC_MY_NAME ) ) ) { PRTE_ERROR_LOG ( rc ) ; * uri = NULL ; return ; } len = strlen ( final ) ; PRTE_LIST_FOREACH ( cli , & prte_oob_base . actives , prte_mca_base_component_list_item_t ) { component = ( prte_oob_base_component_t * ) cli -> cli_component ; if ( NULL == component -> get_addr ) { continue ; } turi = component -> get_addr ( ) ; if ( NULL != turi ) { if ( 0 < prte_oob_base . max_uri_length && prte_oob_base . max_uri_length < ( int ) ( len + strlen ( turi ) ) ) { continue ; } prte_asprintf ( & tmp , " " , final , turi ) ; free ( turi ) ; free ( final ) ; final = tmp ; len = strlen ( final ) ; one_added = true ; } } if ( ! one_added ) { if ( NULL != final ) { free ( final ) ; final = NULL ; } } * uri = final ; PMIX_VALUE_LOAD ( & val , final , PMIX_STRING ) ; if ( PMIX_SUCCESS != ( rc = PMIx_Store_internal ( & prte_process_info . myproc , PMIX_PROC_URI , & val ) ) ) { PMIX_ERROR_LOG ( rc ) ; } PMIX_VALUE_DESTRUCT ( & val ) ; }
Obtain a uri for initial connection purposes
 During initial wireup, we can only transfer contact info on the daemon
 command line.
Obtain a uri for initial connection purposes During initial wireup we can only transfer contact info on the daemon command line .
/* start with our process name */ /* loop across all available modules to get their input
     * up to the max length
     */ /* ask the component for its input, obtained when it
         * opened its modules
         */ /* doesn't support this ability */ /* the components operate within our event base, so we
         * can directly call their get_uri function to get the
         * pointer to the uri - this is not a copy, so
         * do NOT free it!
         */ /* check overall length for limits */ /* cannot accept the payload */ /* add new value to final one */ /* flag that at least one contributed */ /* nobody could contribute */ /* push this into our modex storage */