"Logging specific to the SURF CPU IMPROVED module");
}
-static xbt_swag_t
- cpu_running_action_set_that_does_not_need_being_checked = NULL;
-
/*************
* CallBacks *
*************/
xbt_die("Unsupported optimization (%s) for this model", optim);
}
- cpu_running_action_set_that_does_not_need_being_checked =
+ p_cpuRunningActionSetThatDoesNotNeedBeingChecked =
xbt_swag_new(xbt_swag_offset(*action, p_stateHookup));
if (p_updateMechanism == UM_LAZY) {
surf_cpu_model_pm = NULL;
- xbt_swag_free(cpu_running_action_set_that_does_not_need_being_checked);
- cpu_running_action_set_that_does_not_need_being_checked = NULL;
+ xbt_swag_free(p_cpuRunningActionSetThatDoesNotNeedBeingChecked);
}
void CpuCas01Model::parseInit(sg_platf_host_cbarg_t host)
/* Move to the *end* of the corresponding action set. This convention
is used to speed up update_resource_state */
xbt_swag_remove(static_cast<ActionPtr>(action), action->p_stateSet);
- action->p_stateSet = cpu_running_action_set_that_does_not_need_being_checked;
+ action->p_stateSet = static_cast<CpuCas01ModelPtr>(p_model)->p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
xbt_swag_insert(static_cast<ActionPtr>(action), action->p_stateSet);
}
xbt_dict_t cpu_properties);
double shareResourcesFull(double now);
void addTraces();
+ xbt_swag_t p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
};
/************
xbt_lib_cursor_t cursor;
char *key;
- xbt_lib_foreach(host_lib, cursor, key, cpu){
- if(cpu[SURF_CPU_LEVEL])
- {
- CpuTiPtr CPU = dynamic_cast<CpuTiPtr>(static_cast<ResourcePtr>(cpu[SURF_CPU_LEVEL]));
- xbt_swag_free(CPU->p_actionSet);
- delete CPU->p_availTrace;
- }
- }
-
surf_cpu_model_pm = NULL;
xbt_swag_free
}
};
+CpuTi::~CpuTi(){
+delete p_availTrace;
+xbt_swag_free(p_actionSet);
+}
+
void CpuTi::updateState(tmgr_trace_event_t event_type,
double value, double date)
{
int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
xbt_dict_t properties) ;
- ~CpuTi() {};
+ ~CpuTi();
void updateState(tmgr_trace_event_t event_type, double value, double date);
void updateActionFinishDate(double now);
/** \brief Frees all memory allocated by the routing module */
void routing_exit(void) {
- if (routing_platf)
- delete routing_platf;
+ delete routing_platf;
}
RoutingPlatf::~RoutingPlatf()
for (i = 0; i < table_size; i++)
for (j = 0; j < table_size; j++) {
if (TO_ROUTE_FULL(i,j)){
- if (TO_ROUTE_FULL(i,j)->link_list)
- xbt_dynar_free(&TO_ROUTE_FULL(i,j)->link_list);
+ xbt_dynar_free(&TO_ROUTE_FULL(i,j)->link_list);
xbt_free(TO_ROUTE_FULL(i,j));
}
}
e_surf_link_sharing_policy_t
policy, xbt_dict_t properties)
{
- LinkL07Ptr nw_link = new LinkL07(this, xbt_strdup(name), properties);
+ LinkL07Ptr nw_link = new LinkL07(this, name, properties);
xbt_assert(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
"Link '%s' declared several times in the platform file.",
name);