remaining -= datasize;
send_migration_data(vm_name, src_pm_name, dst_pm_name, datasize, mbox, 1, 0, mig_speed, xfer_cpu_overhead);
-
double computed = lookup_computed_flop_counts(vm, 1, 0);
computed_total += computed;
// launch_deferred_exec_process(vm, overhead, 10000);
// }
}
-
+ xbt_free(mbox);
return computed_total;
}
{
msg_task_t task = NULL;
msg_error_t ret = MSG_task_recv(&task, mbox_ctl);
+
xbt_assert(ret == MSG_OK);
char *expected_task_name = get_mig_task_name(sg_host_name(vm), sg_host_name(src_pm), sg_host_name(dst_pm), 4);
xbt_assert(strcmp(task->name, expected_task_name) == 0);
xbt_free(expected_task_name);
+ MSG_task_destroy(task);
}
xbt_free(mbox_ctl);
}
Cpu::~Cpu(){
- if (getModel()->getUpdateMechanism() != UM_UNDEFINED){
+ if (p_constraintCoreId){
for (int i = 0; i < m_core; i++) {
xbt_free(p_constraintCoreId[i]);
}
xbt_free(p_constraintCore);
- xbt_free(p_constraintCoreId);
}
+ if (p_constraintCoreId)
+ xbt_free(p_constraintCoreId);
}
double Cpu::getSpeed(double load)
return m_remains;
}
+double Action::getRemainsNoUpdate()
+{
+ return m_remains;
+}
+
//FIXME split code in the right places
void Action::updateRemainingLazy(double now)
{
void setCategory(const char *category); /**< Set the category of an action */
#endif
virtual double getRemains(); /**< Get the remains of an action */
+ double getRemainsNoUpdate();
+
#ifdef HAVE_LATENCY_BOUND_TRACKING
int getLatencyLimited(); /**< Return 1 if action is limited by latency, 0 otherwise */
#endif
-
double getPriority() {return m_priority;};
ActionListPtr getStateSet() {return p_stateSet;};
xbt_assert(ret == 1, "Bug: some resource still remains");
/* Free the cpu resource of the VM. If using power_trace, we will have to */
- delete cpu;
+ //delete cpu;
/* Free the network resource of the VM. */
// Nothing has to be done, because net_elmts is just a pointer on the physical one
e_surf_action_state_t state = p_action->getState();
if (state != SURF_ACTION_DONE)
XBT_CRITICAL("FIXME: may need a proper handling, %d", state);
- if (p_action->getRemains() > 0)
- XBT_CRITICAL("FIXME: need copy the state(?), %f", p_action->getRemains());
+ if (p_action->getRemainsNoUpdate() > 0)
+ XBT_CRITICAL("FIXME: need copy the state(?), %f", p_action->getRemainsNoUpdate());
int ret = p_action->unref();
xbt_assert(ret == 1, "Bug: some resource still remains");
*/
WorkstationVM::~WorkstationVM()
{
- /* ind_phys_workstation equals to smx_host_t */
- surf_resource_t ind_vm_workstation = xbt_lib_get_elm_or_null(host_lib, getName());
-
- /* Before clearing the entries in host_lib, we have to pick up resources. */
- CpuCas01Ptr cpu = static_cast<CpuCas01Ptr>(surf_cpu_resource_priv(ind_vm_workstation));
-
- /* We deregister objects from host_lib, without invoking the freeing callback
- * of each level.
- *
- * Do not call xbt_lib_remove() here. It deletes all levels of the key,
- * including MSG_HOST_LEVEL and others. We should unregister only what we know.
- */
- xbt_lib_unset(host_lib, getName(), SURF_CPU_LEVEL, 0);
- xbt_lib_unset(host_lib, getName(), ROUTING_HOST_LEVEL, 0);
- xbt_lib_unset(host_lib, getName(), SURF_WKS_LEVEL, 0);
-
- /* TODO: comment out when VM stroage is implemented. */
- // xbt_lib_unset(host_lib, name, SURF_STORAGE_LEVEL, 0);
-
-
- /* Free the cpu_action of the VM. */
- int ret = p_action->unref();
- xbt_assert(ret == 1, "Bug: some resource still remains");
-
- /* Free the cpu resource of the VM. If using power_trace, we will have to */
- delete cpu;
}
/*