/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
} s_task_data_t, *task_data_t;
static void get_mailbox(int node_id, char* mailbox);
} s_task_data_t, *task_data_t;
static void get_mailbox(int node_id, char* mailbox);
static int shl(int a, int b);
static int closest_in_namespace_set(node_t node, int dest);
static int routing_next(node_t node, int dest);
static int shl(int a, int b);
static int closest_in_namespace_set(node_t node, int dest);
static int routing_next(node_t node, int dest);
/* Get the closest id to the dest in the node namespace_set */
static int closest_in_namespace_set(node_t node, int dest) {
/* Get the closest id to the dest in the node namespace_set */
static int closest_in_namespace_set(node_t node, int dest) {
- if ((node->namespace_set[NAMESPACE_SIZE-1] <= dest) & (dest <= node->namespace_set[0])) {
- best_dist = abs(node->id - dest);
+ if ((node->namespace_set[NAMESPACE_SIZE-1] <= dest) && (dest <= node->namespace_set[0])) {
+ int best_dist = abs(node->id - dest);
state_t state = xbt_new0(s_state_t,1);
state->id = node->id;
for (i=0; i<NEIGHBORHOOD_SIZE; i++)
state->neighborhood_set[i] = node->neighborhood_set[i];
for (i=0; i<LEVELS_COUNT; i++)
state_t state = xbt_new0(s_state_t,1);
state->id = node->id;
for (i=0; i<NEIGHBORHOOD_SIZE; i++)
state->neighborhood_set[i] = node->neighborhood_set[i];
for (i=0; i<LEVELS_COUNT; i++)
static void handle_task(node_t node, msg_task_t task) {
XBT_DEBUG("Handling task %p", task);
char mailbox[MAILBOX_NAME_SIZE];
static void handle_task(node_t node, msg_task_t task) {
XBT_DEBUG("Handling task %p", task);
char mailbox[MAILBOX_NAME_SIZE];
j--;
} else if (curr_namespace_set[j] == task_namespace_set[min]) {
node->namespace_set[i] = curr_namespace_set[j];
j--;
} else if (curr_namespace_set[j] == task_namespace_set[min]) {
node->namespace_set[i] = curr_namespace_set[j];
} else if (curr_namespace_set[j] > task_namespace_set[min]) {
node->namespace_set[i] = curr_namespace_set[j];
j--;
} else if (curr_namespace_set[j] > task_namespace_set[min]) {
node->namespace_set[i] = curr_namespace_set[j];
j--;
max++;
} else if (curr_namespace_set[j] == task_namespace_set[max]) {
node->namespace_set[i] = curr_namespace_set[j];
max++;
} else if (curr_namespace_set[j] == task_namespace_set[max]) {
node->namespace_set[i] = curr_namespace_set[j];
} else if (curr_namespace_set[j] < task_namespace_set[max]) {
node->namespace_set[i] = curr_namespace_set[j];
j++;
} else if (curr_namespace_set[j] < task_namespace_set[max]) {
node->namespace_set[i] = curr_namespace_set[j];
j++;
get_mailbox(node.id, node.mailbox);
XBT_DEBUG("New node with id %s (%08x)", node.mailbox, node.id);
get_mailbox(node.id, node.mailbox);
XBT_DEBUG("New node with id %s (%08x)", node.mailbox, node.id);
- d = domain(node.id, i);
- for (j=0; j<LEVEL_SIZE; j++)
+ int d = domain(node.id, i);
+ for (int j=0; j<LEVEL_SIZE; j++)
timeout = xbt_str_parse_int(options[0] + length, "Invalid timeout parameter: %s");
XBT_DEBUG("Set timeout to %d", timeout);
} else {
timeout = xbt_str_parse_int(options[0] + length, "Invalid timeout parameter: %s");
XBT_DEBUG("Set timeout to %d", timeout);
} else {