/* 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. */
#include "simgrid/msg.h"
#include "xbt/dynar.h"
/* 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. */
#include "simgrid/msg.h"
#include "xbt/dynar.h"
}
static void print_node_neighborood_set(node_t node) {
XBT_INFO(" Neighborhood:");
for (int i=0; i<NEIGHBORHOOD_SIZE; i++)
}
static void print_node_neighborood_set(node_t node) {
XBT_INFO(" Neighborhood:");
for (int i=0; i<NEIGHBORHOOD_SIZE; i++)
}
static void print_node_routing_table(node_t node) {
XBT_INFO(" Routing table:");
for (int i=0; i<LEVELS_COUNT; i++){
for (int j=0; j<LEVEL_SIZE; j++)
}
static void print_node_routing_table(node_t node) {
XBT_INFO(" Routing table:");
for (int i=0; i<LEVELS_COUNT; i++){
for (int j=0; j<LEVEL_SIZE; j++)
}
}
/* Print the node namespace set */
static void print_node_namespace_set(node_t node) {
XBT_INFO(" Namespace:");
for (int i=0; i<NAMESPACE_SIZE; i++)
}
}
/* Print the node namespace set */
static void print_node_namespace_set(node_t node) {
XBT_INFO(" Namespace:");
for (int i=0; i<NAMESPACE_SIZE; i++)
e_task_type_t type = task_data->type;
// If the node is not ready keep the task for later
if (node->ready != 0 && !(type==TASK_JOIN_LAST_REPLY || type==TASK_JOIN_REPLY)) {
e_task_type_t type = task_data->type;
// If the node is not ready keep the task for later
if (node->ready != 0 && !(type==TASK_JOIN_LAST_REPLY || type==TASK_JOIN_REPLY)) {
/* Try to join the ring */
case TASK_JOIN:
next = routing_next(node, task_data->answer_id);
/* Try to join the ring */
case TASK_JOIN:
next = routing_next(node, task_data->answer_id);
type = TASK_JOIN_LAST_REPLY;
req_data = xbt_new0(s_task_data_t,1);
type = TASK_JOIN_LAST_REPLY;
req_data = xbt_new0(s_task_data_t,1);
// if the node is ready, do all the pending tasks and send update to known nodes
if (node->ready==0) {
XBT_DEBUG("Node %i is ready!!!", node->id);
// if the node is ready, do all the pending tasks and send update to known nodes
if (node->ready==0) {
XBT_DEBUG("Node %i is ready!!!", node->id);
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--;
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--;
min--;
node->namespace_set[i] = task_namespace_set[max];
max++;
} else if (curr_namespace_set[j] == task_namespace_set[max]) {
node->namespace_set[i] = curr_namespace_set[j];
j++;
max++;
node->namespace_set[i] = task_namespace_set[max];
max++;
} else if (curr_namespace_set[j] == task_namespace_set[max]) {
node->namespace_set[i] = curr_namespace_set[j];
j++;
max++;
node.ready = -1;
node.pending_tasks = xbt_dynar_new(sizeof(msg_task_t), NULL);
get_mailbox(node.id, node.mailbox);
node.ready = -1;
node.pending_tasks = xbt_dynar_new(sizeof(msg_task_t), NULL);
get_mailbox(node.id, node.mailbox);
for (int i=0; i<LEVELS_COUNT; i++){
int d = domain(node.id, i);
for (int i=0; i<LEVELS_COUNT; i++){
int d = domain(node.id, i);