X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c49da53d70122cf649a262c830cf0c056dd1c8f1..3922ecf35babad02cc4ad9d5ad3a7fcb4e7eeabd:/teshsuite/msg/task_progress/task_progress.cpp diff --git a/teshsuite/msg/task_progress/task_progress.cpp b/teshsuite/msg/task_progress/task_progress.cpp index feefbfcdc9..c681ec9f31 100644 --- a/teshsuite/msg/task_progress/task_progress.cpp +++ b/teshsuite/msg/task_progress/task_progress.cpp @@ -31,16 +31,14 @@ static int seq_task(int /*argc*/, char* /*argv*/ []) progress = MSG_task_get_remaining_work_ratio(task); xbt_assert(progress == 0, "Progress should be equal to 1 not %f", progress); + MSG_task_destroy(task); XBT_INFO("Goodbye now!"); return 0; } static int par_task(int /*argc*/, char* /*argv*/ []) { - int nb_res = 2; - //double * computation_amount = xbt_new(double, nb_res); double * computation_amount = new double[2] {10E7, 10E7}; - //double * communication_amount = xbt_new(double, nb_res); double * communication_amount = new double[4] {1E6, 1E6, 1E6, 1E6}; double progress = 0; @@ -62,6 +60,10 @@ static int par_task(int /*argc*/, char* /*argv*/ []) progress = MSG_task_get_remaining_work_ratio(task); xbt_assert(progress == 0, "Progress should be equal to 1 not %f", progress); + MSG_task_destroy(task); + delete[] computation_amount; + delete[] communication_amount; + XBT_INFO("Goodbye now!"); return 0; } @@ -71,8 +73,8 @@ static int get_progress(int /*argc*/, char* /*argv*/ []) while (tasks.empty()) { MSG_process_sleep(0.5); } + double progress; for(auto const& task: tasks) { - double progress; double progress_prev = 1; for (int i = 0; i < 3; i++) { MSG_process_sleep(0.2); @@ -83,6 +85,7 @@ static int get_progress(int /*argc*/, char* /*argv*/ []) progress_prev = progress; } } + return 0; } int main(int argc, char *argv[])