Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Replace redundant type with 'auto'.
[simgrid.git] / src / simdag / sd_task.cpp
index 89b78db..9583196 100644 (file)
@@ -5,6 +5,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simdag_private.hpp"
+#include "simgrid/kernel/routing/NetPoint.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/surf_interface.hpp"
 #include <algorithm>
@@ -35,7 +36,7 @@ static void __SD_task_destroy_scheduling_data(SD_task_t task)
  */
 SD_task_t SD_task_create(const char* name, void* data, double amount)
 {
-  SD_task_t task = xbt_new0(s_SD_task_t, 1);
+  auto* task     = xbt_new0(s_SD_task_t, 1);
   task->kind     = SD_TASK_NOT_TYPED;
   task->state    = SD_NOT_SCHEDULED;
   sd_global->initial_tasks.insert(task);
@@ -801,8 +802,10 @@ void SD_task_run(SD_task_t task)
   XBT_VERB("Executing task '%s'", task->name);
 
   /* Beware! The scheduling data are now used by the surf action directly! no copy was done */
+  // FIXME[donassolo]: verify if all hosts belongs to the same netZone?
+  auto host_model = (*task->allocation).front()->get_netpoint()->get_englobing_zone()->get_host_model();
   task->surf_action =
-      surf_host_model->execute_parallel(*task->allocation, task->flops_amount, task->bytes_amount, task->rate);
+      host_model->execute_parallel(*task->allocation, task->flops_amount, task->bytes_amount, task->rate);
 
   task->surf_action->set_data(task);