2004-06-12 14:21:26 +04:00
|
|
|
/*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-06-12 14:21:26 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/** @file:
|
|
|
|
*
|
|
|
|
* The Open MPI general purpose registry.
|
|
|
|
*
|
|
|
|
* The Open MPI system contains a general purpose registry for use by both
|
|
|
|
* applications and internal systems to dynamically share information. For
|
|
|
|
* speed purposes, the registry is divided into "segments", each labelled
|
|
|
|
* with an appropriate "token" string that describes its contents. Segments
|
|
|
|
* are automatically provided for the "universe" and for each MPI CommWorld.
|
|
|
|
* At this time, all segments may be accessed by any application within the universe, thus
|
|
|
|
* providing a mechanism for cross-CommWorld communications (with the requirement
|
|
|
|
* that all participating CommWorlds must reside within the same universe). In the future,
|
|
|
|
* some form of security may be provided to limit access privileges between
|
|
|
|
* segments.
|
|
|
|
*
|
|
|
|
* Within each registry segment, there exists a list of objects that have
|
|
|
|
* been "put" onto the registry. Each object must be tagged with at least
|
|
|
|
* one token, but may be tagged with as many tokens as the creator desires.
|
|
|
|
* Retrieval requests must specify the segment and at least one token, but
|
|
|
|
* can specify an arbitrary number of tokens to describe the search. The registry
|
|
|
|
* will return a list of all objects that meet the search criteria.
|
|
|
|
*
|
|
|
|
* Tokens are defined as character strings, thus allowing for clarity in
|
|
|
|
* the program. However, for speed purposes, tokens are translated into
|
|
|
|
* integer keys prior to storing an object. A table of token-key pairs
|
|
|
|
* is independently maintained for each registry segment. Users can obtain
|
|
|
|
* an index of tokens within a dictionary by requesting it through the ompi_registry_index()
|
|
|
|
* function.
|
|
|
|
*
|
|
|
|
* The registry also provides a subscription capability whereby a caller
|
|
|
|
* can subscribe to a stored object and receive notification when various actions
|
|
|
|
* are performed on that object. Currently supported actions include modification,
|
|
|
|
* the addition of another subscriber, and deletion. Notifications are sent via
|
|
|
|
* the OOB communication channel.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-06-30 01:17:10 +04:00
|
|
|
#ifndef MCA_GPR_BASE_H_
|
|
|
|
#define MCA_GRP_BASE_H_
|
|
|
|
|
2004-06-12 14:21:26 +04:00
|
|
|
/*
|
|
|
|
* includes
|
|
|
|
*/
|
2004-08-19 23:30:53 +04:00
|
|
|
#include "ompi_config.h"
|
|
|
|
|
2004-11-20 22:12:43 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <string.h>
|
2005-01-20 03:03:23 +03:00
|
|
|
#ifdef HAVE_UNISTD_H
|
2004-11-20 22:12:43 +03:00
|
|
|
#include <unistd.h>
|
2005-01-20 03:03:23 +03:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_LIBGEN_H
|
2004-11-20 22:12:43 +03:00
|
|
|
#include <libgen.h>
|
2005-01-20 03:03:23 +03:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2004-06-12 14:21:26 +04:00
|
|
|
#include <sys/types.h>
|
2005-01-20 03:03:23 +03:00
|
|
|
#endif
|
2004-06-12 14:21:26 +04:00
|
|
|
|
2004-11-20 22:12:43 +03:00
|
|
|
#include "include/constants.h"
|
|
|
|
|
|
|
|
#include "threads/mutex.h"
|
|
|
|
#include "threads/condition.h"
|
|
|
|
|
|
|
|
#include "runtime/runtime.h"
|
|
|
|
|
|
|
|
#include "util/output.h"
|
|
|
|
#include "util/proc_info.h"
|
|
|
|
#include "util/sys_info.h"
|
|
|
|
#include "util/bufpack.h"
|
|
|
|
|
2004-06-12 14:21:26 +04:00
|
|
|
#include "class/ompi_list.h"
|
2004-11-20 22:12:43 +03:00
|
|
|
|
2004-06-30 01:17:10 +04:00
|
|
|
#include "mca/mca.h"
|
2004-11-20 22:12:43 +03:00
|
|
|
#include "mca/base/base.h"
|
|
|
|
#include "mca/base/mca_base_param.h"
|
|
|
|
#include "mca/oob/base/base.h"
|
|
|
|
|
2004-06-16 09:41:13 +04:00
|
|
|
#include "mca/gpr/gpr.h"
|
|
|
|
|
2004-06-30 01:17:10 +04:00
|
|
|
/*
|
2004-11-20 22:12:43 +03:00
|
|
|
* Global functions for MCA overall collective open and close
|
|
|
|
*/
|
2004-06-30 01:17:10 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2004-11-20 22:12:43 +03:00
|
|
|
OMPI_DECLSPEC int mca_gpr_base_open(void);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_select(bool *allow_multi_user_threads,
|
|
|
|
bool *have_hidden_threads);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_close(void);
|
2004-06-12 14:21:26 +04:00
|
|
|
|
2004-11-20 22:12:43 +03:00
|
|
|
/* general usage functions */
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_delete_segment(ompi_buffer_t cmd, bool silent, char *segment);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_delete_segment(ompi_buffer_t buffer);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_delete_object(ompi_buffer_t buffer, bool silent,
|
|
|
|
ompi_registry_mode_t mode,
|
|
|
|
char *segment, char **tokens);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_delete_object(ompi_buffer_t buffer);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_index(ompi_buffer_t cmd, char *segment);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_index(ompi_buffer_t cmd, ompi_list_t *return_list);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_cleanup(ompi_buffer_t cmd, mca_ns_base_jobid_t jobid);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_synchro(ompi_buffer_t cmd,
|
|
|
|
ompi_registry_synchro_mode_t synchro_mode,
|
|
|
|
ompi_registry_mode_t mode,
|
|
|
|
char *segment, char **tokens, int trigger);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_synchro(ompi_buffer_t buffer,
|
|
|
|
ompi_registry_notify_id_t *remote_idtag);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_cancel_synchro(ompi_buffer_t cmd,
|
|
|
|
bool silent,
|
|
|
|
ompi_registry_notify_id_t remote_idtag);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_cancel_synchro(ompi_buffer_t buffer);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_subscribe(ompi_buffer_t cmd,
|
|
|
|
ompi_registry_mode_t mode,
|
|
|
|
ompi_registry_notify_action_t action,
|
|
|
|
char *segment, char **tokens);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_subscribe(ompi_buffer_t buffer,
|
|
|
|
ompi_registry_notify_id_t *remote_idtag);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_unsubscribe(ompi_buffer_t cmd, bool silent,
|
|
|
|
ompi_registry_notify_id_t remote_idtag);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_unsubscribe(ompi_buffer_t buffer);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_put(ompi_buffer_t cmd, bool silent,
|
|
|
|
ompi_registry_mode_t mode, char *segment,
|
|
|
|
char **tokens, ompi_registry_object_t object,
|
|
|
|
ompi_registry_object_size_t size);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_put(ompi_buffer_t buffer);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_get(ompi_buffer_t cmd,
|
|
|
|
ompi_registry_mode_t mode,
|
|
|
|
char *segment, char **tokens);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_get(ompi_buffer_t buffer, ompi_list_t *return_list);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_dump(ompi_buffer_t cmd);
|
|
|
|
OMPI_DECLSPEC void mca_gpr_base_print_dump(ompi_buffer_t buffer, int output_id);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_cleanup_job(ompi_buffer_t buffer, mca_ns_base_jobid_t jobid);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_cleanup_proc(ompi_buffer_t buffer, bool purge, ompi_process_name_t *proc);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_test_internals(ompi_buffer_t cmd, int level);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_test_internals(ompi_buffer_t buffer, ompi_list_t *return_list);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_notify_off(ompi_buffer_t cmd,
|
|
|
|
ompi_process_name_t *proc,
|
|
|
|
ompi_registry_notify_id_t sub_number);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_notify_off(ompi_buffer_t buffer);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_notify_on(ompi_buffer_t cmd,
|
|
|
|
ompi_process_name_t *proc,
|
|
|
|
ompi_registry_notify_id_t sub_number);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_notify_on(ompi_buffer_t buffer);
|
|
|
|
|
2004-12-09 07:54:37 +03:00
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_assign_ownership(ompi_buffer_t cmd, bool silent,
|
2004-11-20 22:12:43 +03:00
|
|
|
mca_ns_base_jobid_t jobid, char *segment);
|
2004-12-09 07:54:37 +03:00
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_assign_ownership(ompi_buffer_t buffer);
|
2004-11-20 22:12:43 +03:00
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_get_startup_msg(ompi_buffer_t cmd, mca_ns_base_jobid_t jobid);
|
|
|
|
OMPI_DECLSPEC ompi_buffer_t mca_gpr_base_unpack_get_startup_msg(ompi_buffer_t buffer, ompi_list_t *recipients);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_triggers_active_cmd(ompi_buffer_t cmd, mca_ns_base_jobid_t jobid);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_triggers_active_cmd(ompi_buffer_t cmd);
|
|
|
|
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_pack_triggers_inactive_cmd(ompi_buffer_t cmd, mca_ns_base_jobid_t jobid);
|
|
|
|
OMPI_DECLSPEC int mca_gpr_base_unpack_triggers_inactive_cmd(ompi_buffer_t cmd);
|
2004-12-10 20:53:41 +03:00
|
|
|
|
2004-11-17 01:53:33 +03:00
|
|
|
|
2004-11-17 05:30:07 +03:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2004-11-17 01:53:33 +03:00
|
|
|
|
2004-11-20 22:12:43 +03:00
|
|
|
/*
|
|
|
|
* globals that might be needed
|
|
|
|
*/
|
2005-01-20 03:03:23 +03:00
|
|
|
OMPI_DECLSPEC extern int mca_gpr_base_output;
|
|
|
|
OMPI_DECLSPEC extern mca_gpr_base_module_t ompi_registry; /* holds selected module's function pointers */
|
|
|
|
OMPI_DECLSPEC extern bool mca_gpr_base_selected;
|
|
|
|
OMPI_DECLSPEC extern ompi_list_t mca_gpr_base_components_available;
|
|
|
|
OMPI_DECLSPEC extern mca_gpr_base_component_t mca_gpr_base_selected_component;
|
2004-11-20 22:12:43 +03:00
|
|
|
|
|
|
|
|
2004-06-30 01:17:10 +04:00
|
|
|
#endif
|