NewMadeleine

Documentation

Multicast interface

Provide abstraction to multicast data to several nodes in a dynamic fashion: More...

typedef struct nm_mcast_service_s * nm_mcast_service_t
 Public abstraction for a mcast service. More...
 
typedef void(* nm_mcast_send_notifier_t) (void *p_ref)
 Public abstraction for the callback called when the mcast_send is completed. More...
 
typedef struct nm_mcast_req_s nm_mcast_t
 Public abstraction for nm_mcast_req_s. More...
 
nm_mcast_service_t nm_mcast_init (nm_comm_t p_comm)
 Initializes the mcast interface. More...
 
void nm_mcast_finalize (nm_mcast_service_t nm_mcast)
 Release the mcast interface. More...
 
void nm_mcast_send (nm_mcast_service_t nm_mcast, nm_comm_t p_recv_comm, int *p_dests, int *p_prios, int n_dests, nm_tag_t tag, struct nm_data_s *p_data, nm_len_t hlen, nm_coll_tree_kind_t tree_kind)
 Send data in a blocking mode. More...
 
void nm_mcast_send_init (nm_mcast_service_t nm_mcast, nm_mcast_t *p_mcast)
 Initialize a multicast send. More...
 
void nm_mcast_send_set_notifier (nm_mcast_t *p_mcast, nm_mcast_send_notifier_t notifier, void *p_ref)
 Attach a notifier to mcast_send, to be called when the root node of the multicast ends its sends. More...
 
void nm_mcast_isend (nm_mcast_t *p_mcast, nm_comm_t p_comm, int *p_dests, int *p_prios, int n_dests, nm_tag_t tag, struct nm_data_s *p_data, nm_len_t hlen, nm_coll_tree_kind_t tree_kind)
 Send data in a non-blocking mode. More...
 
void nm_mcast_wait (nm_mcast_t *p_mcast)
 Wait for a non-blocking multicast send. More...
 
void nm_mcast_send_destroy (nm_mcast_t *p_mcast)
 Free data allocated by nm_mcast_send_init() More...
 
void nm_mcast_set_default_tree_kind (nm_mcast_service_t nm_mcast, const nm_coll_tree_kind_t kind)
 Change the default tree used for routing data. More...
 

Detailed Description

Provide abstraction to multicast data to several nodes in a dynamic fashion:

See examples/mcast/nm_mcast_basic.c for a basic example.

Three types of tree can be used for multicasting: binomial, binary or chained trees. Binomial tree is the default scheme. You can set the default type of tree to use by calling nm_mcast_set_default_tree_kind() of by defining the environment variable NMAD_MCAST_TREE to binary, binomial or chain. Moreover you can change the type of tree directly when calling nm_mcast_send().

Typedef Documentation

◆ nm_mcast_send_notifier_t

typedef void(* nm_mcast_send_notifier_t) (void *p_ref)

Public abstraction for the callback called when the mcast_send is completed.

Definition at line 59 of file nm_mcast_interface.h.

◆ nm_mcast_service_t

typedef struct nm_mcast_service_s* nm_mcast_service_t

Public abstraction for a mcast service.

Definition at line 56 of file nm_mcast_interface.h.

◆ nm_mcast_t

typedef struct nm_mcast_req_s nm_mcast_t

Public abstraction for nm_mcast_req_s.

Definition at line 72 of file nm_mcast_interface.h.

Function Documentation

◆ nm_mcast_finalize()

void nm_mcast_finalize ( nm_mcast_service_t  nm_mcast)

Release the mcast interface.

Examples
nm_mcast_basic.c.

◆ nm_mcast_init()

nm_mcast_service_t nm_mcast_init ( nm_comm_t  p_comm)

Initializes the mcast interface.

Parameters
p_commcommunicator used for the RPC service for mcast
Examples
nm_mcast_basic.c.

◆ nm_mcast_isend()

void nm_mcast_isend ( nm_mcast_t p_mcast,
nm_comm_t  p_comm,
int *  p_dests,
int *  p_prios,
int  n_dests,
nm_tag_t  tag,
struct nm_data_s p_data,
nm_len_t  hlen,
nm_coll_tree_kind_t  tree_kind 
)

Send data in a non-blocking mode.

Parameters
p_mcasthas to initialized with nm_mcast_send_init(). See nm_mcast_send() for details about other parameters.

◆ nm_mcast_send()

void nm_mcast_send ( nm_mcast_service_t  nm_mcast,
nm_comm_t  p_recv_comm,
int *  p_dests,
int *  p_prios,
int  n_dests,
nm_tag_t  tag,
struct nm_data_s p_data,
nm_len_t  hlen,
nm_coll_tree_kind_t  tree_kind 
)

Send data in a blocking mode.

Parameters
nm_mcasta mcast service initiliazed with nm_mcast_init().
p_recv_comma communicator (must be the same as the one used by the nm_sr_recv).
destsan array of ranks which are recipients of the multicast. This array can be a subset of the communicator p_comm.
priosan array providing priorities for each recipient. Can be set to NULL. To respect priorities, prios has to be sorted in descending order (and array dests ordered such as prios[i] is the priority of the send to the node dests[i]). Higher is the integer, higher is the priority.
n_deststhe number of recipients of the multicast (size of the array dests).
tagthe message tag.
p_dataiterator on the data to send, the memory targeted by this pointer has to be valid until the mcast ends.
hlensize of the user header.
tree_kindtype of tree to broadcast the data. If the user provides NM_COLL_TREE_DEFAULT, the type set by nm_mcast_set_default_tree_kind() will be used.
Examples
nm_mcast_basic.c.

◆ nm_mcast_send_destroy()

void nm_mcast_send_destroy ( nm_mcast_t p_mcast)

Free data allocated by nm_mcast_send_init()

◆ nm_mcast_send_init()

void nm_mcast_send_init ( nm_mcast_service_t  nm_mcast,
nm_mcast_t p_mcast 
)

Initialize a multicast send.

Useful to then wait the end of the multicast send or to set a callback. To be released with nm_mcast_send_destroy().

◆ nm_mcast_send_set_notifier()

void nm_mcast_send_set_notifier ( nm_mcast_t p_mcast,
nm_mcast_send_notifier_t  notifier,
void *  p_ref 
)

Attach a notifier to mcast_send, to be called when the root node of the multicast ends its sends.

◆ nm_mcast_set_default_tree_kind()

void nm_mcast_set_default_tree_kind ( nm_mcast_service_t  nm_mcast,
const nm_coll_tree_kind_t  kind 
)

Change the default tree used for routing data.

It will be the rooting algorithm used if the user provides NM_COLL_TREE_DEFAULT to nm_mcast_*send functions.

◆ nm_mcast_wait()

void nm_mcast_wait ( nm_mcast_t p_mcast)

Wait for a non-blocking multicast send.