1
1

provide a routine to set the contact info of the seed daemon

This commit was SVN r2279.
Этот коммит содержится в:
Tim Woodall 2004-08-24 16:54:45 +00:00
родитель 3007a3270b
Коммит fc714c7378
2 изменённых файлов: 55 добавлений и 4 удалений

Просмотреть файл

@ -73,13 +73,40 @@ extern ompi_process_name_t mca_oob_name_self;
extern "C" {
#endif
/**
* Obtain a string representation of the OOB contact information for
* the selected OOB channels. This string may be passed to another
* application via an MCA parameter (OMPI_MCA_oob_base_seed) to bootstrap
* communications.
*
* @return A null terminated string that should be freed by the caller.
*
* Note that mca_oob_base_init() must be called to load and select
* an OOB module prior to calling this routine.
*/
char* mca_oob_get_contact_info(void);
/**
* Set the MCA parameter (OMPI_MCA_oob_base_seed) used by the OOB to
* bootstrap communication between peers.
*
* @param seed The contact information of the peer process obtained
* via a call to mca_oob_get_contact_info().
*
* Note that this routine currently just sets the MCA parameter - so
* this function must be called prior to mca_oob_base_init().
*/
int mca_oob_set_contact_info(const char*);
/**
* Returns a null terminated character string returning contact info
* for all supported OOB channels.
*
* @return A null terminated string.
* @return
*
* The caller is responsible for freeing the returned string.
* Note that the caller is responsible for freeing the returned string.
*/
char* mca_oob_get_contact_info(void);

Просмотреть файл

@ -47,7 +47,7 @@ static int mca_oob_base_parse_contact_info(
char*** uri)
{
/* parse the process name */
char* ptr = strchr(contact_info, '=');
char* ptr = strchr(contact_info, ';');
if(NULL == ptr)
return OMPI_ERR_BAD_PARAM;
*ptr = '\0';
@ -209,12 +209,36 @@ char* mca_oob_get_contact_info()
char *proc_addr = mca_oob.oob_get_addr();
size_t size = strlen(proc_name) + 1 + strlen(proc_addr) + 1;
char *contact_info = malloc(size);
sprintf(contact_info, "%s=%s", proc_name, proc_addr);
sprintf(contact_info, "%s;%s", proc_name, proc_addr);
free(proc_name);
free(proc_addr);
return contact_info;
}
/**
* Setup the contact information for the seed daemon - which
* is passed as an MCA parameter.
*
* @param seed
*/
int mca_oob_set_contact_info(const char* seed)
{
/* TSW - fix this - currently just stuff the parameter in the environment */
setenv("OMPI_MCA_oob_base_seed", seed, 1);
return OMPI_SUCCESS;
}
/**
* Obtains the contact info (oob implementation specific) URI strings through
* which this process can be contacted on an OOB channel.
*
* @return A null terminated string.
*
* The caller is responsible for freeing the returned string.
*/
/**
* Called to request the selected oob components to
* register their address with the seed deamon.