X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/95b7245335871cb2987b39b320e8a7b40c341e2c..299c52751d8bf7ed4f9fc40f668025a5cb425901:/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 611f60e80f..65810c24c0 100644 --- a/teshsuite/msg/task_progress/task_progress.cpp +++ b/teshsuite/msg/task_progress/task_progress.cpp @@ -1,10 +1,9 @@ -/* Copyright (c) 2010-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include +#include "simgrid/Exception.hpp" #include "simgrid/msg.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); @@ -20,16 +19,16 @@ static int seq_task(int /*argc*/, char* /*argv*/ []) msg_task_t task = MSG_task_create("simple", task_comp_size, task_comm_size, NULL); tasks.push_back(task); - XBT_INFO("get the progress of %s before the task starts", task->name); + XBT_INFO("get the progress of %s before the task starts", MSG_task_get_name(task)); progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 0, "Progress should be 0 not %f", progress); + xbt_assert(progress == 1.0, "Progress should be 1.0 not %f", progress); - XBT_INFO("Executing task: \"%s\"", task->name); + XBT_INFO("Executing task: \"%s\"", MSG_task_get_name(task)); MSG_task_execute(task); - XBT_INFO("get the progress of %s after the task finishes", task->name); + XBT_INFO("get the progress of %s after the task finishes", MSG_task_get_name(task)); progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 0, "Progress should be equal to 1 not %f", progress); + xbt_assert(progress == 0.0, "Progress should be equal to 0.0 not %f", progress); MSG_task_destroy(task); XBT_INFO("Goodbye now!"); @@ -49,16 +48,16 @@ static int par_task(int /*argc*/, char* /*argv*/ []) msg_task_t task = MSG_parallel_task_create("ptask", 2, hosts_to_use.data(), computation_amount, communication_amount, NULL); tasks.push_back(task); - XBT_INFO("get the progress of %s before the task starts", task->name); + XBT_INFO("get the progress of %s before the task starts", MSG_task_get_name(task)); progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 0, "Progress should be 0 not %f", progress); + xbt_assert(progress == 1.0, "Progress should be 1.0 not %f", progress); - XBT_INFO("Executing task: \"%s\"", task->name); + XBT_INFO("Executing task: \"%s\"", MSG_task_get_name(task)); MSG_parallel_task_execute(task); - XBT_INFO("get the progress of %s after the task finishes", task->name); + XBT_INFO("get the progress of %s after the task finishes", MSG_task_get_name(task)); progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 0, "Progress should be equal to 1 not %f", progress); + xbt_assert(progress == 0.0, "Progress should be equal to 0.0 not %f", progress); MSG_task_destroy(task); delete[] computation_amount; @@ -81,7 +80,7 @@ static int get_progress(int /*argc*/, char* /*argv*/ []) progress = MSG_task_get_remaining_work_ratio(task); xbt_assert(progress >= 0 and progress < 1, "Progress should be in [0, 1[, and not %f", progress); xbt_assert(progress < progress_prev, "Progress should decrease, not increase"); - XBT_INFO("Progress of \"%s\": %f", task->name, progress); + XBT_INFO("Progress of \"%s\": %f", MSG_task_get_name(task), progress); progress_prev = progress; } }