nm_coll_trees.h
Go to the documentation of this file.
58 };
78void nm_coll_tree_init(struct nm_coll_tree_info_s*p_tree, nm_coll_tree_kind_t kind, int n, int self, int root);
81void nm_coll_tree_init_group(struct nm_coll_tree_info_s*p_tree, nm_coll_tree_kind_t kind, nm_group_t p_group, int root);
87void nm_coll_tree_step(const struct nm_coll_tree_info_s*p_tree, int step, int*p_parent, int*p_children, int*n_children);
100void nm_coll_tree_descendants(const struct nm_coll_tree_info_s*p_tree, int step, int self, int*p_descendants);
106nm_coll_tree_kind_t nm_coll_tree_heuristic(int comm_size, nm_len_t data_size, const struct nm_coll_topology_s*p_topology);
109nm_coll_tree_kind_t nm_coll_tree_weight_heuristic(int comm_size, nm_len_t data_size, const struct nm_coll_topology_s*p_topology);
249static inline void nm_coll_tree_status_init(struct nm_coll_tree_status_s*p_status, nm_session_t p_session,
257 p_status->children_requests = padico_malloc((1 + p_status->tree.max_arity) * sizeof(nm_sr_request_t));
305static inline void nm_coll_tree_set_notifier(struct nm_coll_tree_status_s*p_coll_tree, nm_sr_request_t*p_req,
308 nm_sr_request_monitor_with_ref(p_coll_tree->p_session, p_req, NM_SR_EVENT_FINALIZED, p_notifier, p_coll_tree);
311static inline int nm_coll_tree_req_index(struct nm_coll_tree_status_s*p_coll_tree, nm_sr_request_t*p_request)
nm_gate_t nm_group_get_gate(nm_group_t p_group, int rank)
static int nm_coll_tree_max_weight(const struct nm_coll_tree_info_s *p_tree)
find the weight for the local process, without knowing at wich step we have a parent
Definition nm_coll_trees.h:115
nm_coll_tree_kind_t nm_coll_tree_kind_by_name(const char *s_kind)
static void nm_coll_tree_recv(struct nm_coll_tree_status_s *p_coll_tree, int from, struct nm_data_s *p_data, nm_sr_request_t *p_req)
Definition nm_coll_trees.h:296
static void nm_coll_tree_issend(struct nm_coll_tree_status_s *p_coll_tree, int dest, struct nm_data_s *p_data, nm_sr_request_t *p_req)
Definition nm_coll_trees.h:285
static void nm_coll_tree_set_notifier(struct nm_coll_tree_status_s *p_coll_tree, nm_sr_request_t *p_req, void(*p_notifier)(nm_sr_event_t, const nm_sr_event_info_t *, void *))
Definition nm_coll_trees.h:305
void nm_coll_tree_init_group(struct nm_coll_tree_info_s *p_tree, nm_coll_tree_kind_t kind, nm_group_t p_group, int root)
init tree with a group as a support; the group holds additionnal topology information
void nm_coll_tree_init(struct nm_coll_tree_info_s *p_tree, nm_coll_tree_kind_t kind, int n, int self, int root)
generic tree init
void nm_coll_tree_descendants(const struct nm_coll_tree_info_s *p_tree, int step, int self, int *p_descendants)
get all the leaves below the 'self' vertex, including self
static void nm_coll_tree_send(struct nm_coll_tree_status_s *p_coll_tree, int dest, struct nm_data_s *p_data, nm_sr_request_t *p_req)
Definition nm_coll_trees.h:276
static int nm_coll_r2v(int i, const struct nm_coll_tree_info_s *p_tree)
translate real ranks to virtual ranks (with root=0)
Definition nm_coll_trees.h:219
int nm_coll_binary_nb_nodes_in_left_subtree(const struct nm_coll_tree_info_s *const p_tree)
int nm_coll_tree_has_descendants(nm_coll_tree_kind_t k)
whether this coll_tree kind implements 'descendants' method for scatter/gather
static void nm_coll_tree_status_init(struct nm_coll_tree_status_s *p_status, nm_session_t p_session, nm_coll_tree_kind_t kind, nm_group_t p_group, int root, nm_tag_t tag)
initialize a common status for non-blocking collective
Definition nm_coll_trees.h:249
static int nm_coll_v2r(int i, const struct nm_coll_tree_info_s *p_tree)
translate virtual ranks (with root=0) to real ranks
Definition nm_coll_trees.h:225
void nm_coll_tree_destroy(struct nm_coll_tree_info_s *p_tree)
const char * nm_coll_tree_kind_name(nm_coll_tree_kind_t kind)
nm_coll_tree_kind_t nm_coll_tree_heuristic(int comm_size, nm_len_t data_size, const struct nm_coll_topology_s *p_topology)
heuristic to select a coll_tree kind for a generic tree-based collective
void nm_coll_tree_step(const struct nm_coll_tree_info_s *p_tree, int step, int *p_parent, int *p_children, int *n_children)
get the parent & children for the local node at the given step.
int nm_coll_tree_has_weight(nm_coll_tree_kind_t k)
static int nm_coll_ipow(int base, int exp)
fast integer power() = base ^ exp
Definition nm_coll_trees.h:161
int nm_coll_tree_weight(const struct nm_coll_tree_info_s *p_tree, int step, int self)
static int nm_coll_tree_req_index(struct nm_coll_tree_status_s *p_coll_tree, nm_sr_request_t *p_request)
Definition nm_coll_trees.h:311
nm_coll_tree_kind_t nm_coll_tree_weight_heuristic(int comm_size, nm_len_t data_size, const struct nm_coll_topology_s *p_topology)
heuristic to select a coll_tree kind for a tree-based collective that needs weights (scatter/gather)
static void nm_coll_tree_status_destroy(struct nm_coll_tree_status_s *p_status)
Definition nm_coll_trees.h:262
@ NM_COLL_TREE_DEFAULT
for public interfaces, will fallback to one of the previous tree kinds
Definition nm_coll_trees.h:56
static int nm_atomic_inc(int *v)
increment int, atomic only when multithread
Definition nm_core_interface.h:896
static int nm_sr_isend_data(nm_session_t p_session, nm_gate_t p_gate, nm_tag_t tag, struct nm_data_s *p_data, nm_sr_request_t *p_request)
Definition nm_sendrecv_interface.h:326
static int nm_sr_request_monitor_with_ref(nm_session_t p_session, nm_sr_request_t *p_request, nm_sr_event_t mask, nm_sr_event_notifier_t notifier, void *ref)
Definition nm_sendrecv_interface.h:408
static void nm_sr_send_init(nm_session_t p_session, nm_sr_request_t *p_request)
Init a send request.
static int nm_sr_send_issend(nm_session_t p_session, nm_sr_request_t *p_request, nm_gate_t p_gate, nm_tag_t tag)
send a built request in synchronous mode
static int nm_sr_irecv_data(nm_session_t p_session, nm_gate_t p_gate, nm_tag_t tag, struct nm_data_s *p_data, nm_sr_request_t *p_request)
Definition nm_sendrecv_interface.h:398
static void nm_sr_send_pack_data(nm_session_t p_session, nm_sr_request_t *p_request, const struct nm_data_s *p_data)
Pack data described through an iterator into the given request.
assert(p_data->ops.p_traversal !=NULL)
This is the common public header for NewMad.
a description of hierarchy of processes; subgroup is empty when no topology is available and n_subgro...
Definition nm_group.h:55
int height
tree height: number of communications steps in the tree (0 for a single node)
Definition nm_coll_trees.h:69
nm_group_t p_group
group this collective will run on, if known, that holds topology information; may be NULL
Definition nm_coll_trees.h:70
common status for a non-blocking operation that walks a tree
Definition nm_coll_trees.h:235
nm_sr_request_t * children_requests
Definition nm_coll_trees.h:242
a data descriptor, used to pack/unpack data from app layout to/from contiguous buffers
Definition nm_data.h:200
Definition nm_session_private.h:24