* Add documentation for RML base code
* Move function declaration out of base.h as it isn't needed outside the base code This commit was SVN r15616.
Этот коммит содержится в:
родитель
f06b61cff9
Коммит
e537cc0871
@ -9,6 +9,8 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -16,6 +18,21 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* RML Framework maintenence interface
|
||||
*
|
||||
* Interface for starting / stopping / controlling the RML framework,
|
||||
* as well as support for modifying RML datatypes.
|
||||
*
|
||||
* @note The only RML datatype exposed to the user is the RML tag.
|
||||
* This will always be an integral value, so the only datatype support
|
||||
* really required is the internal DSS functions for packing /
|
||||
* unpacking / comparing tags. The user should never need to deal
|
||||
* with these.
|
||||
*/
|
||||
|
||||
#ifndef MCA_RML_BASE_H
|
||||
#define MCA_RML_BASE_H
|
||||
|
||||
@ -27,18 +44,56 @@
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/*
|
||||
* Global functions for the RML
|
||||
*/
|
||||
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
/**
|
||||
* Open the RML framework
|
||||
*
|
||||
* Open the RML framework. Loads all available RML components and
|
||||
* runs their open functions.
|
||||
*
|
||||
* @retval ORTE_SUCCESS Components successfully loaded
|
||||
* @retval ORTE_ERROR An unknown error occurred
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_rml_base_open(void);
|
||||
|
||||
|
||||
/**
|
||||
* Select an active RML component
|
||||
*
|
||||
* Select an RML component from the list of frameworks that were
|
||||
* opened during orte_rml_base_open(). The orte_rml_base_select()
|
||||
* function will fill in the orte_rml structure so that all functions
|
||||
* in the interface exist. Note that there are still calling
|
||||
* restrictions at that point (see the documentation for
|
||||
* orte_rml_component_init_fn_t).
|
||||
*
|
||||
* All components that are not selected will be closed during this
|
||||
* call.
|
||||
*
|
||||
* @retval ORTE_SUCCESS Components successfully selected
|
||||
* @retval ORTE_ERROR An unknown error occurred
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_rml_base_select(void);
|
||||
|
||||
|
||||
/**
|
||||
* Close the RML framework
|
||||
*
|
||||
* Close the RML framework, releasing all resources associated with
|
||||
* the framework interface. Also closes the active component used
|
||||
* during the application.
|
||||
*
|
||||
* @retval ORTE_SUCCESS Framework successfully shut down
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_rml_base_close(void);
|
||||
|
||||
|
||||
/*
|
||||
* Data type support
|
||||
*/
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
ORTE_DECLSPEC int orte_rml_base_compare_tags(orte_rml_tag_t *value1,
|
||||
orte_rml_tag_t *value2,
|
||||
orte_data_type_t type);
|
||||
@ -61,21 +116,73 @@ ORTE_DECLSPEC int orte_rml_base_unpack_tag(orte_buffer_t *buffer,
|
||||
void *dest,
|
||||
orte_std_cntr_t *num_vals,
|
||||
orte_data_type_t type);
|
||||
/*
|
||||
* Internal functions
|
||||
|
||||
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
/**
|
||||
* Post receive to get updates regarding contact information
|
||||
*
|
||||
* Post a non-blocking receive (likely during orte_init()) to receive
|
||||
* updated contact information from the HNP when it becomes available.
|
||||
* This should be called in any process that needs such updates, and
|
||||
* the receive will continue to get update callbacks until
|
||||
* orte_rml_base_comm_stop() is called.
|
||||
*
|
||||
* @retval ORTE_SUCCESS Receive successfully started
|
||||
* @retval ORTE_ERROR An unknown error occurred
|
||||
*/
|
||||
int orte_rml_base_comm_start(void);
|
||||
int orte_rml_base_comm_stop(void);
|
||||
void orte_rml_base_recv(int status, orte_process_name_t* sender,
|
||||
orte_buffer_t* buffer, orte_rml_tag_t tag,
|
||||
void* cbdata);
|
||||
|
||||
|
||||
/**
|
||||
* Stop receiving contact information updates
|
||||
*
|
||||
* Shut down the receive posted during orte_rml_base_comm_start(),
|
||||
* likely during orte_finalize().
|
||||
*
|
||||
* @retval ORTE_SUCCESS Receive succesffully cancelled.
|
||||
*/
|
||||
int orte_rml_base_comm_stop(void);
|
||||
|
||||
|
||||
/**
|
||||
* Output stream for RML debugging
|
||||
*
|
||||
* Output stream for the opal_output() code intended for RML output.
|
||||
* It will be have its verbosity set according to the MCA parameter
|
||||
* rml_base_verbose. Useable between call to orte_rml_base_open() and
|
||||
* orte_rml_base_close().
|
||||
*/
|
||||
ORTE_DECLSPEC extern int orte_rml_base_output;
|
||||
|
||||
|
||||
/**
|
||||
* List of components that are available to the RML
|
||||
*
|
||||
* List of components that are currently available to the RML
|
||||
* framework. Useable between calls to orte_rml_base_open() and
|
||||
* orte_rml_base_close().
|
||||
*
|
||||
* @note This list should not be used by code outside the RML base.
|
||||
*/
|
||||
ORTE_DECLSPEC extern opal_list_t orte_rml_base_components;
|
||||
|
||||
/* For FT only, please don't use */
|
||||
|
||||
/**
|
||||
* Component structure for the selected RML component
|
||||
*
|
||||
* Component structure pointer for the currently selected RML
|
||||
* component. Useable between calls to orte_rml_base_select() and
|
||||
* orte_rml_base_close().
|
||||
*
|
||||
* @note This pointer should not be used outside the RML base. It is
|
||||
* available outside the RML base only for the F/T component.
|
||||
*/
|
||||
ORTE_DECLSPEC extern orte_rml_component_t *orte_rml_component;
|
||||
|
||||
|
||||
/*
|
||||
* This is the base priority for a RML wrapper component
|
||||
* If there exists more than one wrapper, then the one with
|
||||
@ -83,6 +190,7 @@ ORTE_DECLSPEC extern orte_rml_component_t *orte_rml_component;
|
||||
*/
|
||||
#define RML_SELECT_WRAPPER_PRIORITY -128
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* MCA_RML_BASE_H */
|
||||
|
@ -10,6 +10,8 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -41,6 +43,9 @@
|
||||
#include "orte/mca/rml/base/rml_contact.h"
|
||||
|
||||
static bool recv_issued=false;
|
||||
static void orte_rml_base_recv(int status, orte_process_name_t* sender,
|
||||
orte_buffer_t* buffer, orte_rml_tag_t tag,
|
||||
void* cbdata);
|
||||
|
||||
int orte_rml_base_comm_start(void)
|
||||
{
|
||||
@ -86,9 +91,10 @@ int orte_rml_base_comm_stop(void)
|
||||
* DO NOT RELEASE THIS BUFFER IN THIS CODE
|
||||
*/
|
||||
|
||||
void orte_rml_base_recv(int status, orte_process_name_t* sender,
|
||||
orte_buffer_t* buffer, orte_rml_tag_t tag,
|
||||
void* cbdata)
|
||||
static void
|
||||
orte_rml_base_recv(int status, orte_process_name_t* sender,
|
||||
orte_buffer_t* buffer, orte_rml_tag_t tag,
|
||||
void* cbdata)
|
||||
{
|
||||
orte_rml_cmd_flag_t command;
|
||||
orte_std_cntr_t count;
|
||||
|
@ -1,32 +1,128 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Interface for manipulating how the RML receives contact information
|
||||
*
|
||||
* Interface for manipulating how the RML receives contact
|
||||
* information. These functions are generally used during orte_init
|
||||
* and orte_finalize.
|
||||
*/
|
||||
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/mca/ns/ns.h"
|
||||
#include "orte/mca/ns/ns_types.h"
|
||||
#include "orte/mca/gpr/gpr.h"
|
||||
#include "orte/mca/gpr/gpr_types.h"
|
||||
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/*
|
||||
* Get contact info for a process or job
|
||||
* Returns contact info for the specified process. If the vpid in the process name
|
||||
* is WILDCARD, then it returns the contact info for all processes in the specified
|
||||
* job. If the jobid is WILDCARD, then it returns the contact info for processes
|
||||
* of the specified vpid across all jobs. Obviously, combining the two WILDCARD
|
||||
* values will return contact info for everyone!
|
||||
|
||||
/* ******************************************************************** */
|
||||
|
||||
|
||||
/**
|
||||
* Create packed RML contact information for the given process names
|
||||
*
|
||||
* Create packed RML contact information for the given process names.
|
||||
* The information is provided packed in an orte_gpr_notify_data_t
|
||||
* structure.
|
||||
*
|
||||
* @note If the vpid in the process name is WILDCARD, then it returns
|
||||
* the contact info for all processes in the specified job. If the
|
||||
* jobid is WILDCARD, then it returns the contact info for processes
|
||||
* of the specified vpid across all jobs. Obviously, combining the two
|
||||
* WILDCARD values will return contact info for everyone!
|
||||
*
|
||||
* @param[in] name Process name specifying contact information needed
|
||||
* @param[out] data Contact information in GPR notify format for
|
||||
* \c name.
|
||||
*
|
||||
* @retval ORTE_SUCCESS Successfully found contact information
|
||||
* @retval ORTE_ERROR Contact information could not be found or shared
|
||||
*/
|
||||
int orte_rml_base_get_contact_info(orte_process_name_t *name,
|
||||
orte_gpr_notify_data_t **data);
|
||||
ORTE_DECLSPEC int orte_rml_base_get_contact_info(orte_process_name_t *name,
|
||||
orte_gpr_notify_data_t **data);
|
||||
|
||||
int orte_rml_base_register_subscription(orte_jobid_t jobid, char *trigger);
|
||||
|
||||
int orte_rml_base_register_contact_info(void);
|
||||
/**
|
||||
* Update the RML with contact information
|
||||
*
|
||||
* Update the RML with contact information provided from a call to
|
||||
* orte_rml_base_get_contact_info(), likely on another host.
|
||||
*
|
||||
* @note The function signature of this function is strange because it
|
||||
* also acts as a callback from the GPR on information update.
|
||||
*
|
||||
* @param[in] data Contact information in GPR notify format,
|
||||
* obtained by call to orte_rml_base_get_contact_info()
|
||||
* @prarm[in] cbdata Unused
|
||||
*/
|
||||
ORTE_DECLSPEC void orte_rml_base_contact_info_notify(orte_gpr_notify_data_t* data,
|
||||
void* cbdata);
|
||||
|
||||
void orte_rml_base_contact_info_notify(orte_gpr_notify_data_t* data,
|
||||
void* cbdata);
|
||||
|
||||
ORTE_DECLSPEC int orte_rml_base_parse_uris(const char* uri,
|
||||
orte_process_name_t* peer,
|
||||
char*** uris);
|
||||
/**
|
||||
* Register a subscription for contact information updates
|
||||
*
|
||||
* Register a subscription with the GPR to receive all contact
|
||||
* information and updates associated with \c jobid.
|
||||
*
|
||||
* @param[in] jobid Jobid for which infromation is needed
|
||||
* @param[in] trigger Trigger on which the subscription should
|
||||
* be attached
|
||||
*
|
||||
* @retval ORTE_SUCCESS Successfully subscribed to information
|
||||
* @retval ORTE_ERROR An unspecified error occurred
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_rml_base_register_subscription(orte_jobid_t jobid,
|
||||
char *trigger);
|
||||
|
||||
/**
|
||||
* Publish local contact information
|
||||
*
|
||||
* Publish local contact information into the GPR. The published
|
||||
* contact information is the same string returned from
|
||||
* orte_rml.get_contact_info().
|
||||
*
|
||||
* @retval ORTE_SUCCESS Successfully published contact information
|
||||
* @retval ORTE_ERR_OUT_OF_RESOURCE No memory for contact information available
|
||||
* @retval ORTE_ERROR An unspecified error occurred
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_rml_base_register_contact_info(void);
|
||||
|
||||
|
||||
/**
|
||||
* Parse a contact information string
|
||||
*
|
||||
* Parse a contact infromation string, such as that returned by
|
||||
* orte_rml.get_contact_info(). Generally used to extract the peer
|
||||
* name from a contact information string. It can also be used to
|
||||
* extract the contact URI strings, although this is slightly less
|
||||
* useful as the URIs may be RML componenent specific and not have
|
||||
* general meaning.
|
||||
*
|
||||
* @param[in] contact_info Contact information string for peer
|
||||
* @param[out] peer Peer name in contact_info
|
||||
* @param[out] uris URI strings for peer. May be NULL if
|
||||
* information is not needed
|
||||
*
|
||||
* @retval ORTE_SUCCESS Information successfully extraced
|
||||
* @retval ORTE_ERR_BAD_PARAM The contact_info was not a valid string
|
||||
* @retval ORTE_ERROR An unspecified error occurred
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_rml_base_parse_uris(const char* contact_inf,
|
||||
orte_process_name_t* peer,
|
||||
char*** uris);
|
||||
|
||||
END_C_DECLS
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user