/* 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);
req_data->answer_id = task_data->sender_id;
req_data->steps = task_data->steps + 1;
type = TASK_JOIN_LAST_REPLY;
req_data = xbt_new0(s_task_data_t,1);
req_data->answer_id = task_data->sender_id;
req_data->steps = task_data->steps + 1;
// if next different from current node forward the join
if (next!=node->id) {
get_mailbox(next, mailbox);
// if next different from current node forward the join
if (next!=node->id) {
get_mailbox(next, mailbox);
/* Join reply from all the node touched by the join */
case TASK_JOIN_LAST_REPLY:
// if last node touched reply, copy its namespace set
/* Join reply from all the node touched by the join */
case TASK_JOIN_LAST_REPLY:
// if last node touched reply, copy its namespace set
j = (task_data->sender_id < node->id) ? -1 : 0;
for (i=0; i<NAMESPACE_SIZE/2; i++) {
node->namespace_set[i] = task_data->state->namespace_set[i-j];
j = (task_data->sender_id < node->id) ? -1 : 0;
for (i=0; i<NAMESPACE_SIZE/2; i++) {
node->namespace_set[i] = task_data->state->namespace_set[i-j];
min = (node->id==task_data->answer_id) ? 0 : shl(node->id, task_data->answer_id);
max = shl(node->id, task_data->sender_id)+1;
for (i=min;i<max;i++) {
min = (node->id==task_data->answer_id) ? 0 : shl(node->id, task_data->answer_id);
max = shl(node->id, task_data->sender_id)+1;
for (i=min;i<max;i++) {
print_node_namespace_set(node);
int curr_namespace_set[NAMESPACE_SIZE];
int task_namespace_set[NAMESPACE_SIZE+1];
print_node_namespace_set(node);
int curr_namespace_set[NAMESPACE_SIZE];
int task_namespace_set[NAMESPACE_SIZE+1];
// Copy the current namespace and the task state namespace with state->id in the middle
i=0;
for (; i<NAMESPACE_SIZE/2; i++){
// Copy the current namespace and the task state namespace with state->id in the middle
i=0;
for (; i<NAMESPACE_SIZE/2; i++){
static int node(int argc, char *argv[])
{
double init_time = MSG_get_clock();
static int node(int argc, char *argv[])
{
double init_time = MSG_get_clock();