/**************************************/
/*** Resource Creation & Destruction **/
/**************************************/
/**************************************/
/*** Resource Creation & Destruction **/
/**************************************/
{
XBT_CINFO(xbt_cfg,"Switching to the L07 model to handle parallel tasks.");
xbt_assert(!surf_cpu_model_pm, "CPU model type already defined");
xbt_assert(!surf_network_model, "network model type already defined");
surf_host_model = new simgrid::surf::HostL07Model();
{
XBT_CINFO(xbt_cfg,"Switching to the L07 model to handle parallel tasks.");
xbt_assert(!surf_cpu_model_pm, "CPU model type already defined");
xbt_assert(!surf_network_model, "network model type already defined");
surf_host_model = new simgrid::surf::HostL07Model();
surf_network_model = new NetworkL07Model(this,maxminSystem_);
surf_cpu_model_pm = new CpuL07Model(this,maxminSystem_);
surf_network_model = new NetworkL07Model(this,maxminSystem_);
surf_cpu_model_pm = new CpuL07Model(this,maxminSystem_);
- routing_model_create(surf_network_model->createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE, NULL));
+ routing_model_create(surf_network_model->createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE, nullptr));
- for(ActionList::iterator it(running_actions->begin()), itend(running_actions->end())
- ; it != itend ; ++it) {
- action = static_cast<L07Action*>(&*it);
+ for(ActionList::iterator it(running_actions->begin()), itend(running_actions->end()); it != itend ; ++it) {
+ action = static_cast<L07Action*>(&*it);
- XBT_DEBUG("Updating min (value) with %p (start %f): %f", action,
- action->getStartTime(), min);
+ XBT_DEBUG("Updating min (value) with %p (start %f): %f", action, action->getStartTime(), min);
- XBT_DEBUG("Updating min (latency) with %p (start %f): %f", action,
- action->getStartTime(), min);
+ XBT_DEBUG("Updating min (latency) with %p (start %f): %f", action, action->getStartTime(), min);
return new L07Action(this, host_nb, host_list, flops_amount, bytes_amount, rate);
}
return new L07Action(this, host_nb, host_list, flops_amount, bytes_amount, rate);
}
-L07Action::L07Action(Model *model, int host_nb, sg_host_t*host_list,
- double *flops_amount, double *bytes_amount, double rate)
+L07Action::L07Action(Model *model, int host_nb, sg_host_t *host_list,
+ double *flops_amount, double *bytes_amount, double rate)
this->p_netcardList->push_back(host_list[i]->pimpl_netcard);
/* Compute the number of affected resources... */
this->p_netcardList->push_back(host_list[i]->pimpl_netcard);
/* Compute the number of affected resources... */
- if(bytes_amount != NULL) {
- xbt_dict_t ptask_parallel_task_link_set = xbt_dict_new_homogeneous(NULL);
+ if(bytes_amount != nullptr) {
+ xbt_dict_t ptask_parallel_task_link_set = xbt_dict_new_homogeneous(nullptr);
- xbt_dict_set(ptask_parallel_task_link_set, link->getName(), link, NULL);
+ xbt_dict_set(ptask_parallel_task_link_set, link->getName(), link, nullptr);
lmm_expand(model->getMaxminSystem(), host_list[i]->pimpl_cpu->getConstraint(),
this->getVariable(), flops_amount[i]);
lmm_expand(model->getMaxminSystem(), host_list[i]->pimpl_cpu->getConstraint(),
this->getVariable(), flops_amount[i]);
- routing_platf->getRouteAndLatency((*p_netcardList)[i], (*p_netcardList)[j], route, NULL);
+ routing_platf->getRouteAndLatency((*p_netcardList)[i], (*p_netcardList)[j], route, nullptr);
for (auto link : *route)
lmm_expand_add(model->getMaxminSystem(), link->getConstraint(), this->getVariable(), bytes_amount[i * host_nb + j]);
for (auto link : *route)
lmm_expand_add(model->getMaxminSystem(), link->getConstraint(), this->getVariable(), bytes_amount[i * host_nb + j]);
-Action *NetworkL07Model::communicate(NetCard *src, NetCard *dst, double size, double rate)
+Action *NetworkL07Model::communicate(kernel::routing::NetCard *src, kernel::routing::NetCard *dst, double size, double rate)
{
sg_host_t*host_list = xbt_new0(sg_host_t, 2);
double *flops_amount = xbt_new0(double, 2);
{
sg_host_t*host_list = xbt_new0(sg_host_t, 2);
double *flops_amount = xbt_new0(double, 2);
return p_hostModel->executeParallelTask(2, host_list, flops_amount, bytes_amount, rate);
}
return p_hostModel->executeParallelTask(2, host_list, flops_amount, bytes_amount, rate);
}
{
return new CpuL07(this, host, speedPerPstate, core);
}
{
return new CpuL07(this, host, speedPerPstate, core);
}
-CpuL07::CpuL07(CpuL07Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core)
+CpuL07::CpuL07(CpuL07Model *model, simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core)
: Cpu(model, host, speedPerPstate, core)
{
: Cpu(model, host, speedPerPstate, core)
{
- constraint_ = lmm_constraint_new(model->getMaxminSystem(), this, xbt_dynar_get_as(speedPerPstate,0,double));
+ constraint_ = lmm_constraint_new(model->getMaxminSystem(), this, speedPerPstate->front());
LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy)
LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy)
- return static_cast<CpuL07Model*>(getModel())->p_hostModel
- ->executeParallelTask( 1, host_list, flops_amount, NULL, -1);
+ return static_cast<CpuL07Model*>(getModel())->p_hostModel->executeParallelTask(1, host_list, flops_amount, nullptr, -1);
lmm_update_constraint_bound(getModel()->getMaxminSystem(), getConstraint(), speed_.peak * speed_.scale);
lmm_update_constraint_bound(getModel()->getMaxminSystem(), getConstraint(), speed_.peak * speed_.scale);
- while ((var = lmm_get_var_from_cnst
- (getModel()->getMaxminSystem(), getConstraint(), &elem))) {
+ while ((var = lmm_get_var_from_cnst (getModel()->getMaxminSystem(), getConstraint(), &elem))) {
- lmm_update_variable_bound(getModel()->getMaxminSystem(),
- action->getVariable(),
- speed_.scale * speed_.peak);
+ lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(), speed_.scale * speed_.peak);
- lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(),
- std::min(m_rate, lat_bound));
+ lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(), std::min(m_rate, lat_bound));