43 #define MAX_LOOP_TRY 20
192 static inline uint64_t
abs_diff( uint64_t a , uint64_t b )
207 uint32_t n = num > 0 ? num - 1 : 0;
static uint32_t nearest_pow(uint32_t num)
Computes the nearest.
void perchild_host(struct sync_tree_conf *c, void *arg)
What to be done on each node's child.
int target_node
the target node
int current_pow
the current nearest power of two
void sync_mpi()
Entry point to be used to perform time sync of every MPI Processes.
long long int Process_Sync_Offset
The offset of the timer.
void bootstrap_sync_tree(void(*action)(struct sync_tree_conf *next_conf, void *arg), void(*per_child_act)(struct sync_tree_conf *conf, void *arg), void(*post_action)(struct sync_tree_conf *next_conf, void *arg), void *arg)
This is a bootstrapping function for calling compute_sync_tree();.
void action_set_off(struct sync_tree_conf *c, void *poffset)
Copies offset of c to current process timer offset (poffset)
static uint64_t abs_diff(uint64_t a, uint64_t b)
Computes an absolute difference.
This structure describes a tree node for time synchronization.
int source_node
the source node
void sync_client(int parent, void *poffset)
The client function for synchronizing time (computes offset between server and client) ...
long long int offset
the time offset
void post_client(struct sync_tree_conf *c, void *arg)
What to be done on the client side.
void sync_server(int dest_rank)
Server function for synchronizing time.
void action_val(struct sync_tree_conf *c, void *arg)
For debugging only.
int comm_size
the total number of ranks
void compute_sync_tree(struct sync_tree_conf *conf, void(*action)(struct sync_tree_conf *next_conf, void *arg), void(*per_child_act)(struct sync_tree_conf *conf, void *arg), void(*post_action)(struct sync_tree_conf *next_conf, void *arg), void *arg)
This function does the actual work prepared by bootstrap_sync_tree().