123 return ((
unsigned) (8*
sizeof (
unsigned long long) - __builtin_clzll((x)) - 1));
191 return ((p_tree->
n + i - p_tree->
root) % p_tree->
n);
197 return ((p_tree->
root + i) % p_tree->
n);
236 assert(p_status->
p_group != NULL);
283 if( (p_request < &p_coll_tree->children_requests[0]) ||
286 NM_FATAL(
"given p_request = %p is not in coll_tree", p_request);
290 assert(i < p_coll_tree->tree.max_arity);
nm_gate_vect_t nm_group_t
type for groups; in practice, a vector of gates
nm_coll_tree_kind_t nm_coll_tree_kind_by_name(const char *s_kind)
enum nm_coll_tree_kind_e nm_coll_tree_kind_t
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)
static int nm_coll_log2_ceil(int x)
ceil(log2(x))
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)
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 *))
static int nm_coll_log_n_floor(int x, const int n)
floor(log_n(x)
nm_coll_tree_kind_t nm_coll_tree_heuristic(int comm_size __attribute__((unused)), nm_len_t data_size)
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)
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)
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)
nm_coll_tree_kind_t nm_coll_tree_env(void)
get tree kind from environment
static const char * nm_coll_tree_kind_name(nm_coll_tree_kind_t kind)
int nm_coll_binary_nb_nodes_in_left_subtree(const struct nm_coll_tree_info_s *const p_tree)
nm_coll_tree_kind_e
kind of tree
static int nm_coll_log_n_ceil(int x, const int n)
ceil(log_n(x))
static int nm_coll_log2_floor(int x)
floor(log2(x))
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
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, int self, nm_tag_t tag)
initialize a common status for non-blocking collective
static int nm_coll_log4_floor(int x)
floor(log4(x))
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.
static int nm_coll_ipow(int base, int exp)
fast integer power() = base ^ exp
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)
static void nm_coll_tree_status_destroy(struct nm_coll_tree_status_s *p_status)
@ NM_COLL_TREE_2CHAINS_MODIFIED
HPL 2-rings modified.
@ NM_COLL_TREE_CHAIN_MODIFIED
HPL ring-modified algorithm.
@ NM_COLL_TREE_DEFAULT
for public interfaces, will fallback to one of the previous tree kinds
struct nm_core_event_s __attribute__
static int nm_atomic_inc(int *v)
increment int, atomic only when multithread
int nm_sr_request_monitor(nm_session_t p_session, nm_sr_request_t *p_request, nm_sr_event_t mask, nm_sr_event_notifier_t notifier)
Set a notification function called upon request completion.
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
nm_sr_event_t
events for nm_sr_monitor()
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.
static int nm_sr_request_set_ref(nm_sr_request_t *p_request, void *ref)
Add a user reference to a request.
@ NM_SR_EVENT_FINALIZED
request finalized, may be freed by user
nm_tag_t tag
the user-supplied tag
static nm_session_t p_session
int nm_group_size(nm_group_t group)
nm_gate_t nm_group_get_gate(nm_group_t p_group, int rank)
Basic primitives to display info & warnings.
#define NM_FATAL(format,...)
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)
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)
uint64_t nm_tag_t
user tags, 64 bits, contained in indirect hashtable
uint64_t nm_len_t
data length used by nmad
description of an instanciated tree
int root
root node of the collective
int height
tree height: number of communications steps in the tree (0 for a single node)
int self
rank of local node
int n
number of nodes involved in collective
int max_arity
maximum number of children in tree
common status for a non-blocking operation that walks a tree
nm_sr_request_t parent_request
struct nm_coll_tree_info_s tree
int pending_reqs
number of pending send/recv operations
nm_sr_request_t * children_requests
a data descriptor, used to pack/unpack data from app layout to/from contiguous buffers
Connection to another process.
internal defintion of the sendrecv request
information field for sendrecv events