1
1
openmpi/ompi/mca/pubsub/pmi/pubsub_pmi.c
Ralph Castain 1107f9099e Per the RFC issued here:
http://www.open-mpi.org/community/lists/devel/2014/05/14827.php

Refactor PMI support

This commit was SVN r31907.
2014-06-01 04:28:17 +00:00

80 строки
1.6 KiB
C

/*
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/constants.h"
#include "opal/mca/common/pmi/common_pmi.h"
#include "ompi/info/info.h"
#include "ompi/mca/rte/rte.h"
#include "ompi/mca/pubsub/base/base.h"
#include "pubsub_pmi.h"
/*
* Init the module
*/
static int init(void)
{
return OMPI_SUCCESS;
}
/*
* publish the port_name for the specified service_name.
*/
static int publish ( const char *service_name, ompi_info_t *info, const char *port_name )
{
return mca_common_pmi_publish(service_name,port_name);
}
static char* lookup ( const char *service_name, ompi_info_t *info )
{
char *port=NULL;
int rc = mca_common_pmi_lookup(service_name, &port);
/* in error case port will be set to NULL
* this is what our callers expect to see
* In future maybe som error handling need?
*/
if( rc != OPAL_SUCCESS ){
// improove error processing
return port; // NULL ?
}
return port;
}
/*
* delete the entry */
static int unpublish ( const char *service_name, ompi_info_t *info )
{
return mca_common_pmi_unpublish( service_name );
}
/*
* finalize the module
*/
static int finalize(void)
{
return OMPI_SUCCESS;
}
/*
* instantiate the module
*/
ompi_pubsub_base_module_t ompi_pubsub_pmi_module = {
init,
publish,
unpublish,
lookup,
finalize
};