char *key;
xbt_dict_cursor_t cursor;
connection_t connection;
- int interested;
xbt_dict_foreach(peer->peers, cursor, key, connection) {
- interested = 0;
+ int interested = 0;
if (connection->am_interested != 0) {
//Check if the peer still has a piece we want.
for (int i = 0; i < FILE_PIECES; i++) {
unsigned int answers;
unsigned int destination_found = 0;
unsigned int nodes_added = 0;
- double time_beginreceive;
- double timeout;
double global_timeout = MSG_get_clock() + find_node_global_timeout;
unsigned int steps = 0;
answers = 0;
queries = send_find_node_to_best(node, node_list);
nodes_added = 0;
- timeout = MSG_get_clock() + find_node_timeout;
+ double timeout = MSG_get_clock() + find_node_timeout;
steps++;
- time_beginreceive = MSG_get_clock();
+ double time_beginreceive = MSG_get_clock();
do {
if (node->receive_comm == NULL) {
node->task_received = NULL;
int j;
int min;
int max;
- int d;
int next;
msg_task_t task_sent;
task_data_t req_data;
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++) {
- d = domain(node->id, i);
+ int d = domain(node->id, i);
for (j=0; j<LEVEL_SIZE; j++)
if (d!=j)
node->routing_table[i][j] = task_data->state->routing_table[i][j];
- }
+ }
node->ready--;
// if the node is ready, do all the pending tasks and send update to known nodes
*/
inline xbt_dict_cursor_t xbt_dict_cursor_new(const xbt_dict_t dict)
{
- xbt_dict_cursor_t res = NULL;
-
- res = xbt_new(s_xbt_dict_cursor_t, 1);
+ xbt_dict_cursor_t res = xbt_new(s_xbt_dict_cursor_t, 1);
res->dict = dict;
xbt_dict_cursor_rewind(res);
double task_comm_size = 1E6;
const char * mailbox = "jupi";
- msg_task_t task = NULL;
msg_host_t jupiter = MSG_host_by_name("Jupiter");
- task = MSG_task_create("task on", task_comp_size, task_comm_size, NULL);
+ msg_task_t task = MSG_task_create("task on", task_comp_size, task_comm_size, NULL);
XBT_INFO("Sending \"%s\"", task->name);
if (MSG_task_send_with_timeout(task, mailbox, 1) != MSG_OK)
MSG_task_destroy(task);