Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Compile with flag NDEBUG.
[simgrid.git] / examples / msg / parallel_task / test_ptask.c
index b73ab3a..95b9c9f 100644 (file)
@@ -35,8 +35,8 @@ int execute(int argc, char *argv[])
   int host_list_size;
   double *computation_duration = NULL;
   double *communication_table = NULL;
-  double communication_amount;
-  double computation_amount;
+  double communication_amount = 0;
+  double computation_amount = 0;
   double execution_time;
 
 
@@ -72,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);
@@ -89,7 +91,7 @@ int redistribute(int argc, char *argv[])
   int host_list_size;
   double *computation_duration = NULL;
   double *communication_table = NULL;
-  double communication_amount;
+  double communication_amount = 0;
   double redistribution_time;
 
 
@@ -122,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);