Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
"new ruby host method"
[simgrid.git] / src / simdag / sd_global.c
index c7de5e0..8fb38b6 100644 (file)
@@ -1,3 +1,8 @@
+/* Copyright (c) 2007-2009 Da 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 "private.h"
 #include "xbt/sysdep.h"
 #include "xbt/dynar.h"
@@ -13,14 +18,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_kernel, sd,
 
 SD_global_t sd_global = NULL;
 
-/* $Id$ */
-
-/* Copyright (c) 2007 Arnaud Legrand.
-   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. */
-
 XBT_LOG_EXTERNAL_CATEGORY(sd_kernel);
 XBT_LOG_EXTERNAL_CATEGORY(sd_task);
 XBT_LOG_EXTERNAL_CATEGORY(sd_workstation);
@@ -242,6 +239,8 @@ SD_task_t *SD_simulate(double how_long)
     xbt_dynar_foreach(model_list, iter, model) {
       while ((action = xbt_swag_extract(model->states.done_action_set))) {
         task = action->data;
+        task->start_time = surf_workstation_model->action_get_start_time(task->surf_action);
+        task->finish_time = surf_get_clock();
         INFO1("Task '%s' done", SD_task_get_name(task));
         DEBUG0("Calling __SD_task_just_done");
         __SD_task_just_done(task);
@@ -271,6 +270,8 @@ SD_task_t *SD_simulate(double how_long)
       /* let's see which tasks have just failed */
       while ((action = xbt_swag_extract(model->states.failed_action_set))) {
         task = action->data;
+        task->start_time = surf_workstation_model->action_get_start_time(task->surf_action);
+        task->finish_time = surf_get_clock();
         INFO1("Task '%s' failed", SD_task_get_name(task));
         __SD_task_set_state(task, SD_FAILED);
         surf_workstation_model->action_unref(action);