Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
factorize some code between NS3 cluster creation and other clusters
[simgrid.git] / src / surf / HostImpl.cpp
index cb08a98..1185bec 100644 (file)
@@ -67,11 +67,8 @@ void HostModel::adjustWeightOfDummyCpuActions()
   }
 }
 
-Action *HostModel::executeParallelTask(int host_nb,
-    sg_host_t *host_list,
-    double *flops_amount,
-    double *bytes_amount,
-    double rate)
+Action* HostModel::executeParallelTask(int host_nb, simgrid::s4u::Host** host_list, double* flops_amount,
+                                       double* bytes_amount, double rate)
 {
 #define cost_or_zero(array,pos) ((array)?(array)[pos]:0.0)
   Action *action =nullptr;
@@ -80,9 +77,7 @@ Action *HostModel::executeParallelTask(int host_nb,
     action = host_list[0]->pimpl_cpu->execution_start(flops_amount[0]);
   } else if ((host_nb == 1)
            && (cost_or_zero(flops_amount, 0) == 0.0)) {
-    action = surf_network_model->communicate(host_list[0]->pimpl_netcard,
-                                         host_list[0]->pimpl_netcard,
-                       bytes_amount[0], rate);
+    action = surf_network_model->communicate(host_list[0], host_list[0], bytes_amount[0], rate);
   } else if ((host_nb == 2)
              && (cost_or_zero(flops_amount, 0) == 0.0)
              && (cost_or_zero(flops_amount, 1) == 0.0)) {
@@ -96,7 +91,7 @@ Action *HostModel::executeParallelTask(int host_nb,
       }
     }
     if (nb == 1) {
-      action = surf_network_model->communicate(host_list[0]->pimpl_netcard, host_list[1]->pimpl_netcard, value, rate);
+      action = surf_network_model->communicate(host_list[0], host_list[1], value, rate);
     } else if (nb == 0) {
        xbt_die("Cannot have a communication with no flop to exchange in this model. You should consider using the ptask model");
     } else {