// utility functions
static void chord_initialize(void);
+static void chord_exit(void);
static int normalize(int id);
static int is_in_interval(int id, int start, int end);
static void get_mailbox(int host_id, char* mailbox);
XBT_DEBUG("Sets nb_keys to %d", nb_keys);
}
+static void chord_exit(void)
+{
+ xbt_free(powers2);
+}
+
/**
* \brief Turns an id into an equivalent id in [0, nb_keys).
* \param id an id
}
/**
- * \brief Returns whether a id belongs to the interval [start, end].
+ * \brief Returns whether an id belongs to the interval [start, end].
*
* The parameters are noramlized to make sure they are between 0 and nb_keys - 1).
* 1 belongs to [62, 3]
MSG_process_sleep(5);
}
}
- else {
+
+ if (node.comm_receive && MSG_comm_test(node.comm_receive)) {
+
// a transfer has occured
MSG_error_t status = MSG_comm_get_status(node.comm_receive);
XBT_INFO("Simulated time: %g", MSG_get_clock());
MSG_clean();
+ chord_exit();
if (res == MSG_OK)
return 0;