Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #256 from Flamefire/master
[simgrid.git] / src / simdag / sd_global.cpp
index 88656c0..da60d2d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2018. 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. */
@@ -7,6 +7,7 @@
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.h"
 #include "src/include/instr/instr_interface.h"
+#include "src/kernel/resource/Action.hpp"
 #include "src/surf/surf_interface.hpp"
 
 XBT_LOG_NEW_CATEGORY(sd, "Logging specific to SimDag");
@@ -56,8 +57,8 @@ std::set<SD_task_t>* simulate(double how_long){
 
     /* let's see which tasks are done */
     for (auto const& model : *all_existing_models) {
-      surf_action_t action = surf_model_extract_done_action_set(model);
-      while (action != nullptr) {
+      simgrid::kernel::resource::Action* action = surf_model_extract_done_action_set(model);
+      while (action != nullptr && action->getData() != nullptr) {
         SD_task_t task = static_cast<SD_task_t>(action->getData());
         XBT_VERB("Task '%s' done", SD_task_get_name(task));
         SD_task_set_state(task, SD_DONE);