Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
better message for this exception
[simgrid.git] / src / surf / HostImpl.cpp
index 17788e0..caec7b6 100644 (file)
@@ -13,7 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_host, surf, "Logging specific to the SURF h
 simgrid::surf::HostModel *surf_host_model = nullptr;
 
 /*************
- * Callbacks *
+ * Callbacks *t
  *************/
 
 namespace simgrid {
@@ -24,7 +24,7 @@ namespace surf {
  *********/
 
 /* Helper function for executeParallelTask */
-static inline double has_cost(double* array, size_t pos)
+static inline double has_cost(const double* array, size_t pos)
 {
   if (array)
     return array[pos];
@@ -32,8 +32,9 @@ static inline double has_cost(double* array, size_t pos)
     return -1.0;
 }
 
-kernel::resource::Action* HostModel::execute_parallel(size_t host_nb, s4u::Host** host_list, double* flops_amount,
-                                                      double* bytes_amount, double rate)
+kernel::resource::Action* HostModel::execute_parallel(size_t host_nb, s4u::Host* const* host_list,
+                                                      const double* flops_amount, const double* bytes_amount,
+                                                      double rate)
 {
   kernel::resource::Action* action = nullptr;
   if ((host_nb == 1) && (has_cost(bytes_amount, 0) <= 0) && (has_cost(flops_amount, 0) > 0)) {
@@ -108,7 +109,7 @@ void HostImpl::turn_on()
     if (arg->kill_time >= 0)
       actor->set_kill_time(arg->kill_time);
     if (arg->auto_restart)
-      actor->auto_restart_ = arg->auto_restart;
+      actor->set_auto_restart(arg->auto_restart);
     if (arg->daemon_)
       actor->daemonize();
   }
@@ -120,7 +121,7 @@ void HostImpl::turn_off()
   if (not process_list_.empty()) {
     for (auto& actor : process_list_) {
       XBT_DEBUG("Killing Actor %s@%s on behalf of %s which turned off that host.", actor.get_cname(),
-                actor.host_->get_cname(), SIMIX_process_self()->get_cname());
+                actor.get_host()->get_cname(), SIMIX_process_self()->get_cname());
       SIMIX_process_self()->kill(&actor);
     }
   }