Main Page   Compound List   File List   Compound Members   File Members  

ce.h File Reference

Go to the source code of this file.

Compounds

struct  ce_jops_t
struct  ce_local_state_t
struct  ce_view_id_t
struct  ce_view_state_t

Defines

#define CE_DEFAULT_PROTOCOL
#define CE_DEFAULT_PROPERTIES   "Gmp:Sync:Heal:Switch:Frag:Suspect:Flow"
#define record_create(type, var)   ((type)malloc(sizeof(*var)))
#define record_free(rec)   free(rec)
#define record_clear(rec)   memset(rec, 0, sizeof(*rec))

Typedefs

typedef double ce_float_t
typedef int ce_bool_t
typedef int ce_rank_t
typedef int ce_ltime_t
typedef int ce_len_t
typedef void * ce_env_t
typedef double ce_time_t
typedef char * ce_endpt_t
typedef char * ce_addr_t
typedef char * ce_data_t
typedef ce_endpt_tce_endpt_array_t
typedef ce_rank_tce_rank_array_t
typedef ce_addr_tce_addr_array_t
typedef ce_view_id_t ** ce_view_id_array_t
typedef void(* ce_appl_install_t )(ce_env_t, ce_local_state_t *, ce_view_state_t *)
typedef void(* ce_appl_exit_t )(ce_env_t)
typedef void(* ce_appl_receive_cast_t )(ce_env_t, ce_rank_t, ce_len_t, ce_data_t)
typedef void(* ce_appl_receive_send_t )(ce_env_t, ce_rank_t, ce_len_t, ce_data_t)
typedef void(* ce_appl_flow_block_t )(ce_env_t, ce_rank_t, ce_bool_t)
typedef void(* ce_appl_block_t )(ce_env_t)
typedef void(* ce_appl_heartbeat_t )(ce_env_t, ce_time_t)
typedef ce_appl_intf_t ce_appl_intf_t
typedef int CE_SOCKET
typedef void(* ce_handler_t )(void *)

Functions

void ce_view_full_free (ce_local_state_t *ls, ce_view_state_t *vs)
void ce_jops_free (ce_jops_t *)
ce_appl_intf_tce_create_intf (ce_env_t env, ce_appl_exit_t exit, ce_appl_install_t install, ce_appl_flow_block_t flow_block, ce_appl_block_t block, ce_appl_receive_cast_t cast, ce_appl_receive_send_t send, ce_appl_heartbeat_t heartbeat)
void ce_Init (int argc, char **argv)
void ce_Main_loop ()
void ce_Join (ce_jops_t *ops, ce_appl_intf_t *c_appl)
void ce_Leave (ce_appl_intf_t *c_appl)
void ce_Cast (ce_appl_intf_t *c_appl, ce_len_t len, ce_data_t buf)
void ce_Send (ce_appl_intf_t *c_appl, ce_rank_array_t dests, ce_len_t len, ce_data_t buf)
void ce_Send1 (ce_appl_intf_t *c_appl, ce_rank_t dest, ce_len_t len, ce_data_t buf)
void ce_Prompt (ce_appl_intf_t *c_appl)
void ce_Suspect (ce_appl_intf_t *c_appl, ce_rank_array_t suspects)
void ce_XferDone (ce_appl_intf_t *c_appl)
void ce_Rekey (ce_appl_intf_t *c_appl)
void ce_ChangeProtocol (ce_appl_intf_t *c_appl, char *protocol_name)
void ce_ChangeProperties (ce_appl_intf_t *c_appl, char *properties)
void ce_MLPrintOverride (void(*handler)(char *msg))
void ce_MLUncaughtException (void(*handler)(char *info))
void ce_AddSockRecv (CE_SOCKET socket, ce_handler_t handler, ce_env_t env)
void ce_RmvSockRecv (CE_SOCKET socket)

Variables

ce_view_id_t ce_view_id_t
ce_view_state_t ce_view_state_t
ce_local_state_t ce_local_state_t
ce_jops_t ce_jops_t


Detailed Description

CE is a C-interface to the Ensemble system. It attempt to provide a simple to use basis from which to build Ensemble applications. To use this interface, one has to read this H file, and link with the ce library --- libce.a on Unix systems, and libce.lib on WIN32.


Define Documentation

#define CE_DEFAULT_PROPERTIES   "Gmp:Sync:Heal:Switch:Frag:Suspect:Flow"
 

The default set of properties. A stack built with these properties will provide relibale sender-ordered multicast and point-to-point communication, as well as virtual synchrony.

#define CE_DEFAULT_PROTOCOL
 

Value:

"Top:Heal:Switch:Leave:" \
    "Inter:Intra:Elect:Merge:Sync:Suspect:" \
    "Stable:Vsync:Frag_Abv:Top_appl:" \
    "Frag:Pt2ptw:Mflow:Pt2pt:Mnak:Bottom"
The default set of layers.

#define record_clear rec      memset(rec, 0, sizeof(*rec))
 

Clear a record.

#define record_create type,
var      ((type)malloc(sizeof(*var)))
 

Create a record.

#define record_free rec      free(rec)
 

Free a record.


Typedef Documentation

typedef int CE_SOCKET
 

CE_Socket allows an os-independent representation for sockets.

typedef ce_addr_t* ce_addr_array_t
 

Arrays of addresses. A null terminated array containing pointers to addresses.

typedef char* ce_addr_t
 

The type of addresses.

typedef void (* ce_appl_block_t)(ce_env_t)
 

Block is called whenever a view change is forthcoming. All applications are blocked, the old view is stabilized, cleaned, and way is made for the new view.

typedef void (* ce_appl_exit_t)(ce_env_t)
 

Exit is called when the member leaves.

typedef void (* ce_appl_flow_block_t)(ce_env_t, ce_rank_t, ce_bool_t)
 

FlowBlock is called whenever there a flow-control problems, and the application should refrain from sending messages for a while.

typedef void (* ce_appl_heartbeat_t)(ce_env_t, ce_time_t)
 

Heartbeat is called every timeout. The timeout is specified in the jops structure.

typedef void (* ce_appl_install_t)(ce_env_t, ce_local_state_t*, ce_view_state_t*)
 

Install is called whenever a new view is installed.

typedef struct ce_appl_intf_t ce_appl_intf_t
 

The type of application interface. This is created by the constructor ce_create_intf. There is no need for a destructor because Ensemble frees the interface-structure and all related memory once the Exit function is called. An application interface is an opaque handle which allows using an Ensemble stack.

typedef void (* ce_appl_receive_cast_t)(ce_env_t, ce_rank_t, ce_len_t, ce_data_t)
 

ReceiveCast is called whenever a mulicast message arrives.

typedef void (* ce_appl_receive_send_t)(ce_env_t, ce_rank_t, ce_len_t, ce_data_t)
 

ReceiveSend is called whenever a point-to-point message arrives.

typedef int ce_bool_t
 

The type of boolean values.

typedef char* ce_data_t
 

The type of data.

typedef ce_endpt_t* ce_endpt_array_t
 

Arrays of endpoints, these are null terminated arrays of pointers to ce_endpt_t.

typedef char* ce_endpt_t
 

The type of endpoint names. This name does not change throughout an endpoint's life.

typedef void* ce_env_t
 

The type of application environments. An application can set its envrionmet for a specific Ensemble stack, each callback on that stack will use this variable.

typedef double ce_float_t
 

The type of floats used here. Should be the same as an ML float.

typedef void (* ce_handler_t)(void*)
 

A handler called when there is input to process on a socket.

typedef int ce_len_t
 

The type of message length, an integer.

typedef int ce_ltime_t
 

The type of logical time. Used in defining view id's.

typedef ce_rank_t* ce_rank_array_t
 

Arrays of ranks, this is a null terminated array of integers.

typedef int ce_rank_t
 

The type of member ranks, an integer. Each group member is ranked between 0 and (nmembers-1), this allows a very simple addressing scheme.

typedef double ce_time_t
 

The type of time.

typedef ce_view_id_t** ce_view_id_array_t
 

A null terminated array of pointers view_ids.


Function Documentation

void ce_AddSockRecv CE_SOCKET   socket,
ce_handler_t   handler,
ce_env_t   env
 

This call adds a socket to the list Ensemble listens to. When input on the socket occurs, this handler will be invoked on the specified environment variable.

Parameters:
socket   The socket to listen to.
handler   A handler.
env   An envrionment variable.

void ce_Cast ce_appl_intf_t *   c_appl,
ce_len_t   len,
ce_data_t   buf
 

Send a multicast message to the group.

Parameters:
c_appl   The stack.
len   The length of the message.
buf   The data to send. The buffer is freed by Ensemble.

void ce_ChangeProperties ce_appl_intf_t *   c_appl,
char *   properties
 

Request a protocol change (specify properties).

Parameters:
c_appl   The stack.
properties   a string contaning a colon separated list of properties. For example: "Gmp:Sync:Heal:Switch:Frag:Suspect:Flow:Xfer" The properties string is consumed.

void ce_ChangeProtocol ce_appl_intf_t *   c_appl,
char *   protocol_name
 

Request a protocol change.

Parameters:
c_appl   The stack.
protocol_name   a string describing the new protocol. The string is a colon separated list of layers, for example: "Top:Heal:Switch:Leave: Inter:Intra:Elect:Merge:Sync:Suspect: Stable:Vsync:Frag_Abv:Top_appl: Frag:Pt2ptw:Mflow:Pt2pt:Mnak:Bottom" The protocl_name is consumed.

void ce_Init int   argc,
char **   argv
 

Initialize the Ensemble data structures, and process the command line arguemnts.

void ce_Join ce_jops_t *   ops,
ce_appl_intf_t *   c_appl
 

Join a group. The ops structure is not freed by the System.

Parameters:
ops   A structure describing the join options for this stack.
c_appl   An application-interface created earlier.

void ce_Leave ce_appl_intf_t *   c_appl
 

Leave a group. After this downcall, the context becomes invalid.

Parameters:
c_appl   The stack that should be closed.

void ce_MLPrintOverride void(*   handler)(char *msg)
 

Allows overriding the default ML value printer. For the power-user.

void ce_MLUncaughtException void(*   handler)(char *info)
 

Allows overriding the default ML exception handler. For the power-user.

void ce_Main_loop  
 

Transfer control to Ensemble, and start the main loop.

void ce_Prompt ce_appl_intf_t *   c_appl
 

Ask for a new View.

Parameters:
c_appl   The stack.

void ce_Rekey ce_appl_intf_t *   c_appl
 

Ask the system to rekey.

Parameters:
c_appl   The stack.

void ce_RmvSockRecv CE_SOCKET   socket
 

Remove a socket from the list Ensemble listens to.

Parameters:
socket   The socket to remove.

void ce_Send ce_appl_intf_t *   c_appl,
ce_rank_array_t   dests,
ce_len_t   len,
ce_data_t   buf
 

Send a point-to-point message to a set of group members.

Parameters:
c_appl   The stack.
dests   A null terminated sequence of integers.
len   The length of the message.
buf   The data to send. The buffer is consumed.

void ce_Send1 ce_appl_intf_t *   c_appl,
ce_rank_t   dest,
ce_len_t   len,
ce_data_t   buf
 

Send a point-to-point message to the specified group member.

Parameters:
c_appl   The stack.
dest   The destination.
len   The length of the message.
buf   The data to send. The buffer is consumed.

void ce_Suspect ce_appl_intf_t *   c_appl,
ce_rank_array_t   suspects
 

Report specified group members as failure-suspected.

Parameters:
c_appl   The stack.
suspects   A null terminated list of member ranks. The array is consumed.

void ce_XferDone ce_appl_intf_t *   c_appl
 

Inform Ensemble that the state-transfer is complete.

Parameters:
c_appl   The stack.

ce_appl_intf_t* ce_create_intf ce_env_t   env,
ce_appl_exit_t   exit,
ce_appl_install_t   install,
ce_appl_flow_block_t   flow_block,
ce_appl_block_t   block,
ce_appl_receive_cast_t   cast,
ce_appl_receive_send_t   send,
ce_appl_heartbeat_t   heartbeat
 

A constructor for application interfaces.

Parameters:
env   The application environemt, includes application specific data. All callbacks on this stack will be made with the variable.
exit   The callback used when the stack is destroyed.
install   The callback performed when a new view is installed.
flow_block   The callback used when flow-control requires the application to block, or unblock. This callback is only a recommendation, it does not actually block or unblock the application.
block   A callback used prior to performing a view change. After block is called, applications cannot send messages, though they may receive them. The application is unblocked * when a new view is installed.
cast   Received a multicast a message.
send   Received a point-to-point message.
heartbeat   A callback performed periodically. The timeout duration is passed to Ensemble in the ce_jops_t structure.

void ce_jops_free ce_jops_t *  
 

Free a jops structure.

Parameters:
jops   A join-options structure.

void ce_view_full_free ce_local_state_t *   ls,
ce_view_state_t *   vs
 

Free a local-state and a view-state.

Parameters:
ls   A local-state structure.
vs   A view-state structure.


Variable Documentation

struct ce_jops_t ce_jops_t
 

A request structure that describes the list of properties an application wishes from a created endpoint.

struct ce_local_state_t ce_local_state_t
 

The local state describes the group-state pertaining to the local member.

struct ce_view_id_t ce_view_id_t
 

The view_id structure describes the logical view id. The basic Ensemble supported abstraction is a group, where members can join and leave dynamically. Each membership change is also called a view change, because it changes the composition of the group. Each view has a view_id which is composed of the group leader, and the logical time. A view_id is unique, and there is a partial order on view_id's.

struct ce_view_state_t ce_view_state_t
 

The view_state describes the current state of the group, it includes the Ensemble version number, the group name, the rank of the coordinator, and more.


Generated at Thu Sep 13 13:12:46 2001 for CE by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001