X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6760cb07d6b57be16928d95339d71e57c4e24f36..af501088d2630992f48a552dc250273aa09fe10b:/examples/msg/parallel_task/test_ptask.c diff --git a/examples/msg/parallel_task/test_ptask.c b/examples/msg/parallel_task/test_ptask.c index 9beea974a9..8047d8a444 100644 --- a/examples/msg/parallel_task/test_ptask.c +++ b/examples/msg/parallel_task/test_ptask.c @@ -17,7 +17,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, int execute(int argc, char *argv[]); int redistribute(int argc, char *argv[]); -MSG_error_t test_all(const char *platform_file, const char *application_file); +MSG_error_t test_all(const char *platform_file, + const char *application_file); typedef enum { PORT_22 = 0, @@ -54,12 +55,12 @@ int execute(int argc, char *argv[]) "Invalid argument %s\n", argv[argc - 1]); computation_duration = (double *) calloc(host_list_size, sizeof(double)); communication_table = - (double *) calloc(host_list_size * host_list_size, sizeof(double)); + (double *) calloc(host_list_size * host_list_size, sizeof(double)); for (i = 0; i < host_list_size; i++) { computation_duration[i] = computation_amount / host_list_size; for (j = 0; j < host_list_size; j++) communication_table[i * host_list_size + j] = - communication_amount / (host_list_size * host_list_size); + communication_amount / (host_list_size * host_list_size); } sprintf(buffer, "redist#0\n"); @@ -71,6 +72,8 @@ int execute(int argc, char *argv[]) execution_time = MSG_get_clock(); MSG_parallel_task_execute(task); + MSG_task_destroy(task); + xbt_free(m_host_list); execution_time = MSG_get_clock() - execution_time; INFO1("execution_time=%g ", execution_time); @@ -105,11 +108,11 @@ int redistribute(int argc, char *argv[]) "Invalid argument %s\n", argv[argc - 1]); computation_duration = (double *) calloc(host_list_size, sizeof(double)); communication_table = - (double *) calloc(host_list_size * host_list_size, sizeof(double)); + (double *) calloc(host_list_size * host_list_size, sizeof(double)); for (i = 0; i < host_list_size; i++) { for (j = 0; j < host_list_size; j++) communication_table[i * host_list_size + j] = - communication_amount / (host_list_size * host_list_size); + communication_amount / (host_list_size * host_list_size); } sprintf(buffer, "redist#0\n"); @@ -121,6 +124,8 @@ int redistribute(int argc, char *argv[]) redistribution_time = MSG_get_clock(); MSG_parallel_task_execute(task); + MSG_task_destroy(task); + xbt_free(m_host_list); redistribution_time = MSG_get_clock() - redistribution_time; INFO1("redistribution_time=%g ", redistribution_time); @@ -129,7 +134,8 @@ int redistribute(int argc, char *argv[]) } -MSG_error_t test_all(const char *platform_file, const char *application_file) +MSG_error_t test_all(const char *platform_file, + const char *application_file) { MSG_error_t res = MSG_OK;