2006-08-23 07:32:36 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2005-03-29 23:40:38 +04:00
|
|
|
#ifndef MCA_IOF_SVC_SUBSCRIPT_H
|
|
|
|
#define MCA_IOF_SVC_SUBSCRIPT_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A subscription routes data from a specified set
|
|
|
|
* of source endpoints to one or more destination
|
|
|
|
* endpoints.
|
|
|
|
*/
|
|
|
|
|
2006-08-23 07:32:36 +04:00
|
|
|
#include "opal/class/opal_hash_table.h"
|
|
|
|
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2005-03-29 23:40:38 +04:00
|
|
|
|
|
|
|
struct orte_iof_svc_fwd_t {
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_item_t super;
|
2005-03-29 23:40:38 +04:00
|
|
|
orte_iof_svc_pub_t* fwd_pub;
|
2007-06-09 02:59:31 +04:00
|
|
|
opal_hash_table_t fwd_seq_hash;
|
2005-03-29 23:40:38 +04:00
|
|
|
};
|
|
|
|
typedef struct orte_iof_svc_fwd_t orte_iof_svc_fwd_t;
|
|
|
|
|
|
|
|
|
|
|
|
OBJ_CLASS_DECLARATION(orte_iof_svc_fwd_t);
|
|
|
|
|
|
|
|
struct orte_iof_svc_sub_t {
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_item_t super;
|
2007-06-09 02:59:31 +04:00
|
|
|
orte_process_name_t origin_name;
|
|
|
|
orte_ns_cmp_bitmask_t origin_mask;
|
|
|
|
orte_iof_base_tag_t origin_tag;
|
|
|
|
orte_process_name_t target_name;
|
|
|
|
orte_ns_cmp_bitmask_t target_mask;
|
|
|
|
orte_iof_base_tag_t target_tag;
|
2005-03-29 23:40:38 +04:00
|
|
|
orte_iof_base_endpoint_t* sub_endpoint;
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_t sub_forward;
|
2007-06-09 02:59:31 +04:00
|
|
|
bool has_been_acked;
|
|
|
|
uint32_t last_ack_forwarded;
|
2005-03-29 23:40:38 +04:00
|
|
|
};
|
|
|
|
typedef struct orte_iof_svc_sub_t orte_iof_svc_sub_t;
|
|
|
|
|
|
|
|
OBJ_CLASS_DECLARATION(orte_iof_svc_sub_t);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Lookup an existing subscription.
|
|
|
|
*/
|
|
|
|
|
|
|
|
orte_iof_svc_sub_t* orte_iof_svc_sub_lookup(
|
2007-06-09 02:59:31 +04:00
|
|
|
const orte_process_name_t* origin
|
2005-03-29 23:40:38 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a subscription
|
|
|
|
*/
|
|
|
|
|
|
|
|
int orte_iof_svc_sub_create(
|
2007-06-09 02:59:31 +04:00
|
|
|
const orte_process_name_t *origin_name,
|
|
|
|
orte_ns_cmp_bitmask_t origin_mask,
|
|
|
|
orte_iof_base_tag_t origin_tag,
|
|
|
|
const orte_process_name_t *target_name,
|
|
|
|
orte_ns_cmp_bitmask_t target_mask,
|
|
|
|
orte_iof_base_tag_t target_tag);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Receive an ACK from a single endpoint on a subscription
|
|
|
|
*/
|
|
|
|
|
|
|
|
void orte_iof_svc_sub_ack(
|
|
|
|
const orte_process_name_t* peer,
|
|
|
|
orte_iof_base_msg_header_t* hdr,
|
|
|
|
bool do_close);
|
2005-03-29 23:40:38 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Cleanup/remove a subscription
|
|
|
|
*/
|
|
|
|
|
|
|
|
int orte_iof_svc_sub_delete(
|
2007-06-09 02:59:31 +04:00
|
|
|
const orte_process_name_t *origin_name,
|
|
|
|
orte_ns_cmp_bitmask_t origin_mask,
|
|
|
|
orte_iof_base_tag_t origin_tag,
|
|
|
|
const orte_process_name_t *target_name,
|
|
|
|
orte_ns_cmp_bitmask_t target_mask,
|
|
|
|
orte_iof_base_tag_t target_tag);
|
2005-03-29 23:40:38 +04:00
|
|
|
|
2005-10-07 01:21:26 +04:00
|
|
|
int orte_iof_svc_sub_delete_all(
|
2007-06-09 02:59:31 +04:00
|
|
|
const orte_process_name_t *target_name);
|
2005-10-07 01:21:26 +04:00
|
|
|
|
2005-03-29 23:40:38 +04:00
|
|
|
/**
|
|
|
|
* Forward message to any endpoints that
|
|
|
|
* match the subscription.
|
|
|
|
*/
|
|
|
|
|
|
|
|
int orte_iof_svc_sub_forward(
|
|
|
|
orte_iof_svc_sub_t* sub,
|
|
|
|
const orte_process_name_t* src,
|
|
|
|
orte_iof_base_msg_header_t* hdr,
|
2005-10-07 01:21:26 +04:00
|
|
|
const unsigned char* data,
|
|
|
|
bool *forward);
|
2005-03-29 23:40:38 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check to see if the published endpoint matches
|
|
|
|
* the subscription.
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool orte_iof_svc_fwd_match(
|
|
|
|
orte_iof_svc_sub_t* sub,
|
|
|
|
orte_iof_svc_pub_t* pub);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create or remove a forwarding entry on the
|
|
|
|
* current subscription.
|
|
|
|
*/
|
|
|
|
|
|
|
|
int orte_iof_svc_fwd_create(
|
|
|
|
orte_iof_svc_sub_t* sub,
|
|
|
|
orte_iof_svc_pub_t* pub);
|
|
|
|
|
|
|
|
int orte_iof_svc_fwd_delete(
|
|
|
|
orte_iof_svc_sub_t* sub,
|
|
|
|
orte_iof_svc_pub_t* pub);
|
|
|
|
|
2006-08-23 07:32:36 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-03-29 23:40:38 +04:00
|
|
|
#endif
|
|
|
|
|