*/
static int normalize(int id)
{
- // make sure id >= 0
- while (id < 0) {
- id += nb_keys;
- }
- // make sure id < nb_keys
- id = id % nb_keys;
-
- return id;
+ // like id % nb_keys, but works with negatives numbers (and faster)
+ return id & (nb_keys - 1);
}
/**
*/
int node(int argc, char *argv[])
{
+ /* Reduce the run size for the MC */
+ if(MC_IS_ENABLED){
+ periodic_stabilize_delay = 8;
+ periodic_fix_fingers_delay = 8;
+ periodic_check_predecessor_delay = 8;
+ }
+
double init_time = MSG_get_clock();
m_task_t task_received = NULL;
msg_comm_t comm_send = NULL;