- nb_host++;
-
- action = new HostL07Action(this, 1, 0);
- XBT_DEBUG("Creating a parallel task (%p) with %d cpus and %d links.",
- action, host_nb, nb_link);
- action->m_suspended = 0; /* Should be useless because of the
- calloc but it seems to help valgrind... */
- action->m_hostNb = host_nb;
- action->p_hostList = (HostPtr *) host_list;
- action->p_computationAmount = flops_amount;
- action->p_communicationAmount = bytes_amount;
- action->m_latency = latency;
- action->m_rate = rate;
-
- action->p_variable = lmm_variable_new(ptask_maxmin_system, action, 1.0,
- (action->m_rate > 0) ? action->m_rate : -1.0,
- host_nb + nb_link);
-
- if (action->m_latency > 0)
- lmm_update_variable_weight(ptask_maxmin_system, action->getVariable(), 0.0);
-
- for (i = 0; i < host_nb; i++)
- lmm_expand(ptask_maxmin_system,
- static_cast<HostL07Ptr>(host_list[i])->p_cpu->getConstraint(),
- action->getVariable(), flops_amount[i]);
-
- for (i = 0; i < host_nb; i++) {
- for (j = 0; j < host_nb; j++) {
- void *_link;
- LinkL07Ptr link;
-
- xbt_dynar_t route=NULL;
- if (bytes_amount[i * host_nb + j] == 0.0)
- continue;
-
- routing_platf->getRouteAndLatency(static_cast<HostL07Ptr>(host_list[i])->p_netElm,
- static_cast<HostL07Ptr>(host_list[j])->p_netElm,
- &route, NULL);
-
- xbt_dynar_foreach(route, cpt, _link) {
- link = static_cast<LinkL07Ptr>(_link);
- lmm_expand_add(ptask_maxmin_system, link->getConstraint(),
- action->getVariable(),
- bytes_amount[i * host_nb + j]);
- }
- }
- }