From: Arnaud Giersch Date: Thu, 20 Dec 2012 17:07:16 +0000 (+0100) Subject: Now, you have to use "cursor" instead of "i". X-Git-Tag: v3_9_rc1~86^2~72 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9fa23a65176e4aa86c5336fd131307297e540fd2 Now, you have to use "cursor" instead of "i". --- diff --git a/examples/msg/actions/actions.c b/examples/msg/actions/actions.c index 02e4b13094..dab03cd8a5 100644 --- a/examples/msg/actions/actions.c +++ b/examples/msg/actions/actions.c @@ -256,7 +256,6 @@ static void action_barrier(const char *const *action) static void action_reduce(const char *const *action) { - int i; char *reduce_identifier; char mailbox[80]; double comm_size = parse_double(action[2]); @@ -280,6 +279,8 @@ static void action_reduce(const char *const *action) xbt_dynar_t comms = xbt_dynar_new(sizeof(msg_comm_t), NULL); msg_task_t *tasks = xbt_new0(msg_task_t, communicator_size - 1); + int i; + for (i = 1; i < communicator_size; i++) { sprintf(mailbox, "%s_p%d_p0", reduce_identifier, i); xbt_dynar_push_as(comms, msg_comm_t, @@ -291,7 +292,7 @@ static void action_reduce(const char *const *action) unsigned int cursor; xbt_dynar_foreach(comms, cursor, comm) { MSG_comm_destroy(comm); - MSG_task_destroy(tasks[i]); + MSG_task_destroy(tasks[cursor]); } free(tasks); xbt_dynar_free(&comms); @@ -389,7 +390,6 @@ static void action_sleep(const char *const *action) static void action_allReduce(const char *const *action) { - int i; char *allreduce_identifier; char mailbox[80]; double comm_size = parse_double(action[2]); @@ -413,6 +413,7 @@ static void action_allReduce(const char *const *action) xbt_dynar_t comms = xbt_dynar_new(sizeof(msg_comm_t), NULL); msg_task_t *tasks = xbt_new0(msg_task_t, communicator_size - 1); + int i; for (i = 1; i < communicator_size; i++) { sprintf(mailbox, "%s_p%d_p0", allreduce_identifier, i); xbt_dynar_push_as(comms, msg_comm_t, @@ -424,7 +425,7 @@ static void action_allReduce(const char *const *action) unsigned int cursor; xbt_dynar_foreach(comms, cursor, comm) { MSG_comm_destroy(comm); - MSG_task_destroy(tasks[i]); + MSG_task_destroy(tasks[cursor]); } free(tasks);