mnt.name = xbt_strdup(mount->name);
if(!mount_list){
- //FIXME:XBT_DEBUG("Create a Mount list for %s",A_surfxml_host_id);
+ XBT_DEBUG("Create a Mount list for %s",A_surfxml_host_id);
mount_list = xbt_dynar_new(sizeof(s_mount_t), mount_free);
}
xbt_dynar_push(mount_list,&mnt);
**********/
StorageActionLmm::StorageActionLmm(ModelPtr model, double cost, bool failed, StorageLmmPtr storage, e_surf_action_storage_type_t type)
- : Action(model, cost, failed), ActionLmm(model, cost, failed), StorageAction(model, cost, failed, storage, type) {
+ : Action(model, cost, failed),
+ ActionLmm(model, cost, failed),
+ StorageAction(model, cost, failed, storage, type) {
XBT_IN("(%s,%g", storage->m_name, cost);
p_variable = lmm_variable_new(p_model->p_maxminSystem, this, 1.0, -1.0 , 3);
lmm_expand(p_model->p_maxminSystem, storage->p_constraintWrite,
p_variable, 1.0);
xbt_dynar_push(storage->p_writeActions, static_cast<ActionPtr>(this));
+ ref();
break;
}
XBT_OUT();
double min_by_cpu = p_cpuModel->shareResources(now);
double min_by_net = surf_network_model->shareResources(now);
-
- XBT_DEBUG("model %p, %s min_by_cpu %f, %s min_by_net %f",
- this, surf_cpu_model_pm->m_name.c_str(), min_by_cpu, surf_network_model->m_name.c_str(), min_by_net);
-
- if (min_by_cpu >= 0.0 && min_by_net >= 0.0)
- return min(min_by_cpu, min_by_net);
- else if (min_by_cpu >= 0.0)
- return min_by_cpu;
- else if (min_by_net >= 0.0)
- return min_by_net;
- else
- return min_by_cpu; /* probably min_by_cpu == min_by_net == -1 */
+ double min_by_sto = -1;
+ if (p_cpuModel == surf_cpu_model_pm)
+ min_by_sto = surf_storage_model->shareResources(now);
+
+ XBT_DEBUG("model %p, %s min_by_cpu %f, %s min_by_net %f, %s min_by_sto %f",
+ this, surf_cpu_model_pm->m_name.c_str(), min_by_cpu,
+ surf_network_model->m_name.c_str(), min_by_net,
+ surf_storage_model->m_name.c_str(), min_by_sto);
+
+ double res = max(max(min_by_cpu, min_by_net), min_by_sto);
+ if (min_by_cpu >= 0.0 && min_by_cpu < res)
+ res = min_by_cpu;
+ if (min_by_net >= 0.0 && min_by_net < res)
+ res = min_by_net;
+ if (min_by_sto >= 0.0 && min_by_sto < res)
+ res = min_by_sto;
+ return res;
}
void WorkstationModel::updateActionsState(double /*now*/, double /*delta*/){