X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8cd3936c33b4d66eaf5dd3bdb944d72603e87c37..5a918cbd59f64eddf384ac657201057ac311633a:/examples/msg/chord/chord.c diff --git a/examples/msg/chord/chord.c b/examples/msg/chord/chord.c index 2ca3ac68c8..307d519eea 100644 --- a/examples/msg/chord/chord.c +++ b/examples/msg/chord/chord.c @@ -27,6 +27,8 @@ static int periodic_fix_fingers_delay = 120; static int periodic_check_predecessor_delay = 120; static int periodic_lookup_delay = 10; +extern long int smx_total_comms; + /** * Finger element. */ @@ -390,6 +392,7 @@ int node(int argc, char *argv[]) // stop the simulation xbt_free(node.fingers); + INFO1("Messages created: %lu", smx_total_comms); return 0; } @@ -502,6 +505,11 @@ static int join(node_t node, int known_id) INFO2("Joining the ring with id %d, knowing node %d", node->id, known_id); set_predecessor(node, -1); // no predecessor (yet) + int i; + for (i = 0; i < nb_bits; i++) { + set_finger(node, i, known_id); + } + int successor_id = remote_find_successor(node, known_id, node->id); if (successor_id == -1) { INFO0("Cannot join the ring."); @@ -921,7 +929,7 @@ int main(int argc, char *argv[]) MSG_launch_application(application_file); MSG_error_t res = MSG_main(); - INFO1("Simulation time: %g", MSG_get_clock()); + INFO1("Simulated time: %g", MSG_get_clock()); MSG_clean();