adding functions for handling the name publishing. Currently ifdefed out,
just blank routines are provided for keeping the linker happy. This commit was SVN r1334.
Этот коммит содержится в:
родитель
928814249d
Коммит
2598915dc7
@ -16,7 +16,8 @@ libcommunicator_la_SOURCES = \
|
||||
$(headers) \
|
||||
comm_init.c \
|
||||
comm.c \
|
||||
comm_cid.c
|
||||
comm_cid.c \
|
||||
comm_publish.c
|
||||
|
||||
# Conditionally install the header files
|
||||
|
||||
|
68
src/communicator/comm_publish.c
Обычный файл
68
src/communicator/comm_publish.c
Обычный файл
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "mpi.h"
|
||||
|
||||
#include "communicator/communicator.h"
|
||||
#include "proc/proc.h"
|
||||
#include "include/constants.h"
|
||||
#include "mca/pcm/pcm.h"
|
||||
#include "mca/pml/pml.h"
|
||||
|
||||
#ifndef HAVE_REGISTRY
|
||||
/* just to keep the linker happy */
|
||||
int ompi_comm_namepublish ( char *service_name, char *port_name )
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
char* ompi_comm_namelookup ( char *service_name )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
int ompi_comm_nameunpublish ( char *service_name )
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
#else
|
||||
#include "mca/gpr/gpr.h"
|
||||
|
||||
/*
|
||||
* publish the port_name using the service_name as a token
|
||||
* jobid and vpid are used later to make
|
||||
* sure, that only this process can unpublish the information.
|
||||
*/
|
||||
int ompi_comm_namepublish ( char *service_name, char *port_name )
|
||||
{
|
||||
return (ompi_registry_put((uint8_t *)port_name, strlen(service_name),
|
||||
"universe", service_name, NULL));
|
||||
}
|
||||
|
||||
char* ompi_comm_namelookup ( char *service_name )
|
||||
{
|
||||
ompi_registry_value_t *tmp;
|
||||
char *stmp=NULL;
|
||||
|
||||
tmp = ompi_registry_get("universe", service_name, NULL);
|
||||
if ( NULL != tmp ) {
|
||||
stmp = (char*)tmp->object;
|
||||
}
|
||||
|
||||
return (stmp);
|
||||
}
|
||||
|
||||
/*
|
||||
* delete the entry. Just the process who has published
|
||||
* the service_name, has the right to remove this
|
||||
* service. Will be done later, by adding jobid and vpid
|
||||
* as tokens
|
||||
*/
|
||||
int ompi_comm_nameunpublish ( char *service_name )
|
||||
{
|
||||
return (ompi_registry_del("universe", service_name, NULL));
|
||||
}
|
||||
|
||||
#endif
|
@ -287,6 +287,16 @@ extern "C" {
|
||||
*/
|
||||
int ompi_comm_dump ( ompi_communicator_t *comm );
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* routines handling name publishing, lookup and unpublishing
|
||||
*/
|
||||
int ompi_comm_namepublish ( char *service_name, char *port_name );
|
||||
char* ompi_comm_namelookup ( char *service_name );
|
||||
int ompi_comm_nameunpublish ( char *service_name );
|
||||
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user